]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
bwauth: use flag to do not warn when file is missing
authorjuga0 <juga@riseup.net>
Wed, 7 Nov 2018 08:49:51 +0000 (08:49 +0000)
committerteor <teor@torproject.org>
Tue, 26 Mar 2019 07:40:50 +0000 (17:40 +1000)
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

index f373b74c859e5d4fc0667857eca278c154b09a2c..2aaaf7be11701f62e477f5ecf0d03bdaef99b768 100644 (file)
@@ -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));