If allow_partial, then allow a return 0 from the socket
authorYouness Alaoui <youness.alaoui@collabora.co.uk>
Sat, 5 Apr 2014 09:54:01 +0000 (05:54 -0400)
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>
Thu, 15 May 2014 13:43:14 +0000 (09:43 -0400)
agent/agent.c

index 1211a50..a6d7364 100644 (file)
@@ -3546,7 +3546,7 @@ nice_agent_send_messages_nonblocking_internal (
       if (n_sent < 0) {
         g_set_error (&child_error, G_IO_ERROR, G_IO_ERROR_FAILED,
             "Error writing data to socket.");
-      } else if (allow_partial) {
+      } else if (n_sent > 0 && allow_partial) {
         g_assert (n_messages == 1);
         n_sent = output_message_get_size (messages);
       }