Mon, 22 Oct 2018 18:35:36 -0500
facebook: Allow sizes larger than 1MiB for received images
By default, purple_http_get() truncates received requests at 1MiB.
These days it's not uncommon for an image to exceed that size. This
patch removes that default limit from receiving images for the
Facebook protocol plugin.
| libpurple/protocols/facebook/data.c | file | annotate | diff | comparison | revisions |
--- a/libpurple/protocols/facebook/data.c Fri Oct 12 01:42:09 2018 +0000 +++ b/libpurple/protocols/facebook/data.c Mon Oct 22 18:35:36 2018 -0500 @@ -592,14 +592,21 @@ g_hash_table_iter_init(&iter, priv->imgs); while (g_hash_table_iter_next(&iter, (gpointer *) &img, NULL)) { + PurpleHttpRequest *req; + if (fb_data_image_get_active(img)) { continue; } img->priv->active = TRUE; url = fb_data_image_get_url(img); - con = purple_http_get(priv->gc, fb_data_image_cb, img, url); + + req = purple_http_request_new(url); + purple_http_request_set_max_len(req, -1); + con = purple_http_request(priv->gc, req, + fb_data_image_cb, img); fb_http_conns_add(priv->cons, con); + purple_http_request_unref(req); if (++active >= FB_DATA_ICON_MAX) { break;