aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-04-03 03:33:57 +0000
committerRoger Dingledine <arma@torproject.org>2004-04-03 03:33:57 +0000
commit7eaa655b6db66664b643b16b9d296b0858f31e42 (patch)
tree94527cdb1df8a46df30bf2eef4532c9844251839 /src
parentba196a9d1707361a6f9928f3fd616138e2c58647 (diff)
downloadtor-7eaa655b6db66664b643b16b9d296b0858f31e42.tar
tor-7eaa655b6db66664b643b16b9d296b0858f31e42.tar.gz
publish and fetch the right rendezvous urls
svn:r1463
Diffstat (limited to 'src')
-rw-r--r--src/or/directory.c10
-rw-r--r--src/or/rendcommon.c1
2 files changed, 7 insertions, 4 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 7ce9e56d4..646e73774 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -13,6 +13,9 @@ static int directory_handle_command(connection_t *conn);
extern or_options_t options; /* command-line and config-file options */
extern int has_fetched_directory;
+char rend_publish_string[] = "/rendezvous/publish";
+char rend_fetch_url[] = "/rendezvous/";
+
#define MAX_HEADERS_SIZE 2048
#define MAX_BODY_SIZE 500000
@@ -120,13 +123,13 @@ static void directory_send_command(connection_t *conn, int purpose,
memcpy(conn->rend_query, payload, payload_len);
conn->rend_query[payload_len] = 0;
- snprintf(tmp, sizeof(tmp), "GET /hidserv/%s HTTP/1.0\r\n\r\n", payload);
+ snprintf(tmp, sizeof(tmp), "GET %s%s HTTP/1.0\r\n\r\n", rend_fetch_url, payload);
connection_write_to_buf(tmp, strlen(tmp), conn);
break;
case DIR_PURPOSE_UPLOAD_RENDDESC:
assert(payload);
snprintf(tmp, sizeof(tmp),
- "POST /hidserv/ HTTP/1.0\r\nContent-Length: %d\r\n\r\n", payload_len);
+ "POST %s HTTP/1.0\r\nContent-Length: %d\r\n\r\n", rend_publish_string, payload_len);
connection_write_to_buf(tmp, strlen(tmp), conn);
/* could include nuls, need to write it separately */
connection_write_to_buf(payload, payload_len, conn);
@@ -335,7 +338,6 @@ static int directory_handle_command_get(connection_t *conn,
const char *cp;
char *url;
char tmp[8192];
- char rend_fetch_url[] = "/rendezvous/";
log_fn(LOG_DEBUG,"Received GET command.");
@@ -395,7 +397,6 @@ static int directory_handle_command_post(connection_t *conn,
int body_len) {
const char *cp;
char *url;
- char rend_publish_string[] = "/rendezvous/publish";
log_fn(LOG_DEBUG,"Received POST command.");
@@ -405,6 +406,7 @@ static int directory_handle_command_post(connection_t *conn,
connection_write_to_buf(answer400, strlen(answer400), conn);
return 0;
}
+ log_fn(LOG_INFO,"url '%s' posted to us.", url);
if(!strcmp(url,"/")) { /* server descriptor post */
cp = body;
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c
index f57e17727..b318a212a 100644
--- a/src/or/rendcommon.c
+++ b/src/or/rendcommon.c
@@ -244,6 +244,7 @@ int rend_cache_store(char *desc, int desc_len)
e->len = desc_len;
e->desc = tor_strdup(desc);
+ log_fn(LOG_INFO,"Successfully stored rend desc '%s', len %d", query, desc_len);
return 0;
}