diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-04-08 00:39:41 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-04-08 00:39:41 +0000 |
commit | e2572692d27567a64e30806429814085ab56dbd2 (patch) | |
tree | 3f10be875c2d5859c2932640b566eafcbebb8e99 | |
parent | ceb6192864cd2f1c8dea18548c029640c02c6000 (diff) | |
download | gnunet-e2572692d27567a64e30806429814085ab56dbd2.tar.gz gnunet-e2572692d27567a64e30806429814085ab56dbd2.zip |
- dont send keepalives if payload traffic is already queued
-rw-r--r-- | src/mesh/gnunet-service-mesh_connection.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesh/gnunet-service-mesh_connection.c b/src/mesh/gnunet-service-mesh_connection.c index 2d135ca45..cd516248c 100644 --- a/src/mesh/gnunet-service-mesh_connection.c +++ b/src/mesh/gnunet-service-mesh_connection.c | |||
@@ -878,10 +878,18 @@ static void | |||
878 | send_connection_keepalive (struct MeshConnection *c, int fwd) | 878 | send_connection_keepalive (struct MeshConnection *c, int fwd) |
879 | { | 879 | { |
880 | struct GNUNET_MessageHeader msg; | 880 | struct GNUNET_MessageHeader msg; |
881 | struct MeshFlowControl *fc; | ||
881 | 882 | ||
882 | LOG (GNUNET_ERROR_TYPE_INFO, | 883 | LOG (GNUNET_ERROR_TYPE_INFO, |
883 | "keepalive %s for connection %s\n", | 884 | "keepalive %s for connection %s\n", |
884 | GM_f2s (fwd), GMC_2s (c)); | 885 | GM_f2s (fwd), GMC_2s (c)); |
886 | |||
887 | fc = fwd ? &c->fwd_fc : &c->bck_fc; | ||
888 | if (0 < fc->queue_n) | ||
889 | { | ||
890 | LOG (GNUNET_ERROR_TYPE_INFO, "not sending keepalive, traffic in queue\n"); | ||
891 | } | ||
892 | |||
885 | GNUNET_STATISTICS_update (stats, "# keepalives sent", 1, GNUNET_NO); | 893 | GNUNET_STATISTICS_update (stats, "# keepalives sent", 1, GNUNET_NO); |
886 | 894 | ||
887 | GNUNET_assert (NULL != c->t); | 895 | GNUNET_assert (NULL != c->t); |
@@ -2896,7 +2904,7 @@ GMC_send_prebuilt_message (const struct GNUNET_MessageHeader *message, | |||
2896 | { | 2904 | { |
2897 | GNUNET_STATISTICS_update (stats, "# messages dropped (buffer full)", | 2905 | GNUNET_STATISTICS_update (stats, "# messages dropped (buffer full)", |
2898 | 1, GNUNET_NO); | 2906 | 1, GNUNET_NO); |
2899 | GNUNET_break (0); //FIXME keepalives can trigger this, dont send if queue | 2907 | GNUNET_break (0); |
2900 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2908 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
2901 | "queue full: %u/%u\n", | 2909 | "queue full: %u/%u\n", |
2902 | fc->queue_n, fc->queue_max); | 2910 | fc->queue_n, fc->queue_max); |