diff options
author | Michael Adam <obnox@samba.org> | 2013-11-23 12:04:02 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-11-23 12:09:59 +0100 |
commit | ffa3a56ab8f67a2c137f68fe5611fa6524128a8c (patch) | |
tree | ba3fa6db53978977dd6f2ea27d8a363b28cb8351 | |
parent | 76bd008cf944f2ecda73a6cf61ca27a900b19d01 (diff) | |
download | tinyproxy-ffa3a56ab8f67a2c137f68fe5611fa6524128a8c.tar.gz tinyproxy-ffa3a56ab8f67a2c137f68fe5611fa6524128a8c.zip |
buffer: reduce indentation in read_buffer()
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to '')
-rw-r--r-- | src/buffer.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/buffer.c b/src/buffer.c index 49216fd..4c046c6 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -236,29 +236,27 @@ ssize_t read_buffer (int fd, struct buffer_s * buffptr) "readbuff: add_to_buffer() error."); bytesin = -1; } + } else if (bytesin == 0) { + /* connection was closed by client */ + bytesin = -1; } else { - if (bytesin == 0) { - /* connection was closed by client */ - bytesin = -1; - } else { - switch (errno) { + switch (errno) { #ifdef EWOULDBLOCK - case EWOULDBLOCK: + case EWOULDBLOCK: #else # ifdef EAGAIN - case EAGAIN: + case EAGAIN: # endif #endif - case EINTR: - bytesin = 0; - break; - default: - log_message (LOG_ERR, - "readbuff: recv() error \"%s\" on file descriptor %d", - strerror (errno), fd); - bytesin = -1; - break; - } + case EINTR: + bytesin = 0; + break; + default: + log_message (LOG_ERR, + "readbuff: recv() error \"%s\" on file descriptor %d", + strerror (errno), fd); + bytesin = -1; + break; } } |