[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] publish and fetch the right rendezvous urls



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	directory.c rendcommon.c 
Log Message:
publish and fetch the right rendezvous urls


Index: directory.c
===================================================================
RCS file: /home/or/cvsroot/src/or/directory.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- directory.c	3 Apr 2004 01:59:53 -0000	1.82
+++ directory.c	3 Apr 2004 03:33:57 -0000	1.83
@@ -13,6 +13,9 @@
 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 @@
       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 @@
   const char *cp;
   char *url;
   char tmp[8192];
-  char rend_fetch_url[] = "/rendezvous/";
 
   log_fn(LOG_DEBUG,"Received GET command.");
 
@@ -395,7 +397,6 @@
                                          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 @@
     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;

Index: rendcommon.c
===================================================================
RCS file: /home/or/cvsroot/src/or/rendcommon.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- rendcommon.c	3 Apr 2004 02:40:30 -0000	1.12
+++ rendcommon.c	3 Apr 2004 03:33:57 -0000	1.13
@@ -244,6 +244,7 @@
   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;
 }