From: Matthias Wachs Date: Fri, 2 Jul 2010 15:28:20 +0000 (+0000) Subject: (no commit message) X-Git-Tag: initial-import-from-subversion-38251~21050 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2cb2eb3273b07eaa5b2af361561d2af682de6ee6;p=oweals%2Fgnunet.git --- diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index 5a9bde0bc..da59f848b 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c @@ -28,7 +28,6 @@ #include "gnunet_constants.h" #include "gnunet_protocols.h" #include "gnunet_connection_lib.h" -#include "gnunet_server_lib.h" #include "gnunet_service_lib.h" #include "gnunet_statistics_service.h" #include "gnunet_transport_service.h" @@ -237,17 +236,6 @@ struct Session */ struct GNUNET_PeerIdentity identity; - /** - * Sender's ip address to distinguish between incoming connections - */ - void * addr_in; - - size_t addr_in_len; - - void * addr_out; - - size_t addr_out_len; - /** * Did we initiate the connection (GNUNET_YES) or the other peer (GNUNET_NO)? */ @@ -275,16 +263,6 @@ struct Session */ struct GNUNET_CRYPTO_HashAsciiEncoded hash; - /** - * curl handle for outbound transmissions - */ - CURL *curl_handle; - - /** - * Message tokenizer for incoming data - */ - //struct GNUNET_SERVER_MessageStreamTokenizer * msgtok; - struct HTTP_Connection *outbound_connections_head; struct HTTP_Connection *outbound_connections_tail; @@ -385,19 +363,6 @@ create_session (void * cls, struct Session * cs = GNUNET_malloc ( sizeof( struct Session) ); GNUNET_assert(cls !=NULL); - if (addrlen_in != 0) - { - cs->addr_in = GNUNET_malloc (addrlen_in); - cs->addr_in_len = addrlen_in; - memcpy(cs->addr_in,addr_in,addrlen_in); - } - - if (addrlen_out != 0) - { - cs->addr_out = GNUNET_malloc (addrlen_out); - cs->addr_out_len = addrlen_out; - memcpy(cs->addr_out,addr_out,addrlen_out); - } cs->plugin = plugin; memcpy(&cs->identity, peer, sizeof (struct GNUNET_PeerIdentity)); GNUNET_CRYPTO_hash_to_enc(&cs->identity.hashPubKey,&(cs->hash)); @@ -615,13 +580,15 @@ int server_read_callback (void *cls, uint64_t pos, char *buf, int max) struct HTTP_Connection * con = cls; struct HTTP_Message * msg; - int res; + int res;res=5; + + msg=con->pending_msgs_tail; + - if (con->pending_msgs_tail!=NULL) + if (msg!=NULL) { - msg=con->pending_msgs_tail; - /* - if ((msg->size-msg->pos) <= max) + /* + if ((msg->size-msg->pos) <= max) { memcpy(buf,&msg->buf[pos],(msg->size-msg->pos)); pos+=(msg->size-msg->pos); @@ -630,14 +597,17 @@ int server_read_callback (void *cls, uint64_t pos, char *buf, int max) { memcpy(buf,&msg->buf[pos],max); pos+=max; - }*/ + } + if (msg->pos==msg->size) { if (NULL != con->pending_msgs_tail->transmit_cont) msg->transmit_cont (msg->transmit_cont_cls,&con->session->identity,GNUNET_SYSERR); res = remove_http_message(con,msg); } + */ } + return bytes_read; } @@ -723,7 +693,7 @@ accessHandlerCallback (void *cls, *httpSessionCache = con; if (con->msgtok==NULL) - con->msgtok = GNUNET_SERVER_mst_create (GNUNET_SERVER_MAX_MESSAGE_SIZE - 1, &messageTokenizerCallback, con); + con->msgtok = GNUNET_SERVER_mst_create (&messageTokenizerCallback, con); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"HTTP Daemon has new an incoming `%s' request from peer `%s' (`%s')\n", method,