aboutsummaryrefslogtreecommitdiff
path: root/src/or/buffers.c
AgeCommit message (Collapse)Author
2014-05-08Move structures into (private) part of buffers.h so we can inspect them ↵Nick Mathewson
while testing
2014-04-29Make --disable-buf-freelists build and pass unit testsAndrea Shepard
2014-04-18scan-build: check impossible null-pointer case in buffers.cNick Mathewson
When maintaining buffer freelists, we don't skip more than there are, so (*chp) can't be null to begin with. scan-build has no way to know that.
2014-03-05Fix whitespace errors, all of them mine.Nick Mathewson
2014-03-04Merge remote-tracking branch 'public/bug10169_024' into bug10169_025_v2Nick Mathewson
Conflicts: src/common/compat_libevent.h src/or/relay.c
2014-03-04Merge remote-tracking branch 'public/bug10169_023' into bug10169_024Nick Mathewson
Conflicts: src/or/relay.c
2014-02-26Monotonize the OOM-killer data timersNick Mathewson
In a couple of places, to implement the OOM-circuit-killer defense against sniper attacks, we have counters to remember the age of cells or data chunks. These timers were based on wall clock time, which can move backwards, thus giving roll-over results for our age calculation. This commit creates a low-budget monotonic time, based on ratcheting gettimeofday(), so that even in the event of a time rollback, we don't do anything _really_ stupid. A future version of Tor should update this function to do something even less stupid here, like employ clock_gettime() or its kin.
2014-02-12Start writing tests for 10169.Nick Mathewson
Now we cover more chunk allocation functions.
2014-02-12Debugging code inbuffers.c for debugging chunk allocation.Nick Mathewson
Currently on; will disable later in this branch.
2014-02-12Merge remote-tracking branch 'public/bug10169_024' into bug10169_025_v2Nick Mathewson
Conflicts: src/or/circuitlist.c
2014-02-12Merge remote-tracking branch 'public/bug10169_023' into bug10169_024Nick Mathewson
2014-02-12Actually release buffer freelists when handling OOM conditions.Nick Mathewson
Otherwise freeing buffers won't help for a little while.
2014-02-12Fix bugs in bug10169 bugfix memory trackingNick Mathewson
The chunk_grow() and chunk_copy() functions weren't adjusting the memory totals properly. Bugfix not on any released Tor version.
2014-01-03Merge remote-tracking branch 'public/bug10169_023' into bug10169_024Nick Mathewson
Conflicts: doc/tor.1.txt src/or/config.c src/or/or.h The conflicts were all pretty trivial.
2013-11-20Count freed buffer bytes from buffers when oom-killing circuits.Nick Mathewson
Also, aggressively clear the buffers to try to make their bytes go away fast rather than waiting for the close-marked-connection code to get 'em.
2013-11-15Have the OOM handler also count the age the data in a stream bufferNick Mathewson
2013-07-18Move Extended ORPort code to its own module.George Kadianakis
Move the code from the connection_or module to ext_orport. This commit only moves code: it shouldn't modify anything.
2013-07-18Document code and change the Extended ORPort command numbers.George Kadianakis
2013-07-18Skeleton ExtORPort implementation. Needs testing, documentation.Nick Mathewson
Does not implement TransportControlPort yet.
2013-07-10Completely refactor how FILENAME_PRIVATE worksNick Mathewson
We previously used FILENAME_PRIVATE identifiers mostly for identifiers exposed only to the unit tests... but also for identifiers exposed to the benchmarker, and sometimes for identifiers exposed to a similar module, and occasionally for no really good reason at all. Now, we use FILENAME_PRIVATE identifiers for identifiers shared by Tor and the unit tests. They should be defined static when we aren't building the unit test, and globally visible otherwise. (The STATIC macro will keep us honest here.) For identifiers used only by the unit tests and never by Tor at all, on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS. This is not the motivating use case for the split test/non-test build system; it's just a test example to see how it works, and to take a chance to clean up the code a little.
2013-05-15Fix socks5 handshake for username/password authRoger Dingledine
The fix for bug 8117 exposed this bug, and it turns out real-world applications like Pidgin do care. Bugfix on 0.2.3.2-alpha; fixes bug 8879.
2013-05-09Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4Nick Mathewson
2013-05-09Don't run off the end of the array-of-freelistsNick Mathewson
This is a fix for bug 8844, where eugenis correctly notes that there's a sentinel value at the end of the list-of-freelists that's never actually checked. It's a bug since the first version of the chunked buffer code back in 0.2.0.16-alpha. This would probably be a crash bug if it ever happens, but nobody's ever reported something like this, so I'm unsure whether it can occur. It would require write_to_buf, write_to_buf_zlib, read_to_buf, or read_to_buf_tls to get an input size of more than 32K. Still, it's a good idea to fix this kind of thing!
2013-04-11Merge remote-tracking branch 'public/bug8117_023' into maint-0.2.4Nick Mathewson
Conflicts: doc/tor.1.txt src/or/config.c src/or/connection.c
2013-03-20Per-SOCKSPort configuration for bug 8117 fix.Nick Mathewson
This might be necessary if the bug8117 fix confuses any applications. Also add a changes file.
2013-03-20Prefer SOCKS_USER_PASS over SOCKS_NO_AUTHNick Mathewson
2013-02-15Fix a bug that roger found in the wide_circ_id codeNick Mathewson
2013-02-15Merge remote-tracking branch 'public/wide_circ_ids'Nick Mathewson
Conflicts: src/or/channel.h src/or/connection_or.c src/or/cpuworker.c
2013-02-09Replace magic constants for wide_circ_ids with inline function callsNick Mathewson
2013-02-07Merge remote-tracking branch 'public/easy_ratelim'Nick Mathewson
Conflicts: src/or/connection.c
2013-02-01Rename log() to tor_log() for loggingNick Mathewson
This is meant to avoid conflict with the built-in log() function in math.h. It resolves ticket 7599. First reported by dhill. This was generated with the following perl script: #!/usr/bin/perl -w -i -p s/\blog\(LOG_(ERR|WARN|NOTICE|INFO|DEBUG)\s*,\s*/log_\L$1\(/g; s/\blog\(/tor_log\(/g;
2013-01-16Update the copyright date to 201.Nick Mathewson
2012-12-26Use log_fn_ratelim in a few places.Nick Mathewson
2012-11-14Move address map into its own file.Nick Mathewson
2012-11-08Merge remote-tracking branch 'origin/maint-0.2.3'Nick Mathewson
Conflicts: src/common/crypto.c src/or/rendservice.c
2012-11-08Add and use and unlikely-to-be-eliminated memwipe()Nick Mathewson
Apparently some compilers like to eliminate memset() operations on data that's about to go out-of-scope. I've gone with the safest possible replacement, which might be a bit slow. I don't think this is critical path in any way that will affect performance, but if it is, we can work on that in 0.2.4. Fixes bug 7352.
2012-11-06Allow a v4 link protocol for 4-byte circuit IDs.Nick Mathewson
Implements proposal 214. Needs testing.
2012-08-13Remove tor_malloc_roundup().Nick Mathewson
This function never actually did us any good, and it added a little complexity. See the changes file for more info.
2012-06-15Triage the XXX023 and XXX022 comments: postpone many.Nick Mathewson
2012-06-04Update copyright dates to 2012; add a few missing copyright statementsNick Mathewson
2012-06-04Add about 60 more DOCDOC comments to 0.2.3Nick Mathewson
Also, try to resolve some doxygen issues. First, define a magic "This is doxygen!" macro so that we take the correct branch in various #if/#else/#endifs in order to get the right documentation. Second, add in a few grouping @{ and @} entries in order to get some variables and fields to get grouped together.
2012-05-14MSVC build issue: we use INLINE as the one that will magically workNick Mathewson
2012-04-24Add a check_no_tls_errors() to read_to_buf_tlsArturo Filastò
Fixes bug #4528 "read_to_buf_tls(): Inconsistency in code". This check was added back in 0.1.0.3-rc, but somehow we forgot to leave it in when we refactored read_to_buf_tls in 0.1.0.5-rc. (patch by Arturo; commit message and changes file by nickm)
2012-01-31Use the standard _WIN32, not the Torism MS_WINDOWS or deprecated WIN32Nick Mathewson
This commit is completely mechanical; I used this perl script to make it: #!/usr/bin/perl -w -i.bak -p if (/^\s*\#/) { s/MS_WINDOWS/_WIN32/g; s/\bWIN32\b/_WIN32/g; }
2012-01-17Use SOCKET_OK macros in even more placesNick Mathewson
Add a TOR_INVALID_SOCKET macro to wrap -1/INVALID_SOCKET. Partial work for bug4533.
2011-12-15Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-12-15Merge remote-tracking branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson
2011-12-15Add a fix for the buf_pullup bug that Vektor reportedNick Mathewson
2011-10-11Fix a bunch of whitespace errorsNick Mathewson
2011-10-10Cell types and states for new OR handshakeNick Mathewson
Also, define all commands > 128 as variable-length when using v3 or later link protocol. Running into a var cell with an unrecognized type is no longer a bug.