summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-11-22 21:56:39 +0100
committerMichael Adam <obnox@samba.org>2013-11-22 21:56:39 +0100
commit3710accf72e621fa97de20026f59069391d8c9d7 (patch)
treeecccb21820331930617baf6ef767a912ebd30f6f
parente07c363df24f5631477f895713728c31ddfd3d43 (diff)
downloadtinyproxy-3710accf72e621fa97de20026f59069391d8c9d7.tar.gz
tinyproxy-3710accf72e621fa97de20026f59069391d8c9d7.zip
reqs: Fix CID 1130969 (part 3) - unchecked return value from library.
Check the return value of socket_blocking (fcntl) at the end of relay_connection() for client socket. Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to '')
-rw-r--r--src/reqs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/reqs.c b/src/reqs.c
index 439d0e1..12935b4 100644
--- a/src/reqs.c
+++ b/src/reqs.c
@@ -1210,7 +1210,14 @@ static void relay_connection (struct conn_s *connptr)
* Here the server has closed the connection... write the
* remainder to the client and then exit.
*/
- socket_blocking (connptr->client_fd);
+ ret = socket_blocking (connptr->client_fd);
+ if (ret != 0) {
+ log_message(LOG_ERR,
+ "Failed to set client socket to blocking: %s",
+ strerror(errno));
+ return;
+ }
+
while (buffer_size (connptr->sbuffer) > 0) {
if (write_buffer (connptr->client_fd, connptr->sbuffer) < 0)
break;