Skip to content

Commit

Permalink
Make proxy_read() return -ECONNRESET when the connection is closed
Browse files Browse the repository at this point in the history
Otherwise it hangs for ever, which is unfriendly.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jun 23, 2014
1 parent 59c8722 commit 41b1a1f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions http.c
Expand Up @@ -1405,6 +1405,8 @@ static int proxy_read(struct openconnect_info *vpninfo, char *buf, size_t len)
i = recv(fd, (void *)&buf[count], len - count, 0);
if (i < 0)
return -errno;
else if (i == 0)
return -ECONNRESET;

count += i;
}
Expand Down

0 comments on commit 41b1a1f

Please sign in to comment.