dovecot-2.2: lib-http client: Added inline function to check whe...

dovecot at dovecot.org dovecot at dovecot.org
Tue Aug 18 18:02:35 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/5c53d13a30ab
changeset: 18961:5c53d13a30ab
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Tue Aug 18 20:39:24 2015 +0300
description:
lib-http client: Added inline function to check whether request is directed at a proxy.

diffstat:

 src/lib-http/http-client-private.h |  6 ++++++
 src/lib-http/http-client-request.c |  3 ++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r 58694b53e730 -r 5c53d13a30ab src/lib-http/http-client-private.h
--- a/src/lib-http/http-client-private.h	Tue Aug 18 20:39:24 2015 +0300
+++ b/src/lib-http/http-client-private.h	Tue Aug 18 20:39:24 2015 +0300
@@ -412,6 +412,12 @@
 	}
 }
 
+static inline bool
+http_client_request_to_proxy(const struct http_client_request *req)
+{
+	return (req->host_url != &req->origin_url);
+}
+
 static inline const char *
 http_client_connection_label(struct http_client_connection *conn)
 {
diff -r 58694b53e730 -r 5c53d13a30ab src/lib-http/http-client-request.c
--- a/src/lib-http/http-client-request.c	Tue Aug 18 20:39:24 2015 +0300
+++ b/src/lib-http/http-client-request.c	Tue Aug 18 20:39:24 2015 +0300
@@ -797,7 +797,8 @@
 			o_stream_ref(output);
 		}
 	}
-	if (!req->have_hdr_connection && req->host_url == &req->origin_url) {
+	if (!req->have_hdr_connection &&
+		!http_client_request_to_proxy(req)) {
 		/* https://tools.ietf.org/html/rfc2068
 		     Section 19.7.1:
 


More information about the dovecot-cvs mailing list