diff 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
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo_filexfer.c	Tue Feb 17 15:58:20 2004 +0000
+++ b/src/protocols/yahoo/yahoo_filexfer.c	Tue Feb 17 18:45:25 2004 +0000
@@ -195,13 +195,20 @@
 	account = gaim_connection_get_account(gc);
 
 	if (gaim_xfer_get_type(xfer) == GAIM_XFER_SEND) {
-		if (gaim_proxy_connect(account, gaim_account_get_string(account, "xfer_host",  YAHOO_XFER_HOST),
-		                       gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT),
-		                       yahoo_sendfile_connected, xfer) == -1)
-		{
+		if (gaim_xfer_get_size(xfer) >= 1048577) {
 			gaim_notify_error(gc, NULL, _("File Transfer Aborted"),
-			                 _("Unable to establish file descriptor."));
-			gaim_xfer_cancel_remote(xfer);
+			                  _("Gaim cannot send files over Yahoo! that are bigger than "
+			                    "One Megabyte (1,048,576 bytes)."));
+			gaim_xfer_cancel_local(xfer);
+		} else {
+			if (gaim_proxy_connect(account, gaim_account_get_string(account, "xfer_host",  YAHOO_XFER_HOST),
+			                       gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT),
+			                       yahoo_sendfile_connected, xfer) == -1)
+			{
+				gaim_notify_error(gc, NULL, _("File Transfer Aborted"),
+				                 _("Unable to establish file descriptor."));
+				gaim_xfer_cancel_remote(xfer);
+			}
 		}
 	} else {
 		xfer->fd = gaim_proxy_connect(account, xfer_data->host, xfer_data->port,