pidgin: e62b4e50: A similar size limit for MSN buddy icon ...

datallah at pidgin.im datallah at pidgin.im
Fri Aug 8 22:30:47 EDT 2008


-----------------------------------------------------------------
Revision: e62b4e504b56e4f3909ef285bda4d55dfb7504bf
Ancestor: c083ec5718de3aa45ff6a04fa1a62acde9650520
Author: datallah at pidgin.im
Date: 2008-08-09T02:19:02
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/e62b4e504b56e4f3909ef285bda4d55dfb7504bf

Modified files:
        libpurple/protocols/msn/msn.c

ChangeLog: 

A similar size limit for MSN buddy icon retrieval from arbitrary urls.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/msn.c	dc86f99b10df2b1612a0c870abfe92baf34f2d46
+++ libpurple/protocols/msn/msn.c	f799aa0cfe87c353ee7e8242ca10664ff397e13c
@@ -48,6 +48,7 @@
 #include "slplink.h"
 
 #if PHOTO_SUPPORT
+#define MAX_HTTP_BUDDYICON_BYTES (200 * 1024)
 #include "imgstore.h"
 #endif
 
@@ -1886,6 +1887,7 @@ msn_got_info(PurpleUtilFetchUrlData *url
 	purple_debug_info("msn", "In msn_got_info,url_text:{%s}\n",url_text);
 
 	/* Make sure the connection is still valid */
+	/* TODO: Instead of this, we should be canceling this when we disconnect */
 	if (g_list_find(purple_connections_get_all(), info_data->gc) == NULL)
 	{
 		purple_debug_warning("msn", "invalid connection. ignoring buddy info.\n");
@@ -2275,7 +2277,7 @@ msn_got_info(PurpleUtilFetchUrlData *url
 	/* Try to put the photo in there too, if there's one */
 	if (photo_url_text)
 	{
-		purple_util_fetch_url(photo_url_text, FALSE, NULL, FALSE, msn_got_photo,
+		purple_util_fetch_url_len(photo_url_text, FALSE, NULL, FALSE, MAX_HTTP_BUDDYICON_BYTES, msn_got_photo,
 					   info2_data);
 	}
 	else
@@ -2301,6 +2303,7 @@ msn_got_photo(PurpleUtilFetchUrlData *ur
 	char *photo_url_text = info2_data->photo_url_text;
 
 	/* Make sure the connection is still valid if we got here by fetching a photo url */
+	/* TODO: Instead of this, we should be canceling this when we disconnect */
 	if (url_text && (error_message != NULL ||
 					 g_list_find(purple_connections_get_all(), info_data->gc) == NULL))
 	{


More information about the Commits mailing list