summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd/relay_http.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2015-06-08 15:47:52 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2015-06-08 15:47:52 +0000
commit985f899253c50eaf7b0a83f359d569ebc639a655 (patch)
tree5753c3389eabf5c1524f8d346595fb3f5df5b751 /usr.sbin/relayd/relay_http.c
parent45d7523d8bdbe0b6e65817f05cc4d739486abb9d (diff)
Introduce a state on the ctl_relay_event struct. This makes it possible
to better track the connection state of a session and stops doing double opens in certain situations using http relays. Using a state field to simplify the logic since relay_connect() is called multiple times. OK benno@, bluhm@ and running in production for more than a week
Diffstat (limited to 'usr.sbin/relayd/relay_http.c')
-rw-r--r--usr.sbin/relayd/relay_http.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/relayd/relay_http.c b/usr.sbin/relayd/relay_http.c
index e40014da9ef..7fc0cd9e633 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.48 2015/06/01 09:54:16 claudio Exp $ */
+/* $OpenBSD: relay_http.c,v 1.49 2015/06/08 15:47:51 claudio Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
@@ -421,7 +421,7 @@ relay_read_http(struct bufferevent *bev, void *arg)
relay_reset_http(cre);
done:
if (cre->dir == RELAY_DIR_REQUEST && cre->toread <= 0 &&
- cre->dst->bev == NULL) {
+ cre->dst->state != CONNECTED) {
if (rlay->rl_conf.fwdmode == FWD_TRANS) {
relay_bindanyreq(con, 0, IPPROTO_TCP);
return;