changeset 23745:80ddf59e1585

A similar size limit for MSN buddy icon retrieval from arbitrary urls.
author Daniel Atallah <daniel.atallah@gmail.com>
date Sat, 09 Aug 2008 02:19:02 +0000
parents 3c3032be12de
children 357168efca68
files libpurple/protocols/msn/msn.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/msn.c	Sat Aug 09 01:58:27 2008 +0000
+++ b/libpurple/protocols/msn/msn.c	Sat Aug 09 02:19:02 2008 +0000
@@ -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 @@
 	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 @@
 	/* 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 @@
 	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))
 	{