projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8f64993
)
seperate timeouts for MESH retries
author
Sree Harsha Totakura
<totakura@in.tum.de>
Mon, 26 Nov 2012 13:00:28 +0000
(13:00 +0000)
committer
Sree Harsha Totakura
<totakura@in.tum.de>
Mon, 26 Nov 2012 13:00:28 +0000
(13:00 +0000)
src/stream/stream_api.c
patch
|
blob
|
history
diff --git
a/src/stream/stream_api.c
b/src/stream/stream_api.c
index 66c24dc869c84714f4c5e4f4a51323ff17095cf8..562f2279ccaab49e48f3ed37da70e0bd863cc763 100644
(file)
--- a/
src/stream/stream_api.c
+++ b/
src/stream/stream_api.c
@@
-36,7
+36,7
@@
#include "platform.h"
#include "gnunet_common.h"
#include "platform.h"
#include "gnunet_common.h"
-#include "gnunet_
crypto
_lib.h"
+#include "gnunet_
util
_lib.h"
#include "gnunet_lockmanager_service.h"
#include "gnunet_statistics_service.h"
#include "gnunet_stream_lib.h"
#include "gnunet_lockmanager_service.h"
#include "gnunet_statistics_service.h"
#include "gnunet_stream_lib.h"
@@
-280,6
+280,11
@@
struct GNUNET_STREAM_Socket
*/
struct GNUNET_TIME_Relative ack_time_deadline;
*/
struct GNUNET_TIME_Relative ack_time_deadline;
+ /**
+ * Mesh transmit timeout
+ */
+ struct GNUNET_TIME_Relative mesh_retry_timeout;
+
/**
* The state of the protocol associated with this socket
*/
/**
* The state of the protocol associated with this socket
*/
@@
-576,7
+581,6
@@
static const unsigned int default_timeout = 10;
*/
static const char *locking_domain = "GNUNET_STREAM_APPLOCK";
*/
static const char *locking_domain = "GNUNET_STREAM_APPLOCK";
-
/**
* Callback function for sending queued message
*
/**
* Callback function for sending queued message
*
@@
-598,20
+602,21
@@
send_message_notify (void *cls, size_t size, void *buf)
return 0; /* just to be safe */
if (0 == size) /* request timed out */
{
return 0; /* just to be safe */
if (0 == size) /* request timed out */
{
- socket->retries++;
+ socket->mesh_retry_timeout = GNUNET_TIME_STD_BACKOFF
+ (socket->mesh_retry_timeout);
LOG (GNUNET_ERROR_TYPE_DEBUG,
LOG (GNUNET_ERROR_TYPE_DEBUG,
- "%s: Message sending t
imed out. Retry %d
\n",
+ "%s: Message sending t
o MESH timed out. Retrying in %s
\n",
GNUNET_i2s (&socket->other_peer),
GNUNET_i2s (&socket->other_peer),
- socket->retries);
+ GNUNET_STRINGS_relative_time_to_string (socket->mesh_retry_timeout,
+ GNUNET_YES));
socket->transmit_handle =
socket->transmit_handle =
- GNUNET_MESH_notify_transmit_ready (socket->tunnel,
- GNUNET_NO, /* Corking */
- /* FIXME: exponential backoff */
- socket->retransmit_timeout,
- &socket->other_peer,
- ntohs (head->message->header.size),
- &send_message_notify,
- socket);
+ GNUNET_MESH_notify_transmit_ready (socket->tunnel,
+ GNUNET_NO, /* Corking */
+ socket->mesh_retry_timeout,
+ &socket->other_peer,
+ ntohs (head->message->header.size),
+ &send_message_notify,
+ socket);
return 0;
}
ret = ntohs (head->message->header.size);
return 0;
}
ret = ntohs (head->message->header.size);
@@
-631,16
+636,15
@@
send_message_notify (void *cls, size_t size, void *buf)
head = socket->queue_head;
if (NULL != head) /* more pending messages to send */
{
head = socket->queue_head;
if (NULL != head) /* more pending messages to send */
{
- socket->
retries = 0
;
+ socket->
mesh_retry_timeout = GNUNET_TIME_relative_get_zero_ ()
;
socket->transmit_handle =
socket->transmit_handle =
- GNUNET_MESH_notify_transmit_ready (socket->tunnel,
- GNUNET_NO, /* Corking */
- /* FIXME: exponential backoff */
- socket->retransmit_timeout,
- &socket->other_peer,
- ntohs (head->message->header.size),
- &send_message_notify,
- socket);
+ GNUNET_MESH_notify_transmit_ready (socket->tunnel,
+ GNUNET_NO, /* Corking */
+ socket->mesh_retry_timeout,
+ &socket->other_peer,
+ ntohs (head->message->header.size),
+ &send_message_notify,
+ socket);
}
return ret;
}
}
return ret;
}
@@
-694,11
+698,11
@@
queue_message (struct GNUNET_STREAM_Socket *socket,
queue_entity);
if (NULL == socket->transmit_handle)
{
queue_entity);
if (NULL == socket->transmit_handle)
{
- socket->
retries = 0
;
+ socket->
mesh_retry_timeout = GNUNET_TIME_relative_get_zero_ ()
;
socket->transmit_handle =
GNUNET_MESH_notify_transmit_ready (socket->tunnel,
GNUNET_NO, /* Corking */
socket->transmit_handle =
GNUNET_MESH_notify_transmit_ready (socket->tunnel,
GNUNET_NO, /* Corking */
-
socket->retransmit
_timeout,
+
socket->mesh_retry
_timeout,
&socket->other_peer,
ntohs (message->header.size),
&send_message_notify,
&socket->other_peer,
ntohs (message->header.size),
&send_message_notify,