Commit Graph

7876 Commits

Author SHA1 Message Date
George Kadianakis
c554a27a44 Clarify the heartbeat message a bit. 2011-08-27 18:45:54 +02:00
Nick Mathewson
81fe1934af Fix a bufferevent-related bug that killed tunneled dirserv conns
Because tunneled connections are implemented with buffervent_pair,
writing to them can cause an immediate flush.  This means that
added to them and then checking to see whether their outbuf is
empty is _not_ an adequate way to see whether you added anything.
This caused a problem in directory server connections, since they
would try spooling a little more data out, and then close the
connection if there was no queued data to send.

This fix should improve matters; it only closes the connection if
there is no more data to spool, and all of the spooling callbacks
are supposed to put the dirconn into dir_spool_none on completion.

This is bug 3814; Sebastian found it; bugfix on 0.2.3.1-alpha.
2011-08-26 16:10:17 -04:00
Nick Mathewson
dfcd3d9ce0 Set write low-watermarks on all bufferevents.
If we don't do this, then we never invoke the bufferevent write
callbacks until all the bufferevent's data is flushed.
2011-08-24 17:31:37 -04:00
Nick Mathewson
59d0f750c9 Apply rate-limiting to the lowest bufferevent in the stack.
When we're doing filtering ssl bufferevents, we want the rate-limits
to apply to the lowest level of the bufferevent stack, so that we're
actually limiting bytes sent on the network. Otherwise, we'll read
from the network aggressively, and only limit stuff as we process it.
2011-08-24 17:31:32 -04:00
Nick Mathewson
dd6a9a923d Disable run-time changes to DisableIOCP: They do not work 2011-08-19 17:07:54 -04:00
Nick Mathewson
df96aed14f Remove warning about a loop parsing evbuffer socks
This behavior is normal when we want more data than the evbuffer
actually has for us.  We'll ask for (say) 7 bytes, get only 5
(because that's all there is), try to parse the 5 bytes, and get
told "no, I want 7".  One option would be to bail out early whenever
want_length is > buflen, but sometimes we use an over-large
want_length.  So instead, let's just remove the warning here: it's
not a bug after all.
2011-08-18 16:15:03 -04:00
Nick Mathewson
263d68aa82 Appease "make check-spaces" 2011-08-18 15:17:37 -04:00
Nick Mathewson
d2cd67c83f Use evbuffer_copyout() in inspect_evbuffer(). 2011-08-17 13:09:05 -04:00
Nick Mathewson
06be6105e4 Merge remote-tracking branch 'origin/maint-0.2.2'
Conflicts:
	src/or/config.c
2011-08-17 12:00:44 -04:00
Nick Mathewson
d79d648edc Don't write ControlPorts to disk till after we setuid and make datadir
Fix for bug 3747; bugfix on 0.2.2.26-beta.
2011-08-17 11:22:16 -04:00
Nick Mathewson
14552a12b3 Merge branch 'bug3743' 2011-08-17 10:46:28 -04:00
Nick Mathewson
6650dc932a Remove a needless config_find_option 2011-08-17 10:46:22 -04:00
Sebastian Hahn
6a06f45b04 Actually pick a random port when "auto" is specified
ddc65e2b33 had broken this
2011-08-17 10:41:36 -04:00
Kamran Riaz Khan
e6e804848c Don't compare LINELIST_S and OBSOLETE config options. 2011-08-16 06:28:38 +05:00
Nick Mathewson
2dc40b9c49 Merge remote-tracking branch 'asn/bug3728' 2011-08-15 11:06:50 -04:00
Nick Mathewson
aeb27526f8 Merge remote-tracking branch 'origin/maint-0.2.2' 2011-08-15 10:54:55 -04:00
Robert Ransom
03f6ee8c5f Remove extra quotation marks around the result of esc_for_log 2011-08-15 10:54:19 -04:00
Nick Mathewson
0ddc8de0b6 Oops; _actually_ enable microdesc-by-default for clients
It turns out that it wasn't enough to set the configuration to
"auto", since the correct behavior for "auto" had been disabled in
microdesc.c.   :p

(Hasn't been in a release yet, so doesn't need a changes entry.)
2011-08-15 10:52:23 -04:00
George Kadianakis
ec8d0a6d83 Free global_rate_limit in connection_free_all(). 2011-08-13 20:37:13 +02:00
George Kadianakis
a5fd07d178 Move connection_free_all() to the bottom of connection.c to enjoy maximum visibility. 2011-08-13 20:29:22 +02:00
Nick Mathewson
5da9f722f2 Whitespace tweaks 2011-08-10 15:06:45 -04:00
Nick Mathewson
5252c9434f Fix a const warning in bug1692 code 2011-08-10 15:06:11 -04:00
Nick Mathewson
b76f46c6d8 Merge branch 'bug1692-squashed' 2011-08-10 15:04:36 -04:00
Kamran Riaz Khan
02a735dfa8 Fix condition reported by nickm. 2011-08-10 15:03:25 -04:00
Kamran Riaz Khan
73f07c558b Return if CONF_CHANGED isn't interesting. 2011-08-10 15:03:25 -04:00
Kamran Riaz Khan
643913de75 Escape configuration values before sending them via CONF_CHANGED. 2011-08-10 15:03:24 -04:00
Kamran Riaz Khan
86f68ed695 Use smartlist_asprintf_add() to improve readability. 2011-08-10 15:03:24 -04:00
Nick Mathewson
333df6006d Make FooPort 0 correctly disable the FooPort.
Since the prop171 stuff, it had instead made Tor bind port 0, and
re-bind it differently all the time.

Resolves bug3704; not in any released version.
2011-08-09 14:52:22 -04:00
Sebastian Hahn
7c340a97b1 Sticking a size_t into long generates a warn on win 2011-08-09 11:34:21 +02:00
Kamran Riaz Khan
5f624805e7 Minor code readability fix. 2011-08-09 03:17:21 +05:00
Kamran Riaz Khan
23ef12462a Minor comment fix. 2011-08-08 19:58:43 +05:00
Kamran Riaz Khan
02c62b2966 Refactor to do CONF_CHANGED event formatting inside control.c 2011-08-08 19:19:06 +05:00
Nick Mathewson
a72b1815e8 Merge remote-tracking branch 'public/bug3550' 2011-08-08 10:05:41 -04:00
Robert Ransom
cb24a06a3e Remove connection_edge_streams_are_compatible
It's dead code (not used anywhere by the current proposal 171 algorithm).
2011-08-08 09:43:16 -04:00
Robert Ransom
cab3641638 Fix handling of ISO_STREAM
Now we track *which* stream with ISO_STREAM set is associated to a
particular circuit, so that we won't think that stream is incompatible
with its circuit and launch another one a second later, and we use that
same field to mark circuits which have had an ISO_STREAM stream attached
to them, so that we won't ever put a second stream on that circuit.

Fixes bug 3695.
2011-08-08 09:42:48 -04:00
Kamran Riaz Khan
5a801a8c8b Emits CONF_CHANGED events whenever Tor's configuration values change. 2011-08-08 04:38:53 +05:00
Robert Ransom
52421e9101 Fix log message typo 2011-08-06 00:25:07 -07:00
Nick Mathewson
ce87887461 Merge remote-tracking branch 'public/bug3683' 2011-08-05 20:21:27 -04:00
Nick Mathewson
413574ad38 Clear socks auth fields before free 2011-08-05 19:07:33 -04:00
Nick Mathewson
e511a3a4dd Handle storing much longer socks4 authentication data. 2011-08-05 18:56:30 -04:00
Karsten Loesing
d690a99dfe Clean up bridge-stats code.
Only write a bridge-stats string if bridge stats have been
initialized.  This behavior is similar to dirreq-stats, entry-stats,
etc.

Also add a few unit tests for the bridge-stats code.
2011-08-04 21:18:19 +02:00
Karsten Loesing
88083463cb Separate generation of an entry-stats string from writing it to disk.
This commit is similar to the previous two commits for dirreq-stats,
but for entry-stats.
2011-08-04 21:18:19 +02:00
Karsten Loesing
2174fc0ba0 Separate generation of a dirreq-stats string from writing it to disk.
This patch separates the generation of a dirreq-stats string from
actually writing it to disk.  The new geoip_format_dirreq_stats()
generates a dirreq-stats string that geoip_dirreq_stats_write() writes
to disk.  All the state changing (e.g., resetting the dirreq-stats
history and initializing the next measurement interval) takes place in
geoip_dirreq_stats_write().  That allows us to finally test the
dirreq-stats code better.
2011-08-04 21:18:19 +02:00
Karsten Loesing
abeaabba00 Clean up geoip_dirreq_stats_write().
We later want to split this function into one function that generates
the dirreq-stats string and one that writes it to disk.
2011-08-04 21:18:19 +02:00
Karsten Loesing
3d3ed853e7 Add unit tests for buffer-stats.
Now that formatting the buffer-stats string is separate from writing
it to disk, we can also decouple the logic to extract stats from
circuits and finally write some unit tests for the history code.
2011-08-04 21:18:18 +02:00
Karsten Loesing
07dc46e7fc Separate generation of a buffer-stats string from writing it to disk.
The new rep_hist_format_buffer_stats() generates a buffer-stats string
that rep_hist_buffer_stats_write() writes to disk.  All the state
changing (e.g., resetting the buffer-stats history and initializing
the next measurement interval) takes place in
rep_hist_buffer_stats_write().  That allows us to finally test the
buffer-stats code better.
2011-08-04 21:18:18 +02:00
Karsten Loesing
95ebd01e62 Clean up rep_hist_buffer_stats_write().
We later want to split this function into one function that generates
the buffer-stats string and one that writes it to disk.
2011-08-04 21:18:13 +02:00
Karsten Loesing
8f4e5fa2b5 Create cell-stats history even if we didn't see a single circuit.
So far, if we didn't see a single circuit, we refrained from
generating a cell-stats string and logged a warning.  Nobody will
notice the warning, and people will wonder why there's no cell-stats
string in the extra-info descriptor.  The better behavior is to
generate a cell-stats string with all zeros.
2011-08-04 21:04:44 +02:00
Karsten Loesing
a6a127c833 Replace files in stats/ rather than appending to them.
Right now, we append statistics to files in the stats/ directory for
half of the statistics, whereas we overwrite these files for the other
half. In particular, we append buffer, dirreq, and entry stats and
overwrite exit, connection, and bridge stats.

Appending to files was useful when we didn't include stats in extra-info
descriptors, because otherwise we'd have to copy them away to prevent
Tor from overwriting them.

But now that we include statistics in extra-info descriptors, it makes
no sense to keep the old statistics forever. We should change the
behavior to overwriting instead of appending for all statistics.

Implements #2930.
2011-08-04 20:57:29 +02:00
Nick Mathewson
e5e7b6d718 Make --quiet and --hush apply to default logs, not only initial logs
Fixes bug 3550; bugfix on 0.2.0.10-alpha (where --quiet was introduced).
2011-08-04 14:23:51 -04:00