aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/transport/plugin_transport_http.c27
1 files 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
524 GNUNET_CONTAINER_DLL_insert(cs->inbound_connections_head,cs->inbound_connections_tail,con); 524 GNUNET_CONTAINER_DLL_insert(cs->inbound_connections_head,cs->inbound_connections_tail,con);
525 } 525 }
526 526
527 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection info for inbound address %s (%s) was found\n", 527 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X for inbound address %s (%s) was found\n",
528 con,
528 GNUNET_i2s(&cs->identity), 529 GNUNET_i2s(&cs->identity),
529 http_plugin_address_to_string(NULL,con->addr,con->addrlen)); 530 http_plugin_address_to_string(NULL,con->addr,con->addrlen));
530 return con; 531 return con;
@@ -555,12 +556,11 @@ static void messageTokenizerCallback (void *cls,
555 GNUNET_assert(con != NULL); 556 GNUNET_assert(con != NULL);
556 557
557 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 558 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
558 "Received message with type %u and size %u from `%s' %s\n", 559 "Forwarding message to transport service, type %u and size %u from `%s' (`%s')\n",
559 ntohs(message->type), 560 ntohs(message->type),
560 ntohs(message->size), 561 ntohs(message->size),
561 GNUNET_i2s(&(con->session->identity)),http_plugin_address_to_string(NULL,con->addr,con->addrlen)); 562 GNUNET_i2s(&(con->session->identity)),http_plugin_address_to_string(NULL,con->addr,con->addrlen));
562 563
563
564 con->session->plugin->env->receive (con->session->plugin->env->cls, 564 con->session->plugin->env->receive (con->session->plugin->env->cls,
565 &con->session->identity, 565 &con->session->identity,
566 message, 1, con->session, 566 message, 1, con->session,
@@ -928,7 +928,7 @@ static size_t send_read_callback(void *stream, size_t size, size_t nmemb, void *
928 928
929 if (con->pending_msgs_tail == NULL) 929 if (con->pending_msgs_tail == NULL)
930 { 930 {
931 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection: %X: No Message to send, pausing connection\n",con); 931 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: No Message to send, pausing connection\n",con);
932 con->send_paused = GNUNET_YES; 932 con->send_paused = GNUNET_YES;
933 return CURL_READFUNC_PAUSE; 933 return CURL_READFUNC_PAUSE;
934 } 934 }
@@ -961,7 +961,7 @@ static size_t send_read_callback(void *stream, size_t size, size_t nmemb, void *
961 961
962 if ( msg->pos == msg->size) 962 if ( msg->pos == msg->size)
963 { 963 {
964 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection: %X: Message with %u bytes sent, removing message from queue \n",con, msg->pos); 964 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: Message with %u bytes sent, removing message from queue \n",con, msg->pos);
965 /* Calling transmit continuation */ 965 /* Calling transmit continuation */
966 if (( NULL != con->pending_msgs_tail) && (NULL != con->pending_msgs_tail->transmit_cont)) 966 if (( NULL != con->pending_msgs_tail) && (NULL != con->pending_msgs_tail->transmit_cont))
967 msg->transmit_cont (con->pending_msgs_tail->transmit_cont_cls,&(con->session)->identity,GNUNET_OK); 967 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
1023 /* already connected, no need to initiate connection */ 1023 /* already connected, no need to initiate connection */
1024 if ((con->connected == GNUNET_YES) && (con->curl_handle != NULL) && (con->send_paused == GNUNET_NO)) 1024 if ((con->connected == GNUNET_YES) && (con->curl_handle != NULL) && (con->send_paused == GNUNET_NO))
1025 { 1025 {
1026 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection: %X: active, enqueueing message\n",con); 1026 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: active, enqueueing message\n",con);
1027 return bytes_sent; 1027 return bytes_sent;
1028 } 1028 }
1029 1029
1030 if ((con->connected == GNUNET_YES) && (con->curl_handle != NULL) && (con->send_paused == GNUNET_YES)) 1030 if ((con->connected == GNUNET_YES) && (con->curl_handle != NULL) && (con->send_paused == GNUNET_YES))
1031 { 1031 {
1032 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection: %X: paused, unpausing existing connection and enqueueing message\n",con); 1032 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: paused, unpausing existing connection and enqueueing message\n",con);
1033 curl_easy_pause(con->curl_handle,CURLPAUSE_CONT); 1033 curl_easy_pause(con->curl_handle,CURLPAUSE_CONT);
1034 con->send_paused=GNUNET_NO; 1034 con->send_paused=GNUNET_NO;
1035 return bytes_sent; 1035 return bytes_sent;
@@ -1041,7 +1041,7 @@ static ssize_t send_initiate (void *cls, struct Session* ses , struct HTTP_Conne
1041 if ( NULL == con->curl_handle) 1041 if ( NULL == con->curl_handle)
1042 con->curl_handle = curl_easy_init(); 1042 con->curl_handle = curl_easy_init();
1043 GNUNET_assert (con->curl_handle != NULL); 1043 GNUNET_assert (con->curl_handle != NULL);
1044 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection: %X: not existing, creating new connection\n",con); 1044 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection %X: not connected, initiating connection\n",con);
1045 1045
1046 GNUNET_assert (NULL != con->pending_msgs_tail); 1046 GNUNET_assert (NULL != con->pending_msgs_tail);
1047 msg = con->pending_msgs_tail; 1047 msg = con->pending_msgs_tail;
@@ -1105,7 +1105,6 @@ static void send_execute (void *cls,
1105 { 1105 {
1106 1106
1107 msg = curl_multi_info_read (plugin->multi_handle, &running); 1107 msg = curl_multi_info_read (plugin->multi_handle, &running);
1108 GNUNET_break (msg != NULL);
1109 if (msg == NULL) 1108 if (msg == NULL)
1110 break; 1109 break;
1111 /* get session for affected curl handle */ 1110 /* get session for affected curl handle */
@@ -1121,12 +1120,14 @@ static void send_execute (void *cls,
1121 if ( (msg->data.result != CURLE_OK) && 1120 if ( (msg->data.result != CURLE_OK) &&
1122 (msg->data.result != CURLE_GOT_NOTHING) ) 1121 (msg->data.result != CURLE_GOT_NOTHING) )
1123 { 1122 {
1123
1124
1124 GNUNET_log(GNUNET_ERROR_TYPE_INFO, 1125 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
1125 _("%s failed for `%s' connection %X at %s:%d: `%s'\n"), 1126 _("Connection %X to peer `%s' (`%s') failed: `%s' `%s'\n"),
1127 con,
1128 GNUNET_i2s(&cs->identity),
1129 http_plugin_address_to_string(NULL, con->addr, con->addrlen),
1126 "curl_multi_perform", 1130 "curl_multi_perform",
1127 GNUNET_i2s(&cs->identity),con,
1128 __FILE__,
1129 __LINE__,
1130 curl_easy_strerror (msg->data.result)); 1131 curl_easy_strerror (msg->data.result));
1131 /* sending msg failed*/ 1132 /* sending msg failed*/
1132 con->connected = GNUNET_NO; 1133 con->connected = GNUNET_NO;