[tor-commits] [tor/maint-0.4.0] bwauth: use flag to do not warn when file is missing

teor at torproject.org teor at torproject.org
Tue Mar 26 09:16:26 UTC 2019


commit ee09e5d7eacdfde0cd5e1bc4a18c72fd7e47c1a7
Author: juga0 <juga at riseup.net>
Date:   Wed Nov 7 08:49:51 2018 +0000

    bwauth: use flag to do not warn when file is missing
    
    Use flag to do not warn when the bandwidth file is missing trying
    to serve it by http.
    Also remove double space in the assignement.
---
 src/feature/dircache/dircache.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/feature/dircache/dircache.c b/src/feature/dircache/dircache.c
index f373b74c8..2aaaf7be1 100644
--- a/src/feature/dircache/dircache.c
+++ b/src/feature/dircache/dircache.c
@@ -1451,7 +1451,8 @@ handle_get_next_bandwidth(dir_connection_t *conn,
   const or_options_t *options = get_options();
   if (options->V3BandwidthsFile) {
     int lifetime = 60;
-    char *bandwidth =  read_file_to_str(options->V3BandwidthsFile, 0, NULL);
+    char *bandwidth = read_file_to_str(options->V3BandwidthsFile,
+                                       RFTS_IGNORE_MISSING, NULL);
     size_t len = strlen(bandwidth);
     write_http_response_header(conn, len, NO_METHOD, lifetime);
     connection_buf_add(bandwidth, len, TO_CONN(conn));





More information about the tor-commits mailing list