if (GNUNET_SYSERR == sent)
{
- if ((errno == EAGAIN) || (errno == ENOBUFS))
+ if (errno == EAGAIN)
+ {
+ return RETRY; /* We have to retry later */
+ }
+ if (errno == ENOBUFS)
+ {
return RETRY; /* We have to retry later */
+ }
if (errno == EMSGSIZE)
{
socklen_t size = 0;
}
}
}
+
LOG (GNUNET_ERROR_TYPE_DEBUG,
"UNIX transmit %u-byte message to %s (%d: %s)\n",
(unsigned int) msgbuf_size, GNUNET_a2s (sb, sbs), (int) sent,
return GNUNET_SYSERR;
}
LOG (GNUNET_ERROR_TYPE_DEBUG, "Sending %u bytes with session for peer `%s' `%s'\n",
- msgbuf_size,
+ msgbuf_size,
GNUNET_i2s (&session->target),
(char *) session->addr);
static void
unix_plugin_select_write (struct Plugin * plugin)
{
- static int retry_counter = 0;
int sent = 0;
-
struct UNIXMessageWrapper * msgw = plugin->msg_tail;
while (NULL != msgw)
{
else
{
/* Message has a timeout */
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Timeout for message with %llu bytes \n", msgw->msgsize);
GNUNET_CONTAINER_DLL_remove (plugin->msg_head, plugin->msg_tail, msgw);
if (NULL != msgw->cont)
msgw->cont (msgw->cont_cls, &msgw->session->target, GNUNET_SYSERR, msgw->payload, 0);
msgw->payload,
msgw->cont, msgw->cont_cls);
- if (0 == sent)
+ if (RETRY == sent)
{
- retry_counter ++;
- if (retry_counter <= MAX_RETRIES)
- {
- GNUNET_STATISTICS_update (plugin->env->stats,"# UNIX retry attempts",
- 1, GNUNET_NO);
- return; /* retry */
- }
- else
- sent = GNUNET_SYSERR; /* abort */
- }
- retry_counter = 0;
+ GNUNET_STATISTICS_update (plugin->env->stats,"# UNIX retry attempts",
+ 1, GNUNET_NO);
- if (GNUNET_SYSERR == sent)
+ }
+ else if (GNUNET_SYSERR == sent)
{
/* failed and no retry */
if (NULL != msgw->cont)
GNUNET_free (msgw);
return;
}
-
- else if (sent >= 0)
+ else if (sent > 0)
{
/* successfully sent bytes */
if (NULL != msgw->cont)