summaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-01-20 20:18:32 +0000
committerNick Mathewson <nickm@torproject.org>2005-01-20 20:18:32 +0000
commitfd41cbcadf93698f1e07343d82b92863671f0542 (patch)
tree5658a0157981022790bc09eaea6e55fd49994180 /src/or/directory.c
parent362d89fb6292390654b818cd0dc8e83d1e76bd6f (diff)
downloadtor-fd41cbcadf93698f1e07343d82b92863671f0542.tar.gz
tor-fd41cbcadf93698f1e07343d82b92863671f0542.zip
Have reason string for serverdesc post requests contain actual serverdesc status. Also fix return values of dirserv_add_descriptor to work as advertised.
svn:r3391
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 567be557a9..1894a7209a 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -976,19 +976,20 @@ directory_handle_command_post(connection_t *conn, char *headers,
log_fn(LOG_INFO,"rewritten url as '%s'.", url);
if (!strcmp(url,"/tor/")) { /* server descriptor post */
+ const char *msg;
cp = body;
- switch (dirserv_add_descriptor(&cp)) {
+ switch (dirserv_add_descriptor(&cp, &msg)) {
case -1:
/* malformed descriptor, or something wrong */
- write_http_status_line(conn, 400, "Malformed or unacceptable server descriptor");
+ write_http_status_line(conn, 400, msg?msg:"Malformed or unacceptable server descriptor");
break;
case 0:
/* descriptor was well-formed but server has not been approved */
- write_http_status_line(conn, 200, "Unverified server descriptor accepted. Have you mailed us your key fingerprint? Are you using the right key?");
+ write_http_status_line(conn, 200, msg?msg:"Unverified server descriptor accepted");
break;
case 1:
dirserv_get_directory(&cp, 0); /* rebuild and write to disk */
- write_http_status_line(conn, 200, "Verified server descriptor accepted");
+ write_http_status_line(conn, 200, msg?msg:"Verified server descriptor accepted");
break;
}
tor_free(url);