]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Workaround for bug on windows where cached-directories get crlf corruption.
authorNick Mathewson <nickm@torproject.org>
Thu, 7 Oct 2004 20:22:58 +0000 (20:22 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 7 Oct 2004 20:22:58 +0000 (20:22 +0000)
svn:r2426

src/or/router.c
src/or/routerlist.c

index 032f3969e06e44572039b81fd343b1b467b59056..ba25292c9e75500e3b91ec4e080a7e7f995cb4ba 100644 (file)
@@ -352,6 +352,7 @@ int init_keys(void) {
   if(!cp) {
     log_fn(LOG_INFO,"Cached directory %s not present. Ok.",keydir);
   } else {
+    tor_strstrip(cp,"\r"); /* XXXX Workaround for win32 read_file_to_str bug. */ 
     if(dirserv_load_from_directory_string(cp) < 0){
       log_fn(LOG_ERR, "Cached directory %s is corrupt", keydir);
       tor_free(cp);
index 2c79c39075e208a7769893a9463b537aa7807229..cb63ee50720e684d266820ecadbb34cdb39c4c25 100644 (file)
@@ -64,6 +64,7 @@ int router_reload_router_list(void)
     snprintf(filename,sizeof(filename),"%s/cached-directory", get_data_directory(&options));
     s = read_file_to_str(filename,0);
     if (s) {
+      tor_strstrip(s,"\r"); /* XXXX This is a bug workaround for win32. */
       log_fn(LOG_INFO, "Loading cached directory from %s", filename);
       if (router_load_routerlist_from_directory(s, NULL, 0) < 0) {
         log_fn(LOG_WARN, "Cached directory '%s' was unparseable; ignoring.", filename);