projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added SILC Server library.
[silc.git]
/
lib
/
silcutil
/
win32
/
silcwin32sockconn.c
diff --git
a/lib/silcutil/win32/silcwin32sockconn.c
b/lib/silcutil/win32/silcwin32sockconn.c
index c63a77eabd8a80ff0f0bf7f83f07213be576225e..31f702f48ec2b913e05b2be89563522e8ac15439 100644
(file)
--- a/
lib/silcutil/win32/silcwin32sockconn.c
+++ b/
lib/silcutil/win32/silcwin32sockconn.c
@@
-4,12
+4,11
@@
Author: Pekka Riikonen <priikone@silcnet.org>
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 200
1
Pekka Riikonen
+ Copyright (C) 1997 - 200
5
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
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
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-19,7
+18,7
@@
*/
/* $Id$ */
*/
/* $Id$ */
-#include "silc
includes
.h"
+#include "silc.h"
/* Writes data from encrypted buffer to the socket connection. If the
data cannot be written at once, it will be written later with a timeout.
/* Writes data from encrypted buffer to the socket connection. If the
data cannot be written at once, it will be written later with a timeout.
@@
-33,6
+32,8
@@
int silc_socket_write(SilcSocketConnection sock)
SOCKET fd = sock->sock;
SilcBuffer src = sock->outbuf;
SOCKET fd = sock->sock;
SilcBuffer src = sock->outbuf;
+ if (!src)
+ return -2;
if (SILC_IS_DISABLED(sock))
return -1;
if (SILC_IS_DISABLED(sock))
return -1;
@@
-51,6
+52,13
@@
int silc_socket_write(SilcSocketConnection sock)
return -1;
}
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);
}
silc_buffer_pull(src, ret);
}
@@
-121,8
+129,8
@@
int silc_socket_read(SilcSocketConnection sock)
/* Returns human readable socket error message */
/* Returns human readable socket error message */
-
b
ool silc_socket_get_error(SilcSocketConnection sock, char *error,
-
ui
nt32 error_len)
+
SilcB
ool silc_socket_get_error(SilcSocketConnection sock, char *error,
+
SilcUI
nt32 error_len)
{
/* XXX TODO */
return FALSE;
{
/* XXX TODO */
return FALSE;