some early bugfixes

our log() conflicts with log(3)
distribute only the correct files from doc/ and src/config/
sometimes laptops go back in time. i guess that's ok for now.
and bump the version number because we're live.


svn:r544
This commit is contained in:
Roger Dingledine
2003-10-07 16:30:05 +00:00
parent e826873ac6
commit de6cbe53c0
11 changed files with 19 additions and 21 deletions
+2 -3
View File
@@ -1,7 +1,6 @@
# leave in dependency order, since common must be built first
SUBDIRS = common or
DIST_SUBDIRS = common or
EXTRA_DIST = config
SUBDIRS = common or config
DIST_SUBDIRS = common or config
+1 -1
View File
@@ -103,7 +103,7 @@ log_set_severity(int severity)
}
/* Outputs a message to stdout */
void log(int severity, const char *format, ...)
void _log(int severity, const char *format, ...)
{
va_list ap;
va_start(ap,format);
+3 -2
View File
@@ -36,7 +36,7 @@ void close_logs();
void reset_logs();
/* Outputs a message to stdout */
void log(int severity, const char *format, ...) CHECK_PRINTF(2,3);
void _log(int severity, const char *format, ...) CHECK_PRINTF(2,3);
#ifdef __GNUC__
void _log_fn(int severity, const char *funcname, const char *format, ...)
@@ -44,8 +44,9 @@ void _log_fn(int severity, const char *funcname, const char *format, ...)
#define log_fn(severity, args...) \
_log_fn(severity, __PRETTY_FUNCTION__, args)
#else
#define log_fn log
#define log_fn _log
#endif
#define log _log /* hack it so we don't conflict with log() as much */
# define __LOG_H
#endif
+3 -3
View File
@@ -61,7 +61,6 @@ long
tv_udiff(struct timeval *start, struct timeval *end)
{
long udiff;
long end_usec = end->tv_usec;
long secdiff = end->tv_sec - start->tv_sec;
if (secdiff+1 > LONG_MAX/1000000) {
@@ -69,9 +68,10 @@ tv_udiff(struct timeval *start, struct timeval *end)
return LONG_MAX;
}
udiff = secdiff*1000000L + (end_usec - start->tv_usec);
udiff = secdiff*1000000L + (end->tv_usec - start->tv_usec);
if(udiff < 0) {
log_fn(LOG_WARNING, "start is after end. Returning 0.");
log_fn(LOG_INFO, "start (%ld.%ld) is after end (%ld.%ld). Returning 0.",
start->tv_sec, start->tv_usec, end->tv_sec, end->tv_usec);
return 0;
}
return udiff;
+1
View File
@@ -32,6 +32,7 @@
#define INLINE inline
#endif
#define xfree(p) do {if(p) {free(p); (p)=NULL;}} while(0) /* XXX use everywhere? */
void *tor_malloc(size_t size);
char *tor_strdup(const char *s);
void tor_gettimeofday(struct timeval *timeval);
-2
View File
@@ -351,8 +351,6 @@ int connection_read_to_buf(connection_t *conn) {
at_most = 10*(CELL_PAYLOAD_SIZE - RELAY_HEADER_SIZE);
}
at_most = 103; /* an unusual number, to force bugs into the open */
if(at_most > global_read_bucket)
at_most = global_read_bucket;
}
+1 -1
View File
@@ -95,7 +95,7 @@
#include "../common/log.h"
#include "../common/util.h"
#define RECOMMENDED_SOFTWARE_VERSIONS "0.0.2pre8,0.0.2pre9"
#define RECOMMENDED_SOFTWARE_VERSIONS "0.0.2pre8,0.0.2pre9,0.0.2pre10"
#define MAXCONNECTIONS 1000 /* upper bound on max connections.
can be lowered by config file */