comparison src/protocols/yahoo/yahoo_filexfer.c @ 10575:96307e1a47c9

[gaim-migrate @ 11968] This makes Yahoo roomlist & filetransfer work with HTTP proxies (except when authentication is needed), webauth probably works too but I couldn't work out how to test that. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 05 Feb 2005 18:24:50 +0000
parents 45a0a07e8b25
children 6c6772d3ea31
comparison
equal deleted inserted replaced
10574:77ef3f2f0df8 10575:96307e1a47c9
72 } 72 }
73 73
74 xfer->fd = source; 74 xfer->fd = source;
75 gaim_xfer_start(xfer, source, NULL, 0); 75 gaim_xfer_start(xfer, source, NULL, 0);
76 76
77 buf = g_strdup_printf("GET /%s HTTP/1.0\r\nHost: %s\r\n\r\n", xd->path, xd->host); 77 buf = g_strdup_printf("GET http://%s:%d/%s HTTP/1.0\r\nHost: %s\r\n\r\n",
78 xd->host, xd->port, xd->path, xd->host);
78 write(xfer->fd, buf, strlen(buf)); 79 write(xfer->fd, buf, strlen(buf));
79 g_free(buf); 80 g_free(buf);
80 81
81 return; 82 return;
82 } 83 }
85 { 86 {
86 GaimXfer *xfer; 87 GaimXfer *xfer;
87 struct yahoo_xfer_data *xd; 88 struct yahoo_xfer_data *xd;
88 struct yahoo_packet *pkt; 89 struct yahoo_packet *pkt;
89 gchar *size, *post, *buf; 90 gchar *size, *post, *buf;
90 int content_length; 91 int content_length, port;
91 GaimConnection *gc; 92 GaimConnection *gc;
92 GaimAccount *account; 93 GaimAccount *account;
93 struct yahoo_data *yd; 94 struct yahoo_data *yd;
94 char *filename; 95 char *filename;
95 96
126 127
127 content_length = YAHOO_PACKET_HDRLEN + yahoo_packet_length(pkt); 128 content_length = YAHOO_PACKET_HDRLEN + yahoo_packet_length(pkt);
128 129
129 buf = g_strdup_printf("Y=%s; T=%s", yd->cookie_y, yd->cookie_t); 130 buf = g_strdup_printf("Y=%s; T=%s", yd->cookie_y, yd->cookie_t);
130 131
131 post = g_strdup_printf("POST /notifyft HTTP/1.0\r\n" 132 port = gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT);
133 post = g_strdup_printf("POST http://%s:%d/notifyft HTTP/1.0\r\n"
132 "Content-length: %" G_GSIZE_FORMAT "\r\n" 134 "Content-length: %" G_GSIZE_FORMAT "\r\n"
133 "Host: %s:%d\r\n" 135 "Host: %s:%d\r\n"
134 "Cookie: %s\r\n" 136 "Cookie: %s\r\n"
135 "\r\n", 137 "\r\n",
136 content_length + 4 + gaim_xfer_get_size(xfer),
137 gaim_account_get_string(account, "xfer_host", YAHOO_XFER_HOST), 138 gaim_account_get_string(account, "xfer_host", YAHOO_XFER_HOST),
138 gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT), 139 port, content_length + 4 + gaim_xfer_get_size(xfer),
139 buf); 140 gaim_account_get_string(account, "xfer_host", YAHOO_XFER_HOST),
141 port, buf);
140 write(xfer->fd, post, strlen(post)); 142 write(xfer->fd, post, strlen(post));
141 143
142 yahoo_packet_send_special(pkt, xfer->fd, 8); 144 yahoo_packet_send_special(pkt, xfer->fd, 8);
143 yahoo_packet_free(pkt); 145 yahoo_packet_free(pkt);
144 146