[or-cvs] Workaround for bug on windows where cached-directories get ...

Nick Mathewson nickm at seul.org
Thu Oct 7 20:23:01 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv16414/src/or

Modified Files:
	router.c routerlist.c 
Log Message:
Workaround for bug on windows where cached-directories get crlf corruption.

Index: router.c
===================================================================
RCS file: /home/or/cvsroot/src/or/router.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- router.c	6 Oct 2004 13:31:48 -0000	1.90
+++ router.c	7 Oct 2004 20:22:58 -0000	1.91
@@ -352,6 +352,7 @@
   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: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.146
retrieving revision 1.147
diff -u -d -r1.146 -r1.147
--- routerlist.c	6 Oct 2004 05:05:43 -0000	1.146
+++ routerlist.c	7 Oct 2004 20:22:58 -0000	1.147
@@ -64,6 +64,7 @@
     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);



More information about the tor-commits mailing list