aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-03-22 18:43:24 +0000
committerNick Mathewson <nickm@torproject.org>2005-03-22 18:43:24 +0000
commit2d40991427a80ad25dccd8f2f26e0ef3fb1d9789 (patch)
tree02a4097e106a6b56ec550ce2cf5cc90b8b5ef598 /src/or/connection_or.c
parentd6a0e5bcc9311f073fff93275e3897017698fdb1 (diff)
downloadtor-2d40991427a80ad25dccd8f2f26e0ef3fb1d9789.tar
tor-2d40991427a80ad25dccd8f2f26e0ef3fb1d9789.tar.gz
Report HTTP reasons to directory clients. (Also, fix format on new TODO items)
svn:r3811
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 1b465c15b..675e9e89e 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -56,6 +56,7 @@ static int
connection_or_read_proxy_response(connection_t *conn) {
char *headers;
+ char *reason=NULL;
int status_code;
time_t date_header;
int compression;
@@ -73,26 +74,31 @@ connection_or_read_proxy_response(connection_t *conn) {
}
if (parse_http_response(headers, &status_code, &date_header,
- &compression) < 0) {
+ &compression, &reason) < 0) {
log_fn(LOG_WARN,"Unparseable headers (connecting to '%s'). Closing.",
conn->address);
tor_free(headers);
return -1;
}
+ if (!reason) reason = tor_strdup("[no reason given]");
if (status_code == 200) {
- log_fn(LOG_INFO,"https connect successful (to '%s')! Launching tls.",
- conn->address);
+ log_fn(LOG_INFO,
+ "HTTPS connect to '%s' successful! (200 \"%s\") Starting TLS.",
+ conn->address, reason);
+ tor_free(reason);
if (connection_tls_start_handshake(conn, 0) < 0) {
/* TLS handshaking error of some kind. */
connection_mark_for_close(conn);
+
return -1;
}
return 0;
}
/* else, bad news on the status code */
- log_fn(LOG_WARN,"The https proxy sent back a bad status code %d. Closing.",
- status_code);
+ log_fn(LOG_WARN,"The https proxy sent back an unexpected status code %d (\"%s\"). Closing.",
+ status_code, reason);
+ tor_free(reason);
connection_mark_for_close(conn);
return -1;
}