aboutsummaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorDonncha O'Cearbhaill <donncha@donncha.is>2015-03-22 13:31:53 +0000
committerNick Mathewson <nickm@torproject.org>2015-05-04 11:41:28 -0400
commit841c4aa71505e9fea877f45223a0b01fade8a754 (patch)
tree1e64da197a2a0a3b57f695ad6dbc70fd374d2483 /src/or/directory.c
parent411049d0d44963b8d9ec6f96c8dc62a106d6cc30 (diff)
downloadtor-841c4aa71505e9fea877f45223a0b01fade8a754.tar.gz
tor-841c4aa71505e9fea877f45223a0b01fade8a754.zip
Add "+HSPOST" and related "HS_DESC" event flags to the controller.
"+HSPOST" and the related event changes allow the uploading of HS descriptors via the control port, and more comprehensive event monitoring of HS descriptor upload status.
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index bad1f62153..85da97fce1 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -2185,6 +2185,9 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
}
if (conn->base_.purpose == DIR_PURPOSE_UPLOAD_RENDDESC_V2) {
+ #define SEND_HS_DESC_UPLOAD_FAILED_EVENT(reason) ( \
+ control_event_hs_descriptor_upload_failed(conn->identity_digest, \
+ reason) )
log_info(LD_REND,"Uploaded rendezvous descriptor (status %d "
"(%s))",
status_code, escaped(reason));
@@ -2193,17 +2196,20 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
log_info(LD_REND,
"Uploading rendezvous descriptor: finished with status "
"200 (%s)", escaped(reason));
+ control_event_hs_descriptor_uploaded(conn->identity_digest);
break;
case 400:
log_warn(LD_REND,"http status 400 (%s) response from dirserver "
"'%s:%d'. Malformed rendezvous descriptor?",
escaped(reason), conn->base_.address, conn->base_.port);
+ SEND_HS_DESC_UPLOAD_FAILED_EVENT("UPLOAD_REJECTED");
break;
default:
log_warn(LD_REND,"http status %d (%s) response unexpected (server "
"'%s:%d').",
status_code, escaped(reason), conn->base_.address,
conn->base_.port);
+ SEND_HS_DESC_UPLOAD_FAILED_EVENT("UNEXPECTED");
break;
}
}