changeset 9231:ac8790437abe

[gaim-migrate @ 10027] Patch from Felipe Contreras that fixes the sent bytes being reset to 0 after sending a file, and a small check to hopefully avoid a potential crash. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 07 Jun 2004 07:49:36 +0000
parents b83905afbb55
children 7ffeabe6a09e
files src/protocols/msn/slp.c src/protocols/msn/slplink.c
diffstat 2 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/slp.c	Mon Jun 07 05:29:36 2004 +0000
+++ b/src/protocols/msn/slp.c	Mon Jun 07 07:49:36 2004 +0000
@@ -629,6 +629,8 @@
 		slpcall = msn_slplink_find_slp_call(slplink, call_id);
 		g_free(call_id);
 
+		g_return_val_if_fail(slpcall != NULL, NULL);
+
 		if (strncmp(status, "200 OK", 6))
 		{
 			/* It's not valid. Kill this off. */
--- a/src/protocols/msn/slplink.c	Mon Jun 07 05:29:36 2004 +0000
+++ b/src/protocols/msn/slplink.c	Mon Jun 07 07:49:36 2004 +0000
@@ -298,8 +298,8 @@
 		if ((slpmsg->slpcall != NULL) &&
 			(slpmsg->slpcall->progress_cb != NULL))
 		{
-			slpmsg->slpcall->progress_cb(slpmsg->slpcall, slpmsg->size, len,
-										slpmsg->offset);
+			slpmsg->slpcall->progress_cb(slpmsg->slpcall, slpmsg->size,
+										 len, slpmsg->offset);
 		}
 	}
 
@@ -509,10 +509,14 @@
 		g_return_if_reached();
 	}
 
-	if ((slpmsg->slpcall != NULL) &&
-		(slpmsg->slpcall->progress_cb != NULL))
+	if (slpmsg->flags == 0x20 || slpmsg->flags == 0x1000030)
 	{
-		slpmsg->slpcall->progress_cb(slpmsg->slpcall, slpmsg->size, len, offset);
+		if ((slpmsg->slpcall != NULL) &&
+			(slpmsg->slpcall->progress_cb != NULL))
+		{
+			slpmsg->slpcall->progress_cb(slpmsg->slpcall, slpmsg->size,
+										 len, offset);
+		}
 	}
 
 #if 0