From 1e4bf96a628f673b9f32e36ed9597bc7ef1538db Mon Sep 17 00:00:00 2001 From: bluhm Date: Sun, 10 Aug 2014 21:55:17 +0000 Subject: [PATCH] There was a race in relayd that caused connections to hang. It happend with non-persistent PUT connections that had a very short body. If the whole body was read from the client before the connection to the server was set up, the event callback was not called. Do the regular checks after relay_connect() succeeded. OK reyk@ --- usr.sbin/relayd/relay_http.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.sbin/relayd/relay_http.c b/usr.sbin/relayd/relay_http.c index 53d3af6d39c..8c711df416a 100644 --- a/usr.sbin/relayd/relay_http.c +++ b/usr.sbin/relayd/relay_http.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relay_http.c,v 1.32 2014/07/17 11:35:26 stsp Exp $ */ +/* $OpenBSD: relay_http.c,v 1.33 2014/08/10 21:55:17 bluhm Exp $ */ /* * Copyright (c) 2006 - 2014 Reyk Floeter @@ -427,9 +427,10 @@ relay_read_http(struct bufferevent *bev, void *arg) relay_bindanyreq(con, 0, IPPROTO_TCP); return; } - if (relay_connect(con) == -1) + if (relay_connect(con) == -1) { relay_abort_http(con, 502, "session failed", 0); - return; + return; + } } } if (con->se_done) { -- 2.20.1