X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilcutil%2Fwin32%2Fsilcwin32sockconn.c;h=abc3523721cb9b294314290dfe9e41b93e88d544;hb=d1e71f42379e8b5cd0748a7aeae8561b02cfe53d;hp=c63a77eabd8a80ff0f0bf7f83f07213be576225e;hpb=d47a87b03b846e2333ef57b2c0d81f1644992964;p=silc.git diff --git a/lib/silcutil/win32/silcwin32sockconn.c b/lib/silcutil/win32/silcwin32sockconn.c index c63a77ea..abc35237 100644 --- a/lib/silcutil/win32/silcwin32sockconn.c +++ b/lib/silcutil/win32/silcwin32sockconn.c @@ -4,12 +4,11 @@ Author: Pekka Riikonen - Copyright (C) 1997 - 2001 Pekka Riikonen + Copyright (C) 1997 - 2005 Pekka Riikonen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -33,6 +32,8 @@ int silc_socket_write(SilcSocketConnection sock) SOCKET fd = sock->sock; SilcBuffer src = sock->outbuf; + if (!src) + return -2; if (SILC_IS_DISABLED(sock)) return -1; @@ -51,6 +52,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); } @@ -122,7 +130,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) { /* XXX TODO */ return FALSE;