소스 검색

Turn DEFAULT_IF_MODIFIED_SINCE_DELAY into a const

Nick Mathewson 8 년 전
부모
커밋
a8eccb6363
1개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 4
      src/or/directory.c

+ 5 - 4
src/or/directory.c

@@ -493,14 +493,15 @@ dir_consensus_request_set_additional_headers(directory_request_t *req,
   uint8_t or_diff_from[DIGEST256_LEN];
   int or_diff_from_is_set = 0;
 
+  /* DEFAULT_IF_MODIFIED_SINCE_DELAY is 1/20 of the default consensus
+   * period of 1 hour.
+   */
+  const int DEFAULT_IF_MODIFIED_SINCE_DELAY = 180;
+
   int flav = FLAV_NS;
   if (resource)
     flav = networkstatus_parse_flavor_name(resource);
 
-  /* DEFAULT_IF_MODIFIED_SINCE_DELAY is 1/20 of the default consensus
-   * period of 1 hour.
-   */
-#define DEFAULT_IF_MODIFIED_SINCE_DELAY (180)
   if (flav != -1) {
     /* IF we have a parsed consensus of this type, we can do an
      * if-modified-time based on it. */