aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-11-13 16:53:48 +0000
committerNick Mathewson <nickm@torproject.org>2004-11-13 16:53:48 +0000
commit08627d5d87294ee86b252dac0a2f9f003d7e24bf (patch)
treeb55f42a35cf6c24d724c94aaf67b17866e38c377 /src/or/connection.c
parentec7d0d43f4d9808a849f2575ee30861c5d3da742 (diff)
downloadtor-08627d5d87294ee86b252dac0a2f9f003d7e24bf.tar
tor-08627d5d87294ee86b252dac0a2f9f003d7e24bf.tar.gz
Track whether descriptor is dirty/uploaded. When any options are set, mark it dirty. Once a minute, regenerate and upload the server descriptor if it is dirty.
svn:r2832
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 47b796eab..d1dbf0cfc 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -871,11 +871,14 @@ static int connection_read_to_buf(connection_t *conn) {
result = read_to_buf_tls(conn->tls, at_most, conn->inbuf);
switch(result) {
- case TOR_TLS_ERROR:
case TOR_TLS_CLOSE:
+ log_fn(LOG_INFO,"TLS connection closed on read. Closing. (Nickname %s, address %s",
+ conn->nickname ? conn->nickname : "not set", conn->address);
+ return -1;
+ case TOR_TLS_ERROR:
log_fn(LOG_INFO,"tls error. breaking (nickname %s, address %s).",
conn->nickname ? conn->nickname : "not set", conn->address);
- return -1; /* XXX deal with close better */
+ return -1;
case TOR_TLS_WANTWRITE:
connection_start_writing(conn);
return 0;
@@ -993,10 +996,11 @@ int connection_handle_write(connection_t *conn) {
switch(result) {
case TOR_TLS_ERROR:
case TOR_TLS_CLOSE:
- log_fn(LOG_INFO,"tls error. breaking.");
+ log_fn(LOG_INFO,result==TOR_TLS_ERROR?
+ "tls error. breaking.":"TLS connection closed on flush");
connection_close_immediate(conn); /* Don't flush; connection is dead. */
connection_mark_for_close(conn);
- return -1; /* XXX deal with close better */
+ return -1;
case TOR_TLS_WANTWRITE:
log_fn(LOG_DEBUG,"wanted write.");
/* we're already writing */