commit 58851cddee16bcccfcae5f91b9472ffa1298a26f
Author: Oswald Buddenhagen <[email protected]>
Date: Sat Mar 19 19:40:50 2011 +0100
move responsibility for closing sockets on error to user
src/drv_imap.c | 1 +
src/socket.c | 4 ----
2 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/src/drv_imap.c b/src/drv_imap.c
index 3cab01a..da9cbc3 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -962,6 +962,7 @@ imap_socket_fail( void *aux )
{
imap_store_t *ctx = (imap_store_t *)aux;
+ socket_close( &ctx->conn );
ctx->gen.bad_callback( ctx->gen.bad_callback_aux );
}
diff --git a/src/socket.c b/src/socket.c
index ad00c9f..ec1dcd2 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -377,8 +377,6 @@ socket_fill( conn_t *sock )
read( sock->fd, buf, len );
if (n <= 0) {
socket_perror( "read", sock, n );
- close( sock->fd );
- sock->fd = -1;
return -1;
} else {
sock->bytes += n;
@@ -443,8 +441,6 @@ socket_write( conn_t *sock, char *buf, int len, ownership_t
takeOwn )
free( buf );
if (n != len) {
socket_perror( "write", sock, n );
- close( sock->fd );
- sock->fd = -1;
return -1;
}
return 0;
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel