# HG changeset patch # User Daniel Atallah # Date 1136606175 0 # Node ID dd271caf25b0df3c418a2ffb0d06ca2e15c5912c # Parent b62d685cf84134d887f722692ca203e6be45e15c [gaim-migrate @ 15095] Deal with recv being unable to read anything. I also noticed that this kinda sucks because it assumes that it'll be able to read everything in one shot and doesn't buffer until the next read - somebody should fix that... wink, wink, nudge, nudge. committer: Tailor Script diff -r b62d685cf841 -r dd271caf25b0 src/protocols/simple/simple.c --- a/src/protocols/simple/simple.c Fri Jan 06 06:34:49 2006 +0000 +++ b/src/protocols/simple/simple.c Sat Jan 07 03:56:15 2006 +0000 @@ -1111,12 +1111,15 @@ int len; time_t currtime; + /** XXX: eek! What if we can't receive everything right now? + (need to maintain buffer for next read) */ static char buffer[65536]; - len = recv(source, buffer, 65536, 0); - buffer[len] = 0; - gaim_debug_info("simple","\n\nreceived - %s\n######\n%s\n#######\n\n",ctime(&currtime), buffer); - msg = sipmsg_parse_msg(buffer); - if(msg) process_input_message(sip, msg); + if((len = recv(source, buffer, 65536, 0))) { + buffer[len] = '\0'; + gaim_debug_info("simple","\n\nreceived - %s\n######\n%s\n#######\n\n",ctime(&currtime), buffer); + msg = sipmsg_parse_msg(buffer); + if(msg) process_input_message(sip, msg); + } } static void simple_input_cb(gpointer data, gint source, GaimInputCondition cond)