comparison src/protocols/yahoo/yahoo_filexfer.c @ 8282:ab35a0bec13a

[gaim-migrate @ 9006] " This works around the crash on trying to send a file that's too big, by giving an error. It also makes Gaim not crash on canceling the send right there. It doesn't fix the crash on the server doing whatever it did to make us crash. Someone should send me a backtrace of trying to send say a 2meg file without this patch." --Tim Ringenbach committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Tue, 17 Feb 2004 18:45:25 +0000
parents f50c059b6384
children 76125b842b23
comparison
equal deleted inserted replaced
8281:98d8faecf5f1 8282:ab35a0bec13a
193 gc = xfer_data->gc; 193 gc = xfer_data->gc;
194 yd = gc->proto_data; 194 yd = gc->proto_data;
195 account = gaim_connection_get_account(gc); 195 account = gaim_connection_get_account(gc);
196 196
197 if (gaim_xfer_get_type(xfer) == GAIM_XFER_SEND) { 197 if (gaim_xfer_get_type(xfer) == GAIM_XFER_SEND) {
198 if (gaim_proxy_connect(account, gaim_account_get_string(account, "xfer_host", YAHOO_XFER_HOST), 198 if (gaim_xfer_get_size(xfer) >= 1048577) {
199 gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT),
200 yahoo_sendfile_connected, xfer) == -1)
201 {
202 gaim_notify_error(gc, NULL, _("File Transfer Aborted"), 199 gaim_notify_error(gc, NULL, _("File Transfer Aborted"),
203 _("Unable to establish file descriptor.")); 200 _("Gaim cannot send files over Yahoo! that are bigger than "
204 gaim_xfer_cancel_remote(xfer); 201 "One Megabyte (1,048,576 bytes)."));
202 gaim_xfer_cancel_local(xfer);
203 } else {
204 if (gaim_proxy_connect(account, gaim_account_get_string(account, "xfer_host", YAHOO_XFER_HOST),
205 gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT),
206 yahoo_sendfile_connected, xfer) == -1)
207 {
208 gaim_notify_error(gc, NULL, _("File Transfer Aborted"),
209 _("Unable to establish file descriptor."));
210 gaim_xfer_cancel_remote(xfer);
211 }
205 } 212 }
206 } else { 213 } else {
207 xfer->fd = gaim_proxy_connect(account, xfer_data->host, xfer_data->port, 214 xfer->fd = gaim_proxy_connect(account, xfer_data->host, xfer_data->port,
208 yahoo_receivefile_connected, xfer); 215 yahoo_receivefile_connected, xfer);
209 if (xfer->fd == -1) { 216 if (xfer->fd == -1) {