Long-outstanding commit. (Hopefully) Final version before running experiments for...
[distributedratelimiting.git] / drl / peer_comm.c
index 2da6737..eba9637 100644 (file)
@@ -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;