X-Git-Url: http://git.onelab.eu/?p=distributedratelimiting.git;a=blobdiff_plain;f=drl%2Fpeer_comm.c;h=eba9637fb13e81d98d10991513483832e1d3ba30;hp=2da6737cb3886319bfe85aa3b25c7206e90a5713;hb=17fba5cc2628df108d09ab4abbbd4b4a7437e7eb;hpb=d12ab8f1cd4ff135d692f7841360af70f0beb57b diff --git a/drl/peer_comm.c b/drl/peer_comm.c index 2da6737..eba9637 100644 --- a/drl/peer_comm.c +++ b/drl/peer_comm.c @@ -391,7 +391,9 @@ static void ident_receive(comm_ident_t *ident, pthread_rwlock_t *limiter_rwlock) } #endif -#define ALLOW_PARTITION +/* Turn this on to simulate network partitions. + * Turn off for production settings. */ +//#define ALLOW_PARTITION int send_udp_mesh(comm_t *comm, uint32_t id, int sock) { int result = 0; @@ -440,6 +442,8 @@ int send_udp_mesh(comm_t *comm, uint32_t id, int sock) { } } + partition_count += 1; + #endif toaddr.sin_addr.s_addr = remote->addr; /* Already in network byte order. */ @@ -450,7 +454,6 @@ int send_udp_mesh(comm_t *comm, uint32_t id, int sock) { printlog(LOG_WARN, " - The error was |%d|\n", strerror(result)); break; } - partition_count += 1; } return result;