Commit Graph

885 Commits

Author SHA1 Message Date
Roger Dingledine
8cf8b8087a when we decide not to mmap, because the file is empty or isn't
there at all, don't yell so loud.


svn:r9065
2006-12-11 04:21:10 +00:00
Nick Mathewson
e8dc71ade4 r11444@Kushana: nickm | 2006-12-07 09:38:52 -0500
Fix a couple of obvious bugs in tor_mmap_file on Windows: first, fix a boolean error when checking the return value of CreateFileMapping.  Second, CreateFileMapping is documented to return NULL on failure.


svn:r9035
2006-12-07 14:39:42 +00:00
Roger Dingledine
936f075f11 help ftello find its prototype
svn:r9016
2006-12-02 23:08:55 +00:00
Roger Dingledine
c5b90daf86 cleanups, bump to 0.1.2.4-alpha
svn:r9015
2006-12-02 22:47:46 +00:00
Nick Mathewson
facc49cf6f r9371@totoro: nickm | 2006-11-21 10:59:28 -0500
Fix a trivial comment.


svn:r8979
2006-11-21 23:50:21 +00:00
Nick Mathewson
d6cc235eba r9315@totoro: nickm | 2006-11-13 22:40:59 -0500
Fix a build warning on angela-sid


svn:r8949
2006-11-14 03:41:05 +00:00
Nick Mathewson
9243e54177 r9313@totoro: nickm | 2006-11-13 20:07:41 -0500
Try to compile with fewer warnings on irix64's MIPSpro compiler /
 environment, which apparently believes that:
   - off_t can be bigger than size_t.
   - only mean kids assign things they do not subsequently inspect.
 
 I don't try to fix the "error" that makes it say:
 
 cc-3970 cc: WARNING File = main.c, Line = 1277
   conversion from pointer to same-sized integral type (potential portability
           problem)
 
     uintptr_t sig = (uintptr_t)arg;
 
 Because really, what can you do about a compiler that claims to be c99
 but doesn't understand that void* x = NULL; uintptr_t y = (uintptr_t) x;
 is safe?
 


svn:r8948
2006-11-14 01:07:52 +00:00
Roger Dingledine
3d6b97399f Avoid assert failure when our cached-routers file is empty on startup.
(reported by revstray)


svn:r8928
2006-11-12 07:09:22 +00:00
Nick Mathewson
50771a6b48 r9380@Kushana: nickm | 2006-10-24 21:25:07 -0400
Add string.h include to compat.h so that strlcpy() and strlcat() will always be defined after including compat.h.  This should resolve warnings on centos.


svn:r8824
2006-10-25 01:25:17 +00:00
Roger Dingledine
0459db2c0d checkpoint some changes as i read diffs
svn:r8780
2006-10-20 19:11:12 +00:00
Nick Mathewson
c8c36dd227 r9304@dhcp-18-188-67-85: nickm | 2006-10-20 12:22:46 -0400
Change HT_INIT from a special-case to a macro-calling-a-function like the rest of ht.h.  This might prevent errors if somebody did, I dunno, "HT_INIT(tp, hashtable++)". Based on a patch from Watson Ladd.


svn:r8776
2006-10-20 16:22:53 +00:00
Roger Dingledine
dcd33ef599 i saw somebody on #tor paste a string where these were
null. better safe than sorry.


svn:r8767
2006-10-20 00:12:02 +00:00
Nick Mathewson
7551c44a53 r9274@Kushana: nickm | 2006-10-19 16:16:58 -0400
Add unit tests for tor_mmap_file(); make tor_mmap_t.size always be the size of the file (not the size of the mapping); add an extra argument to read_file_to_str() so it can return the size of the result string.


svn:r8762
2006-10-19 23:05:02 +00:00
Nick Mathewson
17abfa6a6a r8971@totoro: nickm | 2006-10-09 10:16:23 -0400
Move definition of ssize_t to torint.h


svn:r8670
2006-10-09 15:47:08 +00:00
Nick Mathewson
e618c15aff r8967@totoro: nickm | 2006-10-08 23:38:50 -0400
Fix some test and warn failures in last commit


svn:r8665
2006-10-09 03:39:06 +00:00
Nick Mathewson
c6f2d725d0 r8957@totoro: nickm | 2006-10-08 22:35:17 -0400
The otherwise regrettable MIPSpro C compiler warns about values set but never used, and about mixing enums and ints; these are good warnings, and so should be fixed.  This removes some dead code and some potential bugs. Thanks to pnx.


svn:r8664
2006-10-09 02:35:51 +00:00
Andrew Lewman
563be121c2 Add missing return so this builds on mingw.
svn:r8649
2006-10-08 18:24:31 +00:00
Nick Mathewson
f07f7a7a12 r8923@totoro: nickm | 2006-10-07 11:44:33 -0400
More doxygen comments


svn:r8637
2006-10-07 16:25:28 +00:00
Roger Dingledine
f2bd0e2f16 more minor cleanups
svn:r8630
2006-10-07 06:28:50 +00:00
Roger Dingledine
881d23847a fix something that looked scary to me. i believe this won't
change any behavior currently, but it will avoiding calling
noop code that might change for the worse some time.

nick, please confirm.


svn:r8623
2006-10-07 00:52:23 +00:00
Roger Dingledine
06e5b2283c minor cleanups
svn:r8622
2006-10-07 00:50:39 +00:00
Nick Mathewson
29fa9eb216 r8860@totoro: nickm | 2006-10-03 14:48:33 -0400
Use ANSI-style definition syntax in strlcat.c and strlcpy.c so that gcc stops barfing with -Wold-style-definition


svn:r8591
2006-10-03 19:00:07 +00:00
Nick Mathewson
4c56ac93ca r8851@totoro: nickm | 2006-10-02 18:13:27 -0400
Remove/clarify some XXXs for no longer being accurate; for begin things we do not indend to fix; for already being parts of big todo issues (like "/* XXX ipv6 */"); etc. Also fix some spaces.


svn:r8580
2006-10-02 22:13:42 +00:00
Nick Mathewson
bff83b666c r8846@totoro: nickm | 2006-10-02 16:59:57 -0400
Move is_local_IP to config.c; have it check for same-/24; make it used only for reachability (not for banwidth, because that is probably not what we want). Fixes an XXX.


svn:r8578
2006-10-02 21:00:35 +00:00
Nick Mathewson
d75edc35cc r8845@totoro: nickm | 2006-10-02 16:34:58 -0400
Fix an XXXX: make path_is_relative work on windows even though we never use it there.


svn:r8577
2006-10-02 21:00:24 +00:00
Nick Mathewson
36adc7cdd9 r8844@totoro: nickm | 2006-10-02 16:32:44 -0400
Resolve an XXXX: make sure that we are actually on 2s-complement hardware.


svn:r8576
2006-10-02 21:00:20 +00:00
Nick Mathewson
219ad6395c r8825@totoro: nickm | 2006-10-01 17:41:27 -0400
Add function to return a random uint64_t.


svn:r8570
2006-10-01 21:59:05 +00:00
Nick Mathewson
c2d304366b r9032@Kushana: nickm | 2006-09-29 18:51:42 -0400
Now, all log messages should be distinct.


svn:r8545
2006-09-29 22:51:47 +00:00
Nick Mathewson
7d366f61cb r9025@Kushana: nickm | 2006-09-29 18:33:13 -0400
Differentiate more duplicated log entries


svn:r8542
2006-09-29 22:33:40 +00:00
Nick Mathewson
8308a37908 r9023@Kushana: nickm | 2006-09-29 17:27:24 -0400
Make distinct all non-bug messages at notice or higher that appear 3 or more times.


svn:r8541
2006-09-29 22:33:34 +00:00
Nick Mathewson
87648bdcf8 r9008@Kushana: nickm | 2006-09-29 13:50:10 -0400
Doxygen comments for code in common.  Also simplify a few code paths to be more clear/speedy/correct.


svn:r8536
2006-09-29 18:13:37 +00:00
Nick Mathewson
05604c60d4 r9006@Kushana: nickm | 2006-09-29 10:48:23 -0400
Omit function names from NOTICE, WARN and ERR messages unless they are in LD_BUG.


svn:r8534
2006-09-29 18:13:29 +00:00
Nick Mathewson
d3a06684bc r8974@Kushana: nickm | 2006-09-28 17:05:59 -0400
Improvement to last entry guards patch: track when we last attempted to connect to a node in our state file along with how long it has been unreachable.  Also clarify behavior of parse_iso_time() when it gets extra characters.


svn:r8520
2006-09-28 23:57:49 +00:00
Nick Mathewson
95132f836a r8750@totoro: nickm | 2006-09-27 20:52:01 -0400
Fix some warnings on mingw; hopefully this should let us build on mingw without warnings.


svn:r8509
2006-09-28 00:53:02 +00:00
Nick Mathewson
0f8491a254 Backport candidate: remove dangerous free(0) on hashtable init
svn:r8499
2006-09-25 16:06:09 +00:00
Nick Mathewson
78c068397a add missing paren in dmalloc tor_free
svn:r8498
2006-09-25 15:44:40 +00:00
Nick Mathewson
7c21dabef1 r8878@Kushana: nickm | 2006-09-21 17:15:47 -0400
Trivial whitespace cleanups.


svn:r8443
2006-09-21 21:48:55 +00:00
Nick Mathewson
b2cc52fa02 Speed up eat_whitespace by a lot.
svn:r8434
2006-09-19 23:55:35 +00:00
Nick Mathewson
6b716fdfb9 NEEDS REVIEW. Act on previous comment, and handle named servers differently: now, we allow multiple servers with the same name in the routerlist even if that name is reserved, but we check whether names are reserved when we try to look up routers by nickname. This is a minor security fix. This makes router_add_to_routerlist O(1). This is a backport candidate.
svn:r8433
2006-09-19 23:48:14 +00:00
Nick Mathewson
2d4950c837 Malloc and friends are critical-path: Thus, add an it-wont-happen branch prediction for NULL returns, and skip the malloc(0) check on platforms where malloc(0) returns a pointer.
svn:r8431
2006-09-19 22:36:48 +00:00
Nick Mathewson
7b0ec744bc Switch routerlist.c to using memcmp on digests rather than crypto_pk_cmp_keys(); speed up find_whitespace a lot (8x for me) by using a switch statement. This should speed parsing a lot of routers at once by a lot.
svn:r8430
2006-09-19 22:20:09 +00:00
Nick Mathewson
93beeac01d Merge in some bsockets calls, all wrapped inside #if defined(USE_BSOCKETS)
svn:r8427
2006-09-19 20:41:31 +00:00
Nick Mathewson
e58b9c1151 r8819@Kushana: nickm | 2006-09-15 00:27:45 -0400
Implement a smartlist_uniq() that will with luck not end the world.


svn:r8396
2006-09-15 04:27:58 +00:00
Peter Palfrader
28cac25d7e r9749@danube: weasel | 2006-09-14 06:53:12 +0200
Do not graciously increase the size to be mmaped if the current size already is
 at a page_size boundary.  This is important since if a file has a size of zero
 and we mmap() it with length > 0, then accessing the mmaped memory area causes
 a bus error.  However, if we pass a length of 0 to mmap() it will return with -1
 and things work from there.


svn:r8387
2006-09-14 04:53:42 +00:00
Roger Dingledine
9af3175687 parameterize the loudness of get_interface_address()
svn:r8358
2006-09-09 19:20:27 +00:00
Roger Dingledine
5f6351ceb3 fix typo, add log message
svn:r8357
2006-09-09 19:16:07 +00:00
Nick Mathewson
365ccf0742 r8725@Kushana: nickm | 2006-09-06 04:39:29 -0400
spawn_func fixes: have cpuworker_main and dnsworker_main confirm to the right interfaces [casting func to void* is icky].  Also, make pthread_create() build without warnings.


svn:r8327
2006-09-06 08:42:20 +00:00
Nick Mathewson
000b7b287c r8724@Kushana: nickm | 2006-09-06 04:32:28 -0400
Fix spaces; restore support for mapping files over 4GB on win32 (?)


svn:r8326
2006-09-06 08:42:16 +00:00
Mike Chiussi
6ec9c1092a - made configure check if we are building for win32
- made configure link to required system dll's if building for win32
- added diffs for libevent 1.1b
- forced user to turn off eventdns if win32 is set 
- cleaned up tor_mmap_file()_win32 (not sure if it's stable)
- cleaned up some warnings and typos




svn:r8322
2006-09-06 01:49:55 +00:00
Nick Mathewson
c4ac4bcba3 r8696@Kushana: nickm | 2006-08-31 14:43:44 -0400
Try to appease some warnings with newer gccs that believe that ignoring a return value is okay, but casting a return value and then ignoring it is a sign of madness.


svn:r8312
2006-08-31 18:47:54 +00:00