aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_unix.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-02-14 15:35:10 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-02-14 15:35:10 +0000
commit8042d0a40b81fe5bbc2b4bf8b8e50acb493af162 (patch)
tree1a795583e6b0788ecdafb2057a5917663680c95f /src/transport/plugin_transport_unix.c
parente2c054f003fe3a08796b5ef40e82daa70d080d40 (diff)
downloadgnunet-8042d0a40b81fe5bbc2b4bf8b8e50acb493af162.tar.gz
gnunet-8042d0a40b81fe5bbc2b4bf8b8e50acb493af162.zip
- fix EAGAIN issue
Diffstat (limited to 'src/transport/plugin_transport_unix.c')
-rw-r--r--src/transport/plugin_transport_unix.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index c5cdb17d4..e5ada0490 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -64,8 +64,6 @@
64 */ 64 */
65#define UNIX_NAT_DEFAULT_PORT 22086 65#define UNIX_NAT_DEFAULT_PORT 22086
66 66
67#define MAX_RETRIES 5
68
69GNUNET_NETWORK_STRUCT_BEGIN 67GNUNET_NETWORK_STRUCT_BEGIN
70 68
71/** 69/**
@@ -100,8 +98,6 @@ struct UNIXMessageWrapper
100 struct UNIXMessage * msg; 98 struct UNIXMessage * msg;
101 size_t msgsize; 99 size_t msgsize;
102 100
103 int retry_counter;
104
105 struct GNUNET_TIME_Relative timeout; 101 struct GNUNET_TIME_Relative timeout;
106 unsigned int priority; 102 unsigned int priority;
107 103
@@ -436,11 +432,9 @@ unix_real_send (void *cls,
436 432
437 if (size < msgbuf_size) 433 if (size < msgbuf_size)
438 { 434 {
439#if DEBUG_UNIX
440 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 435 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
441 "Trying to increase socket buffer size from %i to %i for message size %i\n", 436 "Trying to increase socket buffer size from %i to %i for message size %i\n",
442 size, ((msgbuf_size / 1000) + 2) * 1000, msgbuf_size); 437 size, ((msgbuf_size / 1000) + 2) * 1000, msgbuf_size);
443#endif
444 size = ((msgbuf_size / 1000) + 2) * 1000; 438 size = ((msgbuf_size / 1000) + 2) * 1000;
445 if (GNUNET_NETWORK_socket_setsockopt 439 if (GNUNET_NETWORK_socket_setsockopt
446 ((struct GNUNET_NETWORK_Handle *) send_handle, SOL_SOCKET, SO_SNDBUF, 440 ((struct GNUNET_NETWORK_Handle *) send_handle, SOL_SOCKET, SO_SNDBUF,
@@ -620,7 +614,6 @@ unix_plugin_send (void *cls,
620 wrapper->timeout = to; 614 wrapper->timeout = to;
621 wrapper->cont = cont; 615 wrapper->cont = cont;
622 wrapper->cont_cls = cont_cls; 616 wrapper->cont_cls = cont_cls;
623 wrapper->retry_counter = 0;
624 wrapper->session = session; 617 wrapper->session = session;
625 618
626 GNUNET_CONTAINER_DLL_insert(plugin->msg_head, plugin->msg_tail, wrapper); 619 GNUNET_CONTAINER_DLL_insert(plugin->msg_head, plugin->msg_tail, wrapper);
@@ -759,17 +752,6 @@ unix_plugin_select_write (struct Plugin * plugin)
759 return; 752 return;
760 } 753 }
761 754
762 /* max retries */
763 if (msgw->retry_counter > MAX_RETRIES)
764 {
765 msgw->cont (msgw->cont_cls, &msgw->session->target, GNUNET_SYSERR);
766 GNUNET_CONTAINER_DLL_remove(plugin->msg_head, plugin->msg_tail, msgw);
767 GNUNET_break (0);
768 GNUNET_free (msgw->msg);
769 GNUNET_free (msgw);
770 return;
771 }
772
773 /* failed and no retry */ 755 /* failed and no retry */
774 if (sent == -1) 756 if (sent == -1)
775 { 757 {
@@ -781,11 +763,7 @@ unix_plugin_select_write (struct Plugin * plugin)
781 763
782 /* failed and retry */ 764 /* failed and retry */
783 if (sent == 0) 765 if (sent == 0)
784 {
785 msgw->retry_counter++;
786 return; 766 return;
787 }
788
789} 767}
790 768
791/* 769/*