Fixed outoing packet queue handling bug on very high load.
[silc.git] / lib / silcutil / unix / silcunixsockconn.c
index f6d8744a62d1757b5d4251d8f9d7559a79b94cd4..02af7cc747646009ef560a7fc0db57570587e436 100644 (file)
@@ -50,6 +50,13 @@ int silc_socket_write(SilcSocketConnection sock)
       return -1;
     }
 
+    if (ret < src->len) {
+      SILC_LOG_DEBUG(("Wrote data %d of %d bytes, will write rest later",
+                     ret, src->len));
+      silc_buffer_pull(src, ret);
+      return -2;
+    }
+
     silc_buffer_pull(src, ret);
   }
 
@@ -109,7 +116,7 @@ int silc_socket_read(SilcSocketConnection sock)
 /* Returns human readable socket error message */
 
 bool silc_socket_get_error(SilcSocketConnection sock, char *error,
-                          uint32 error_len)
+                          SilcUInt32 error_len)
 {
   char *err;