aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http_client.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-01 15:02:11 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-01 15:02:11 +0000
commit49609764504fb1c029d9dc082aedd41b1bf27850 (patch)
tree875feed25f4341b1849c03d2cdc2d28e2d0afc6b /src/transport/plugin_transport_http_client.c
parent8863f49f1842bb15df2c3ab574b15292df6290c4 (diff)
downloadgnunet-49609764504fb1c029d9dc082aedd41b1bf27850.tar.gz
gnunet-49609764504fb1c029d9dc082aedd41b1bf27850.zip
-fixing minor bugs, code cleanup
Diffstat (limited to 'src/transport/plugin_transport_http_client.c')
-rw-r--r--src/transport/plugin_transport_http_client.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c
index 179c9580e..c0771eb29 100644
--- a/src/transport/plugin_transport_http_client.c
+++ b/src/transport/plugin_transport_http_client.c
@@ -448,7 +448,6 @@ client_send_cb (void *stream, size_t size, size_t nmemb, void *cls)
448 struct Session *s = cls; 448 struct Session *s = cls;
449 struct Plugin *plugin = s->plugin; 449 struct Plugin *plugin = s->plugin;
450 struct HTTP_Message *msg = s->msg_head; 450 struct HTTP_Message *msg = s->msg_head;
451 size_t bytes_sent = 0;
452 size_t len; 451 size_t len;
453 452
454 if (GNUNET_YES != exist_session(plugin, s)) 453 if (GNUNET_YES != exist_session(plugin, s))
@@ -467,11 +466,10 @@ client_send_cb (void *stream, size_t size, size_t nmemb, void *cls)
467 /* data to send */ 466 /* data to send */
468 GNUNET_assert (msg->pos < msg->size); 467 GNUNET_assert (msg->pos < msg->size);
469 /* calculate how much fits in buffer */ 468 /* calculate how much fits in buffer */
470 bytes_sent = GNUNET_MIN (msg->size - msg->pos, 469 len = GNUNET_MIN (msg->size - msg->pos,
471 size * nmemb); 470 size * nmemb);
472 memcpy (stream, &msg->buf[msg->pos], len); 471 memcpy (stream, &msg->buf[msg->pos], len);
473 msg->pos += len; 472 msg->pos += len;
474 bytes_sent = len;
475 if (msg->pos == msg->size) 473 if (msg->pos == msg->size)
476 { 474 {
477 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name, 475 GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
@@ -483,7 +481,7 @@ client_send_cb (void *stream, size_t size, size_t nmemb, void *cls)
483 msg->transmit_cont (msg->transmit_cont_cls, &s->target, GNUNET_OK); 481 msg->transmit_cont (msg->transmit_cont_cls, &s->target, GNUNET_OK);
484 GNUNET_free (msg); 482 GNUNET_free (msg);
485 } 483 }
486 return bytes_sent; 484 return len;
487} 485}
488 486
489 487