diff options
author | Roger Dingledine <arma@torproject.org> | 2007-08-11 14:13:25 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-08-11 14:13:25 +0000 |
commit | 330abbb6c61a7a2eb39b5b921ff1c3a1a80beca0 (patch) | |
tree | 34e9c5db5eddc71d14db45d75b5622ce2e73e8e6 | |
parent | 59204840832482a128039f5fb6d18faccfb11207 (diff) | |
download | tor-330abbb6c61a7a2eb39b5b921ff1c3a1a80beca0.tar.gz tor-330abbb6c61a7a2eb39b5b921ff1c3a1a80beca0.zip |
logging patch from karsten, slightly modified to compile
svn:r11074
-rw-r--r-- | src/or/connection_edge.c | 2 | ||||
-rw-r--r-- | src/or/directory.c | 4 | ||||
-rw-r--r-- | src/or/rendclient.c | 4 | ||||
-rw-r--r-- | src/or/rendmid.c | 6 | ||||
-rw-r--r-- | src/or/rendservice.c | 11 |
5 files changed, 26 insertions, 1 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 8e90d55b4a..9a02357c39 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -2297,7 +2297,7 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ) if (circ->purpose == CIRCUIT_PURPOSE_S_REND_JOINED) { origin_circuit_t *origin_circ = TO_ORIGIN_CIRCUIT(circ); - log_debug(LD_REND,"begin is for rendezvous. configuring stream."); + log_info(LD_REND,"begin is for rendezvous. configuring stream."); n_stream->_base.address = tor_strdup("(rendezvous)"); n_stream->_base.state = EXIT_CONN_STATE_CONNECTING; strlcpy(n_stream->rend_query, origin_circ->rend_query, diff --git a/src/or/directory.c b/src/or/directory.c index 0174e62404..d5ac919e32 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -1471,6 +1471,8 @@ connection_dir_client_reached_eof(dir_connection_t *conn) } if (conn->_base.purpose == DIR_PURPOSE_UPLOAD_RENDDESC) { + log_info(LD_REND,"Uploaded rendezvous descriptor (status %d (%s))", + status_code, escaped(reason)); switch (status_code) { case 200: log_info(LD_REND, @@ -2002,6 +2004,7 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers, int versioned = !strcmpstart(url,"/tor/rendezvous1/"); const char *query = url+strlen("/tor/rendezvous/")+(versioned?1:0); + log_info(LD_REND, "Handling rendezvous descriptor get"); switch (rend_cache_lookup_desc(query, versioned?-1:0, &descp, &desc_len)) { case 1: /* valid */ write_http_response_header(conn, desc_len, "application/octet-stream", @@ -2142,6 +2145,7 @@ directory_handle_command_post(dir_connection_t *conn, const char *headers, if (options->HSAuthoritativeDir && !strcmpstart(url,"/tor/rendezvous/publish")) { /* rendezvous descriptor post */ + log_info(LD_REND, "Handling rendezvous descriptor post."); if (rend_cache_store(body, body_len, 1) < 0) { // char tmp[1024*2+1]; log_fn(LOG_PROTOCOL_WARN, LD_DIRSERV, diff --git a/src/or/rendclient.c b/src/or/rendclient.c index fef95d1c89..adc343fa21 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -144,6 +144,7 @@ rend_client_send_introduction(origin_circuit_t *introcirc, payload_len = DIGEST_LEN + r; tor_assert(payload_len <= RELAY_PAYLOAD_SIZE); /* we overran something */ + log_info(LD_REND, "Sending an INTRODUCE1 cell"); if (relay_send_command_from_edge(0, TO_CIRCUIT(introcirc), RELAY_COMMAND_INTRODUCE1, payload, payload_len, @@ -256,6 +257,7 @@ rend_client_refetch_renddesc(const char *query) { if (!get_options()->FetchHidServDescriptors) return; + log_info(LD_REND, "Fetching rendezvous descriptor for service %s", query); if (connection_get_by_type_state_rendquery(CONN_TYPE_DIR, 0, query)) { log_info(LD_REND,"Would fetch a new renddesc here (for %s), but one is " "already in progress.", escaped_safe_str(query)); @@ -383,6 +385,8 @@ rend_client_receive_rendezvous(origin_circuit_t *circ, const char *request, goto err; } + log_info(LD_REND,"Got RENDEZVOUS2 cell from hidden service."); + /* first DH_KEY_LEN bytes are g^y from bob. Finish the dh handshake...*/ tor_assert(circ->build_state); tor_assert(circ->build_state->pending_final_cpath); diff --git a/src/or/rendmid.c b/src/or/rendmid.c index d69214733e..c0fbf09c3d 100644 --- a/src/or/rendmid.c +++ b/src/or/rendmid.c @@ -132,6 +132,9 @@ rend_mid_introduce(or_circuit_t *circ, const char *request, size_t request_len) char serviceid[REND_SERVICE_ID_LEN+1]; char nak_body[1]; + log_info(LD_REND, "Received an INTRODUCE1 request on circuit %d", + circ->p_circ_id); + if (circ->_base.purpose != CIRCUIT_PURPOSE_OR || circ->_base.n_conn) { log_warn(LD_PROTOCOL, "Rejecting INTRODUCE1 on non-OR or non-edge circuit %d.", @@ -210,6 +213,9 @@ rend_mid_establish_rendezvous(or_circuit_t *circ, const char *request, char hexid[9]; int reason = END_CIRC_REASON_TORPROTOCOL; + log_info(LD_REND, "Received an ESTABLISH_RENDEZVOUS request on circuit %d", + circ->p_circ_id); + if (circ->_base.purpose != CIRCUIT_PURPOSE_OR || circ->_base.n_conn) { log_warn(LD_PROTOCOL, "Tried to establish rendezvous on non-OR or non-edge circuit."); diff --git a/src/or/rendservice.c b/src/or/rendservice.c index 8ec3888098..f689508d56 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -791,6 +791,7 @@ rend_service_intro_established(origin_circuit_t *circuit, const char *request, size_t request_len) { rend_service_t *service; + char serviceid[REND_SERVICE_ID_LEN+1]; (void) request; (void) request_len; @@ -808,6 +809,12 @@ rend_service_intro_established(origin_circuit_t *circuit, const char *request, service->desc_is_dirty = time(NULL); circuit->_base.purpose = CIRCUIT_PURPOSE_S_INTRO; + base32_encode(serviceid, REND_SERVICE_ID_LEN + 1, + circuit->rend_pk_digest, 10); + log_info(LD_REND, + "Received INTRO_ESTABLISHED cell on circuit %d for service %s", + circuit->_base.n_circ_id, serviceid); + return 0; err: circuit_mark_for_close(TO_CIRCUIT(circuit), END_CIRC_REASON_TORPROTOCOL); @@ -934,6 +941,7 @@ upload_service_descriptor(rend_service_t *service, int version) { char *desc; size_t desc_len; + char serviceid[REND_SERVICE_ID_LEN+1]; /* Update the descriptor. */ rend_service_update_descriptor(service); @@ -947,6 +955,9 @@ upload_service_descriptor(rend_service_t *service, int version) } /* Post it to the dirservers */ + rend_get_service_id(service->private_key, serviceid); + log_info(LD_REND, "Sending publish request for hidden service %s", + serviceid); directory_post_to_dirservers(DIR_PURPOSE_UPLOAD_RENDDESC, ROUTER_PURPOSE_GENERAL, HIDSERV_AUTHORITY, desc, desc_len, 0); |