From 51fc1cccbda2387f33ab5d651b9d16a3510db418 Mon Sep 17 00:00:00 2001 From: Bron Gondwana Date: Fri, 14 Sep 2012 22:14:55 +0200 Subject: [PATCH] workaround gnutls internal buffering https://bugzilla.xfce.org/show_bug.cgi?id=9284 xfce_mailwatch_net_conn_recv_internal always checks if the fd is readable, but if gnutls is buffering further data from the last packet internally, then the fd will not be readable despite there being more data to return. By making the buffer always big enough to receive a standard sized internet packet, we are reducing the risk of this case happening. It's not a perfect solution, but it sure is trivial... (a lot more trivial than this longwinded commit message!) --- libmailwatch-core/mailwatch-net-conn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmailwatch-core/mailwatch-net-conn.c b/libmailwatch-core/mailwatch-net-conn.c index d3662e8..44b4df9 100644 --- a/libmailwatch-core/mailwatch-net-conn.c +++ b/libmailwatch-core/mailwatch-net-conn.c @@ -914,7 +914,7 @@ xfce_mailwatch_net_conn_recv_line(XfceMailwatchNetConn *net_conn, gsize buf_len, GError **error) { -#define BUFSTEP 1024 +#define BUFSTEP 4096 gint bin; gchar *p = NULL; -- 1.7.10.4