[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r11913 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r11913 - gnunet/src/transport |
Date: |
Wed, 23 Jun 2010 17:36:02 +0200 |
Author: wachs
Date: 2010-06-23 17:36:02 +0200 (Wed, 23 Jun 2010)
New Revision: 11913
Modified:
gnunet/src/transport/plugin_transport_http.c
gnunet/src/transport/test_plugin_transport_http.c
Log:
Modified: gnunet/src/transport/plugin_transport_http.c
===================================================================
--- gnunet/src/transport/plugin_transport_http.c 2010-06-23 15:23:56 UTC
(rev 11912)
+++ gnunet/src/transport/plugin_transport_http.c 2010-06-23 15:36:02 UTC
(rev 11913)
@@ -201,11 +201,6 @@
int is_client;
/**
- * Is the connection active (GNUNET_YES) or terminated (GNUNET_NO)?
- */
- int is_active;
-
- /**
* At what time did we reset last_received last?
*/
struct GNUNET_TIME_Absolute last_quota_update;
@@ -347,7 +342,6 @@
ses->plugin = plugin;
memcpy(&ses->partner, peer, sizeof (struct GNUNET_PeerIdentity));
GNUNET_CRYPTO_hash_to_enc(&ses->partner.hashPubKey,&(ses->hash));
- ses->is_active = GNUNET_NO;
ses->pending_inbound_msg.bytes_recv = 0;
ses->msgtok = NULL;
return ses;
@@ -363,10 +357,10 @@
cs = *httpSessionCache;
if (cs == NULL)
return;
- /*GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection from peer `%s' was
terminated\n",GNUNET_i2s(&cs->partner));*/
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Connection from peer `%s' was
terminated\n",GNUNET_i2s(&cs->partner));
/* session set to inactive */
- cs->is_active = GNUNET_NO;
cs->is_put_in_progress = GNUNET_NO;
+ cs->is_bad_request = GNUNET_NO;
}
@@ -515,7 +509,7 @@
cs = *httpSessionCache;
}
/* Is it a PUT or a GET request */
- if ( 0 == strcmp (MHD_HTTP_METHOD_PUT, method) )
+ if (0 == strcmp (MHD_HTTP_METHOD_PUT, method))
{
/* New */
if ((*upload_data_size == 0) && (cs->is_put_in_progress == GNUNET_NO))
@@ -530,7 +524,6 @@
/* not yet ready */
cs->is_put_in_progress = GNUNET_YES;
cs->is_bad_request = GNUNET_NO;
- cs->is_active = GNUNET_YES;
return MHD_YES;
}
@@ -576,12 +569,8 @@
{
send_error_to_client = GNUNET_YES;
if (cs->pending_inbound_msg.bytes_recv >= sizeof (struct
GNUNET_MessageHeader))
- {
- //res = GNUNET_SERVER_mst_receive(cs->msgtok, cs,
cs->pending_inbound_msg->buf,cs->pending_inbound_msg.bytes_recv, GNUNET_YES,
GNUNET_NO);
- res = GNUNET_OK;
- if ((res != GNUNET_SYSERR) && (res != GNUNET_NO))
send_error_to_client = GNUNET_NO;
- }
+
if (send_error_to_client == GNUNET_NO)
{
response = MHD_create_response_from_data (strlen
(HTTP_PUT_RESPONSE),HTTP_PUT_RESPONSE, MHD_NO, MHD_NO);
@@ -647,6 +636,7 @@
struct GNUNET_TIME_Relative tv;
GNUNET_assert(cls !=NULL);
+ ret = GNUNET_SCHEDULER_NO_TASK;
FD_ZERO(&rs);
FD_ZERO(&ws);
FD_ZERO(&es);
@@ -1120,10 +1110,13 @@
address = NULL;
cs = GNUNET_CONTAINER_multihashmap_get (plugin->sessions,
&target->hashPubKey);
+ if (cs != NULL)
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Session `%s' found\n", GNUNET_i2s(target));
+
if ( cs == NULL)
{
cs = create_session(plugin, (char *) addr, addrlen, NULL, 0, target);
- cs->is_active = GNUNET_YES;
res = GNUNET_CONTAINER_multihashmap_put ( plugin->sessions,
&cs->partner.hashPubKey,
cs,
@@ -1132,9 +1125,6 @@
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"New Session `%s' inserted\n", GNUNET_i2s(target));
}
- if (cs != NULL)
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Session `%s' found\n", GNUNET_i2s(target));
GNUNET_assert ((addr!=NULL) && (addrlen != 0));
if (addrlen == (sizeof (struct IPv4HttpAddress)))
Modified: gnunet/src/transport/test_plugin_transport_http.c
===================================================================
--- gnunet/src/transport/test_plugin_transport_http.c 2010-06-23 15:23:56 UTC
(rev 11912)
+++ gnunet/src/transport/test_plugin_transport_http.c 2010-06-23 15:36:02 UTC
(rev 11913)
@@ -983,17 +983,12 @@
port = ntohs(((struct IPv4HttpAddress *) tmp_addr->addr)->u_port);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Sending message to addres no. %u:
`%s':%u\n", count,address, port);
}
- else if (tmp_addr->addrlen == (sizeof (struct IPv6HttpAddress)))
+ if (tmp_addr->addrlen == (sizeof (struct IPv6HttpAddress)))
{
inet_ntop(AF_INET6, (struct in6_addr *)
tmp_addr->addr,address,INET6_ADDRSTRLEN);
port = ntohs(((struct IPv6HttpAddress *) tmp_addr->addr)->u6_port);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Sending message to addres no. %u:
`%s':%u\n", count,address,port);
}
- else
- {
- GNUNET_break (0);
- return;
- }
msg.type=htons(type);
memcpy(tmp,&msg,sizeof(struct GNUNET_MessageHeader));
api->send(api->cls, &my_identity, tmp, sizeof(struct
GNUNET_MessageHeader), 0, TIMEOUT, NULL,tmp_addr->addr, tmp_addr->addrlen,
GNUNET_YES, &task_send_cont, &fail_msgs_transmited_to_local_addrs);
@@ -1021,7 +1016,7 @@
msg1->size = htons(2 * sizeof(struct GNUNET_MessageHeader));
msg1->type = htons(40);
msg2 = &msg1[2];
- msg2->size = htons(3 * sizeof(struct GNUNET_MessageHeader));
+ msg2->size = htons(2 * sizeof(struct GNUNET_MessageHeader));
msg2->type = htons(41);
api->send(api->cls, &my_identity, tmp, 4 * sizeof(struct
GNUNET_MessageHeader), 0, TIMEOUT, NULL,addr_head->addr, addr_head->addrlen,
GNUNET_YES, &task_send_cont, NULL);
@@ -1040,13 +1035,14 @@
/* send a message with size GNUNET_SERVER_MAX_MESSAGE_SIZE )*/
+ /*
GNUNET_free(tmp);
tmp = GNUNET_malloc(GNUNET_SERVER_MAX_MESSAGE_SIZE);
uint16_t t2 = (uint16_t)GNUNET_SERVER_MAX_MESSAGE_SIZE;
msg.size = htons(t2);
memcpy(tmp,&msg,sizeof(struct GNUNET_MessageHeader));
api->send(api->cls, &my_identity, tmp, GNUNET_SERVER_MAX_MESSAGE_SIZE, 0,
TIMEOUT, NULL,addr_head->addr, addr_head->addrlen, GNUNET_YES, &task_send_cont,
&fail_msg_transmited_bigger_max_size);
-
+*/
/* send a message with size GNUNET_SERVER_MAX_MESSAGE_SIZE-1 */
GNUNET_free(tmp);
tmp = GNUNET_malloc(GNUNET_SERVER_MAX_MESSAGE_SIZE-1);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r11913 - gnunet/src/transport,
gnunet <=