mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 14:23:30 +01:00
Workaround for bug on windows where cached-directories get crlf corruption.
svn:r2426
This commit is contained in:
parent
3be0bf4b88
commit
dad7c71686
@ -352,6 +352,7 @@ int init_keys(void) {
|
|||||||
if(!cp) {
|
if(!cp) {
|
||||||
log_fn(LOG_INFO,"Cached directory %s not present. Ok.",keydir);
|
log_fn(LOG_INFO,"Cached directory %s not present. Ok.",keydir);
|
||||||
} else {
|
} else {
|
||||||
|
tor_strstrip(cp,"\r"); /* XXXX Workaround for win32 read_file_to_str bug. */
|
||||||
if(dirserv_load_from_directory_string(cp) < 0){
|
if(dirserv_load_from_directory_string(cp) < 0){
|
||||||
log_fn(LOG_ERR, "Cached directory %s is corrupt", keydir);
|
log_fn(LOG_ERR, "Cached directory %s is corrupt", keydir);
|
||||||
tor_free(cp);
|
tor_free(cp);
|
||||||
|
@ -64,6 +64,7 @@ int router_reload_router_list(void)
|
|||||||
snprintf(filename,sizeof(filename),"%s/cached-directory", get_data_directory(&options));
|
snprintf(filename,sizeof(filename),"%s/cached-directory", get_data_directory(&options));
|
||||||
s = read_file_to_str(filename,0);
|
s = read_file_to_str(filename,0);
|
||||||
if (s) {
|
if (s) {
|
||||||
|
tor_strstrip(s,"\r"); /* XXXX This is a bug workaround for win32. */
|
||||||
log_fn(LOG_INFO, "Loading cached directory from %s", filename);
|
log_fn(LOG_INFO, "Loading cached directory from %s", filename);
|
||||||
if (router_load_routerlist_from_directory(s, NULL, 0) < 0) {
|
if (router_load_routerlist_from_directory(s, NULL, 0) < 0) {
|
||||||
log_fn(LOG_WARN, "Cached directory '%s' was unparseable; ignoring.", filename);
|
log_fn(LOG_WARN, "Cached directory '%s' was unparseable; ignoring.", filename);
|
||||||
|
Loading…
Reference in New Issue
Block a user