[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r11074: logging patch from karsten, slightly modified to compile (tor/trunk/src/or)
Author: arma
Date: 2007-08-11 10:13:25 -0400 (Sat, 11 Aug 2007)
New Revision: 11074
Modified:
tor/trunk/src/or/connection_edge.c
tor/trunk/src/or/directory.c
tor/trunk/src/or/rendclient.c
tor/trunk/src/or/rendmid.c
tor/trunk/src/or/rendservice.c
Log:
logging patch from karsten, slightly modified to compile
Modified: tor/trunk/src/or/connection_edge.c
===================================================================
--- tor/trunk/src/or/connection_edge.c 2007-08-11 14:11:04 UTC (rev 11073)
+++ tor/trunk/src/or/connection_edge.c 2007-08-11 14:13:25 UTC (rev 11074)
@@ -2297,7 +2297,7 @@
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,
Modified: tor/trunk/src/or/directory.c
===================================================================
--- tor/trunk/src/or/directory.c 2007-08-11 14:11:04 UTC (rev 11073)
+++ tor/trunk/src/or/directory.c 2007-08-11 14:13:25 UTC (rev 11074)
@@ -1471,6 +1471,8 @@
}
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 @@
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 @@
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,
Modified: tor/trunk/src/or/rendclient.c
===================================================================
--- tor/trunk/src/or/rendclient.c 2007-08-11 14:11:04 UTC (rev 11073)
+++ tor/trunk/src/or/rendclient.c 2007-08-11 14:13:25 UTC (rev 11074)
@@ -144,6 +144,7 @@
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 @@
{
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 @@
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);
Modified: tor/trunk/src/or/rendmid.c
===================================================================
--- tor/trunk/src/or/rendmid.c 2007-08-11 14:11:04 UTC (rev 11073)
+++ tor/trunk/src/or/rendmid.c 2007-08-11 14:13:25 UTC (rev 11074)
@@ -132,6 +132,9 @@
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 @@
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.");
Modified: tor/trunk/src/or/rendservice.c
===================================================================
--- tor/trunk/src/or/rendservice.c 2007-08-11 14:11:04 UTC (rev 11073)
+++ tor/trunk/src/or/rendservice.c 2007-08-11 14:13:25 UTC (rev 11074)
@@ -791,6 +791,7 @@
size_t request_len)
{
rend_service_t *service;
+ char serviceid[REND_SERVICE_ID_LEN+1];
(void) request;
(void) request_len;
@@ -808,6 +809,12 @@
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 @@
{
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 @@
}
/* 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);