Explorar o código

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.
juga0 %!s(int64=7) %!d(string=hai) anos
pai
achega
ee09e5d7ea
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/feature/dircache/dircache.c

+ 2 - 1
src/feature/dircache/dircache.c

@@ -1451,7 +1451,8 @@ handle_get_next_bandwidth(dir_connection_t *conn,
   const or_options_t *options = get_options();
   const or_options_t *options = get_options();
   if (options->V3BandwidthsFile) {
   if (options->V3BandwidthsFile) {
     int lifetime = 60;
     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);
     size_t len = strlen(bandwidth);
     write_http_response_header(conn, len, NO_METHOD, lifetime);
     write_http_response_header(conn, len, NO_METHOD, lifetime);
     connection_buf_add(bandwidth, len, TO_CONN(conn));
     connection_buf_add(bandwidth, len, TO_CONN(conn));