diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-02-04 19:18:25 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-02-04 19:18:25 +0100 |
commit | 1ca80565458244e9a9622d65bd3953fa3478372a (patch) | |
tree | d5e45fd520b1a75c4114ea701d53f0f2b94d9b4d /src/util/client.c | |
parent | 4575b1275d7e507b8879c10b2714204789b7d453 (diff) | |
download | gnunet-1ca80565458244e9a9622d65bd3953fa3478372a.tar.gz gnunet-1ca80565458244e9a9622d65bd3953fa3478372a.zip |
speed up message goodput in perf_mq(client) by 1/3rd
Diffstat (limited to 'src/util/client.c')
-rw-r--r-- | src/util/client.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/util/client.c b/src/util/client.c index 024f34b3a..93442f0c6 100644 --- a/src/util/client.c +++ b/src/util/client.c | |||
@@ -270,11 +270,22 @@ RETRY: | |||
270 | ret = GNUNET_NETWORK_socket_send (cstate->sock, | 270 | ret = GNUNET_NETWORK_socket_send (cstate->sock, |
271 | &pos[cstate->msg_off], | 271 | &pos[cstate->msg_off], |
272 | len - cstate->msg_off); | 272 | len - cstate->msg_off); |
273 | if ( (-1 == ret) && | ||
274 | (EAGAIN == errno) ) | ||
275 | { | ||
276 | cstate->send_task | ||
277 | = GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL, | ||
278 | cstate->sock, | ||
279 | &transmit_ready, | ||
280 | cstate); | ||
281 | return; | ||
282 | } | ||
273 | if (-1 == ret) | 283 | if (-1 == ret) |
274 | { | 284 | { |
275 | LOG (GNUNET_ERROR_TYPE_WARNING, | 285 | LOG (GNUNET_ERROR_TYPE_WARNING, |
276 | "Error during sending message of type %u\n", | 286 | "Error during sending message of type %u: %s\n", |
277 | ntohs (cstate->msg->type)); | 287 | ntohs (cstate->msg->type), |
288 | strerror (errno)); | ||
278 | if (EINTR == errno) | 289 | if (EINTR == errno) |
279 | { | 290 | { |
280 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 291 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -845,10 +856,8 @@ connection_client_send_impl (struct GNUNET_MQ_Handle *mq, | |||
845 | return; /* still waiting for connection */ | 856 | return; /* still waiting for connection */ |
846 | } | 857 | } |
847 | cstate->send_task | 858 | cstate->send_task |
848 | = GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL, | 859 | = GNUNET_SCHEDULER_add_now (&transmit_ready, |
849 | cstate->sock, | 860 | cstate); |
850 | &transmit_ready, | ||
851 | cstate); | ||
852 | } | 861 | } |
853 | 862 | ||
854 | 863 | ||