Add feature to handle unset (default) configuration options in GETCONF control messages

svn:r4461
This commit is contained in:
Nick Mathewson 2005-06-19 22:38:36 +00:00
parent 64fc1f7bae
commit eb327e7660
2 changed files with 7 additions and 2 deletions

View File

@ -433,7 +433,7 @@ def do_main_loop(host,port):
(".", "abacinator.onion")])` (".", "abacinator.onion")])`
print `extend_circuit(s,0,["moria1"])` print `extend_circuit(s,0,["moria1"])`
print '========' print '========'
print `extend_circuit(s,0,[""])` #print `extend_circuit(s,0,[""])`
print '========' print '========'
#send_signal(s,1) #send_signal(s,1)
#save_conf(s) #save_conf(s)

View File

@ -693,7 +693,12 @@ handle_control_getconf(connection_t *conn, uint32_t body_len, const char *body)
} }
} else { } else {
struct config_line_t *answer = config_get_assigned_option(options,q); struct config_line_t *answer = config_get_assigned_option(options,q);
/* XXXX handle non-set options in V1 at least*/ if (!v0 && !answer) {
size_t alen = strlen(q)+8;
char *astr = tor_malloc(alen);
tor_snprintf(astr, alen, "250-%s\r\n", q);
smartlist_add(answers, astr);
}
while (answer) { while (answer) {
struct config_line_t *next; struct config_line_t *next;