From 6a739314d814c1d5a12d4b632599159207a01887 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Thu, 1 Jul 2010 09:35:01 +0000 Subject: [PATCH] --- src/transport/plugin_transport_http.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index c6fcc1c7d..69c0b88c7 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c @@ -524,7 +524,8 @@ static struct HTTP_Connection_in * session_check_inbound_address (void * cls, st GNUNET_CONTAINER_DLL_insert(cs->inbound_connections_head,cs->inbound_connections_tail,con); } - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection info for inbound address %s (%s) was found\n", + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X for inbound address %s (%s) was found\n", + con, GNUNET_i2s(&cs->identity), http_plugin_address_to_string(NULL,con->addr,con->addrlen)); return con; @@ -555,12 +556,11 @@ static void messageTokenizerCallback (void *cls, GNUNET_assert(con != NULL); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Received message with type %u and size %u from `%s' %s\n", + "Forwarding message to transport service, type %u and size %u from `%s' (`%s')\n", ntohs(message->type), ntohs(message->size), GNUNET_i2s(&(con->session->identity)),http_plugin_address_to_string(NULL,con->addr,con->addrlen)); - con->session->plugin->env->receive (con->session->plugin->env->cls, &con->session->identity, message, 1, con->session, @@ -928,7 +928,7 @@ static size_t send_read_callback(void *stream, size_t size, size_t nmemb, void * if (con->pending_msgs_tail == NULL) { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection: %X: No Message to send, pausing connection\n",con); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: No Message to send, pausing connection\n",con); con->send_paused = GNUNET_YES; return CURL_READFUNC_PAUSE; } @@ -961,7 +961,7 @@ static size_t send_read_callback(void *stream, size_t size, size_t nmemb, void * if ( msg->pos == msg->size) { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection: %X: Message with %u bytes sent, removing message from queue \n",con, msg->pos); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: Message with %u bytes sent, removing message from queue \n",con, msg->pos); /* Calling transmit continuation */ if (( NULL != con->pending_msgs_tail) && (NULL != con->pending_msgs_tail->transmit_cont)) msg->transmit_cont (con->pending_msgs_tail->transmit_cont_cls,&(con->session)->identity,GNUNET_OK); @@ -1023,13 +1023,13 @@ static ssize_t send_initiate (void *cls, struct Session* ses , struct HTTP_Conne /* already connected, no need to initiate connection */ if ((con->connected == GNUNET_YES) && (con->curl_handle != NULL) && (con->send_paused == GNUNET_NO)) { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection: %X: active, enqueueing message\n",con); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: active, enqueueing message\n",con); return bytes_sent; } if ((con->connected == GNUNET_YES) && (con->curl_handle != NULL) && (con->send_paused == GNUNET_YES)) { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection: %X: paused, unpausing existing connection and enqueueing message\n",con); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: paused, unpausing existing connection and enqueueing message\n",con); curl_easy_pause(con->curl_handle,CURLPAUSE_CONT); con->send_paused=GNUNET_NO; return bytes_sent; @@ -1041,7 +1041,7 @@ static ssize_t send_initiate (void *cls, struct Session* ses , struct HTTP_Conne if ( NULL == con->curl_handle) con->curl_handle = curl_easy_init(); GNUNET_assert (con->curl_handle != NULL); - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection: %X: not existing, creating new connection\n",con); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: not connected, initiating connection\n",con); GNUNET_assert (NULL != con->pending_msgs_tail); msg = con->pending_msgs_tail; @@ -1105,7 +1105,6 @@ static void send_execute (void *cls, { msg = curl_multi_info_read (plugin->multi_handle, &running); - GNUNET_break (msg != NULL); if (msg == NULL) break; /* get session for affected curl handle */ @@ -1121,12 +1120,14 @@ static void send_execute (void *cls, if ( (msg->data.result != CURLE_OK) && (msg->data.result != CURLE_GOT_NOTHING) ) { + + GNUNET_log(GNUNET_ERROR_TYPE_INFO, - _("%s failed for `%s' connection %X at %s:%d: `%s'\n"), + _("Connection %X to peer `%s' (`%s') failed: `%s' `%s'\n"), + con, + GNUNET_i2s(&cs->identity), + http_plugin_address_to_string(NULL, con->addr, con->addrlen), "curl_multi_perform", - GNUNET_i2s(&cs->identity),con, - __FILE__, - __LINE__, curl_easy_strerror (msg->data.result)); /* sending msg failed*/ con->connected = GNUNET_NO; -- 2.25.1