summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2008-08-11 10:35:07 +0200
committerWilly Tarreau <w@1wt.eu>2008-09-02 11:13:29 +0200
commitce3f248679dd095d3acf6579f4b7ef8bd5d33c86 (patch)
tree321975569f030b902a85b57cd8268cb00030a520
parent4e1756086def59e05a3c56fd2f57eb990038a071 (diff)
downloadhaproxy-ce3f248679dd095d3acf6579f4b7ef8bd5d33c86.tar.gz
[BUG] server timeout was not considered in some circumstances
Due to a copy-paste typo, the client timeout was refreshed instead of the server's when waiting for server response. This means that the server's timeout remained eternity. (cherry picked from commit 9f1f24bb7fb8ebd6b43b5fee1bda0afbdbcb768e) (cherry picked from commit df82605d3e73573ae842a1ddaf418997bef33274)
-rw-r--r--src/stream_sock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stream_sock.c b/src/stream_sock.c
index 08cc65b65..8bfc55baa 100644
--- a/src/stream_sock.c
+++ b/src/stream_sock.c
@@ -174,7 +174,7 @@ int stream_sock_read(int fd) {
* have at least read something.
*/
- if (b->flags & BF_PARTIAL_READ) {
+ if (b->flags & BF_PARTIAL_READ && tv_isset(&b->rex)) {
if (tv_add_ifset(&b->rex, &now, &b->rto))
goto out_wakeup;
out_eternity:
@@ -330,13 +330,13 @@ int stream_sock_write(int fd) {
* written something.
*/
- if (b->flags & BF_PARTIAL_WRITE) {
+ if (b->flags & BF_PARTIAL_WRITE && tv_isset(&b->wex)) {
if (tv_add_ifset(&b->wex, &now, &b->wto)) {
/* FIXME: to prevent the client from expiring read timeouts during writes,
* we refresh it. A solution would be to merge read+write timeouts into a
* unique one, although that needs some study particularly on full-duplex
* TCP connections. */
- if (!(b->flags & BF_SHUTR_STATUS))
+ if (!(b->flags & BF_SHUTR_STATUS) && tv_isset(&b->rex))
b->rex = b->wex;
goto out_wakeup;
}