mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
Have dirctory authorites note which servers make good V2 directory caches in publishe network-status.
svn:r5574
This commit is contained in:
parent
32126cced1
commit
27a201ac80
@ -1299,6 +1299,8 @@ generate_v2_networkstatus(void)
|
|||||||
ri->cache_info.identity_digest);
|
ri->cache_info.identity_digest);
|
||||||
int f_named = naming && ri->is_named;
|
int f_named = naming && ri->is_named;
|
||||||
int f_valid = ri->is_verified;
|
int f_valid = ri->is_verified;
|
||||||
|
int f_v2_dir = ri->dir_port &&
|
||||||
|
tor_version_as_new_as(ri->platform,"0.1.1.9-alpha");
|
||||||
char identity64[BASE64_DIGEST_LEN+1];
|
char identity64[BASE64_DIGEST_LEN+1];
|
||||||
char digest64[BASE64_DIGEST_LEN+1];
|
char digest64[BASE64_DIGEST_LEN+1];
|
||||||
if (options->AuthoritativeDir) {
|
if (options->AuthoritativeDir) {
|
||||||
@ -1316,7 +1318,7 @@ generate_v2_networkstatus(void)
|
|||||||
|
|
||||||
if (tor_snprintf(outp, endp-outp,
|
if (tor_snprintf(outp, endp-outp,
|
||||||
"r %s %s %s %s %s %d %d\n"
|
"r %s %s %s %s %s %d %d\n"
|
||||||
"s%s%s%s%s%s%s%s\n",
|
"s%s%s%s%s%s%s%s%s\n",
|
||||||
ri->nickname,
|
ri->nickname,
|
||||||
identity64,
|
identity64,
|
||||||
digest64,
|
digest64,
|
||||||
@ -1330,7 +1332,8 @@ generate_v2_networkstatus(void)
|
|||||||
f_named?" Named":"",
|
f_named?" Named":"",
|
||||||
f_stable?" Stable":"",
|
f_stable?" Stable":"",
|
||||||
f_running?" Running":"",
|
f_running?" Running":"",
|
||||||
f_valid?" Valid":"")<0) {
|
f_valid?" Valid":"",
|
||||||
|
f_v2_dir?" V2Dir":"")<0) {
|
||||||
warn(LD_BUG, "Unable to print router status.");
|
warn(LD_BUG, "Unable to print router status.");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -827,6 +827,9 @@ typedef struct routerstatus_t {
|
|||||||
unsigned int is_running:1; /**< True iff this router is up. */
|
unsigned int is_running:1; /**< True iff this router is up. */
|
||||||
unsigned int is_named:1; /**< True iff "nickname" belongs to this router. */
|
unsigned int is_named:1; /**< True iff "nickname" belongs to this router. */
|
||||||
unsigned int is_valid:1; /**< True iff this router is validated. */
|
unsigned int is_valid:1; /**< True iff this router is validated. */
|
||||||
|
unsigned int is_v2_dir:1; /**< True iff this router can serve router
|
||||||
|
* information with v2 of the directory
|
||||||
|
* protocol */
|
||||||
} routerstatus_t;
|
} routerstatus_t;
|
||||||
|
|
||||||
/** DOCDOC */
|
/** DOCDOC */
|
||||||
|
@ -1057,6 +1057,8 @@ routerstatus_parse_entry_from_string(const char **s, smartlist_t *tokens)
|
|||||||
rs->is_named = 1;
|
rs->is_named = 1;
|
||||||
else if (!strcmp(tok->args[i], "Valid"))
|
else if (!strcmp(tok->args[i], "Valid"))
|
||||||
rs->is_valid = 1;
|
rs->is_valid = 1;
|
||||||
|
else if (!strcmp(tok->args[i], "V2Dir"))
|
||||||
|
rs->is_v2_dir = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user