]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add nonfatal asserts for return val of dirserv_flushed_some
authorNick Mathewson <nickm@torproject.org>
Fri, 17 Mar 2017 15:34:41 +0000 (11:34 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 28 Mar 2017 17:55:04 +0000 (19:55 +0200)
src/or/directory.c

index ee36a433c8248af94b4bf8dc5c0cfe3184251c73..fa76afac6612d2e39815b3661971e21ad5a356a6 100644 (file)
@@ -3181,7 +3181,8 @@ handle_get_current_consensus(dir_connection_t *conn,
       conn->zlib_state = tor_zlib_new(0, ZLIB_METHOD, HIGH_COMPRESSION);
 
     /* Prime the connection with some data. */
-    connection_dirserv_flushed_some(conn);
+    const int initial_flush_result = connection_dirserv_flushed_some(conn);
+    tor_assert_nonfatal(initial_flush_result == 0);
     goto done;
   }
 
@@ -3337,7 +3338,8 @@ handle_get_microdesc(dir_connection_t *conn, const get_handler_args_t *args)
       conn->zlib_state = tor_zlib_new(1, ZLIB_METHOD,
                                       choose_compression_level(size_guess));
 
-    connection_dirserv_flushed_some(conn);
+    const int initial_flush_result = connection_dirserv_flushed_some(conn);
+    tor_assert_nonfatal(initial_flush_result == 0);
     goto done;
   }
 
@@ -3430,7 +3432,8 @@ handle_get_descriptor(dir_connection_t *conn, const get_handler_args_t *args)
                                         choose_compression_level(size_guess));
       clear_spool = 0;
       /* Prime the connection with some data. */
-      connection_dirserv_flushed_some(conn);
+      int initial_flush_result = connection_dirserv_flushed_some(conn);
+      tor_assert_nonfatal(initial_flush_result == 0);
     }
     goto done;
   }