aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/transport/plugin_transport_http.c10
-rw-r--r--src/transport/plugin_transport_https.c12
2 files changed, 13 insertions, 9 deletions
diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c
index b1e03abb3..702f1e0a1 100644
--- a/src/transport/plugin_transport_http.c
+++ b/src/transport/plugin_transport_http.c
@@ -485,8 +485,8 @@ static int remove_session (struct HTTP_PeerContext * pc, struct Session * ps, i
485 { 485 {
486 msg->transmit_cont (msg->transmit_cont_cls,&pc->identity,call_msg_cont_result); 486 msg->transmit_cont (msg->transmit_cont_cls,&pc->identity,call_msg_cont_result);
487 } 487 }
488 GNUNET_free(msg);
489 GNUNET_CONTAINER_DLL_remove(ps->pending_msgs_head,ps->pending_msgs_head,msg); 488 GNUNET_CONTAINER_DLL_remove(ps->pending_msgs_head,ps->pending_msgs_head,msg);
489 GNUNET_free(msg);
490 msg = ps->pending_msgs_head; 490 msg = ps->pending_msgs_head;
491 } 491 }
492 492
@@ -1133,9 +1133,9 @@ static size_t curl_get_header_cb( void *ptr, size_t size, size_t nmemb, void *st
1133 long http_result = 0; 1133 long http_result = 0;
1134 int res; 1134 int res;
1135 /* Getting last http result code */ 1135 /* Getting last http result code */
1136 GNUNET_assert(NULL!=ps);
1136 if (ps->recv_connected==GNUNET_NO) 1137 if (ps->recv_connected==GNUNET_NO)
1137 { 1138 {
1138 GNUNET_assert(NULL!=ps);
1139 res = curl_easy_getinfo(ps->recv_endpoint, CURLINFO_RESPONSE_CODE, &http_result); 1139 res = curl_easy_getinfo(ps->recv_endpoint, CURLINFO_RESPONSE_CODE, &http_result);
1140 if (CURLE_OK == res) 1140 if (CURLE_OK == res)
1141 { 1141 {
@@ -1256,7 +1256,8 @@ static size_t curl_send_cb(void *stream, size_t size, size_t nmemb, void *ptr)
1256 return CURL_READFUNC_PAUSE; 1256 return CURL_READFUNC_PAUSE;
1257 } 1257 }
1258 1258
1259 msg = ps->pending_msgs_tail; 1259 GNUNET_assert (msg!=NULL);
1260
1260 /* data to send */ 1261 /* data to send */
1261 if (msg->pos < msg->size) 1262 if (msg->pos < msg->size)
1262 { 1263 {
@@ -1300,8 +1301,9 @@ static void curl_receive_mst_cb (void *cls,
1300 const struct GNUNET_MessageHeader *message) 1301 const struct GNUNET_MessageHeader *message)
1301{ 1302{
1302 struct Session *ps = cls; 1303 struct Session *ps = cls;
1303 struct HTTP_PeerContext *pc = ps->peercontext;
1304 GNUNET_assert(ps != NULL); 1304 GNUNET_assert(ps != NULL);
1305
1306 struct HTTP_PeerContext *pc = ps->peercontext;
1305 GNUNET_assert(pc != NULL); 1307 GNUNET_assert(pc != NULL);
1306#if DEBUG_HTTP 1308#if DEBUG_HTTP
1307 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1309 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/transport/plugin_transport_https.c b/src/transport/plugin_transport_https.c
index 644b431f3..6d0753e4d 100644
--- a/src/transport/plugin_transport_https.c
+++ b/src/transport/plugin_transport_https.c
@@ -494,8 +494,8 @@ static int remove_session (struct HTTP_PeerContext * pc, struct Session * ps, i
494 { 494 {
495 msg->transmit_cont (msg->transmit_cont_cls,&pc->identity,call_msg_cont_result); 495 msg->transmit_cont (msg->transmit_cont_cls,&pc->identity,call_msg_cont_result);
496 } 496 }
497 GNUNET_free(msg);
498 GNUNET_CONTAINER_DLL_remove(ps->pending_msgs_head,ps->pending_msgs_head,msg); 497 GNUNET_CONTAINER_DLL_remove(ps->pending_msgs_head,ps->pending_msgs_head,msg);
498 GNUNET_free(msg);
499 msg = ps->pending_msgs_head; 499 msg = ps->pending_msgs_head;
500 } 500 }
501 501
@@ -1142,9 +1142,9 @@ static size_t curl_get_header_cb( void *ptr, size_t size, size_t nmemb, void *st
1142 long http_result = 0; 1142 long http_result = 0;
1143 int res; 1143 int res;
1144 /* Getting last http result code */ 1144 /* Getting last http result code */
1145 GNUNET_assert(NULL!=ps);
1145 if (ps->recv_connected==GNUNET_NO) 1146 if (ps->recv_connected==GNUNET_NO)
1146 { 1147 {
1147 GNUNET_assert(NULL!=ps);
1148 res = curl_easy_getinfo(ps->recv_endpoint, CURLINFO_RESPONSE_CODE, &http_result); 1148 res = curl_easy_getinfo(ps->recv_endpoint, CURLINFO_RESPONSE_CODE, &http_result);
1149 if (CURLE_OK == res) 1149 if (CURLE_OK == res)
1150 { 1150 {
@@ -1258,7 +1258,6 @@ static size_t curl_send_cb(void *stream, size_t size, size_t nmemb, void *ptr)
1258 if (ps->send_active == GNUNET_NO) 1258 if (ps->send_active == GNUNET_NO)
1259 return CURL_READFUNC_PAUSE; 1259 return CURL_READFUNC_PAUSE;
1260 1260
1261
1262 if ((ps->pending_msgs_tail == NULL) && (ps->send_active == GNUNET_YES)) 1261 if ((ps->pending_msgs_tail == NULL) && (ps->send_active == GNUNET_YES))
1263 { 1262 {
1264#if DEBUG_CONNECTIONS 1263#if DEBUG_CONNECTIONS
@@ -1268,7 +1267,8 @@ static size_t curl_send_cb(void *stream, size_t size, size_t nmemb, void *ptr)
1268 return CURL_READFUNC_PAUSE; 1267 return CURL_READFUNC_PAUSE;
1269 } 1268 }
1270 1269
1271 msg = ps->pending_msgs_tail; 1270 GNUNET_assert (msg!=NULL);
1271
1272 /* data to send */ 1272 /* data to send */
1273 if (msg->pos < msg->size) 1273 if (msg->pos < msg->size)
1274 { 1274 {
@@ -1312,9 +1312,11 @@ static void curl_receive_mst_cb (void *cls,
1312 const struct GNUNET_MessageHeader *message) 1312 const struct GNUNET_MessageHeader *message)
1313{ 1313{
1314 struct Session *ps = cls; 1314 struct Session *ps = cls;
1315 struct HTTP_PeerContext *pc = ps->peercontext;
1316 GNUNET_assert(ps != NULL); 1315 GNUNET_assert(ps != NULL);
1316
1317 struct HTTP_PeerContext *pc = ps->peercontext;
1317 GNUNET_assert(pc != NULL); 1318 GNUNET_assert(pc != NULL);
1319
1318#if DEBUG_HTTPS 1320#if DEBUG_HTTPS
1319 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1321 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1320 "Connection %X: Forwarding message to transport service, type %u and size %u from `%s' (`%s')\n", 1322 "Connection %X: Forwarding message to transport service, type %u and size %u from `%s' (`%s')\n",