Commit Graph

14006 Commits

Author SHA1 Message Date
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
Nick Mathewson
8054e81e14 Treat socks_request->{username,password} as non-NUL-terminated
They *are* non-NUL-terminated, after all (and they have to be, since
the SOCKS5 spec allows them to contain embedded NULs.  But the code
to implement proposal 171 was copying them with tor_strdup and
comparing them with strcmp_opt.

Fix for bug on 3683; bug not present in any yet-released version.
2011-08-04 12:03:31 -04:00
Nick Mathewson
6596aa022f Implement protocol-type isolation correctly.
Previously we'd just looked at the connection type, but that's
always CONN_TYPE_AP.  Instead, we should be looking at the type of
the listener that created the connection.

Spotted by rransom; fixes bug 3636.
2011-08-02 10:48:39 -04:00
Roger Dingledine
478785a762 put the 0.2.1.30 stanza in the master changelog too 2011-08-01 16:14:17 -04:00
Roger Dingledine
843796495b reach back in time and correct two changelog entries 2011-08-01 15:53:13 -04:00
Nick Mathewson
e802199cb3 Initial patch to build Tor with msvc and nmake
We'll still need to tweak it so that it looks for includes and
libraries somewhere more sensible than "where we happened to find
them on Erinn's system"; so that tests and tools get built too;
so that it's a bit documented; and so that we actually try running
the output.

Work done with Erinn Clark.
2011-08-01 12:36:59 -04:00
Nick Mathewson
9d77f24cf5 Re-order tor_fw_helper_LDADD flags so that they work
Patch from "blueness".
2011-08-01 11:05:49 -04:00
Steven Murdoch
5bf9890b3b Test case for reading the partial output of a background process 2011-07-25 04:08:08 +01:00
Steven Murdoch
99baa7e45c Fix compilation on non-Windows platforms 2011-07-23 23:49:30 +01:00
Steven Murdoch
c5796a8fb2 If hProcess is NULL, read_all_handle returns if it would block 2011-07-23 21:35:50 +01:00
Steven Murdoch
2d5059e08e Use PeekNamedPipe to avoid blocking ReadFile when there is nothing to read 2011-07-22 21:12:00 +01:00
Steven Murdoch
55a1cb53d6 Add code to read all from a handle, but this block forever
See http://stackoverflow.com/questions/3722409/windows-child-process-with-redirected-input-and-output
for a potential solution
2011-07-22 15:57:56 +01:00
Steven Murdoch
fec902dd60 Add Windows version of tor_spawn_background and ancillary functions 2011-07-21 19:26:19 +01:00
Steven Murdoch
35c89be02b Generalize process spawning so its test compiles (but fails) in Windows
- pid, stdout/stderr_pipe now encapsulated in process_handle
- read_all replaced by tor_read_all_from_process_stdin/stderr
- waitpid replaced by tor_get_exit_code

Untested on *nix
2011-07-21 16:34:48 +01:00
Nick Mathewson
569fe936b8 Move entry-only fields from edge_connection_t to entry_connection_t
Also, refactor the code accordingly.
2011-07-21 11:15:25 -04:00
Nick Mathewson
33e6a3d750 Add a new type entry_connection_t for entry connections
No fields have moved there yet; for now, it's just a placeholder type.
2011-07-21 10:39:59 -04:00
Ian Goldberg
a2bd0397ff Improve log messages for optimistic data retry 2011-07-21 09:49:00 -04:00
Steven Murdoch
2002d4acdf Under Windows, call WSAStartup before using the network 2011-07-21 14:14:57 +01:00
Steven Murdoch
8db98c13b5 XXX Link in libiphlpapi (should be disabled on non Win32 platforms) 2011-07-21 13:47:58 +01:00
Steven Murdoch
0ea28ccea0 XXX Use static linking on Windows because miniupnpc doesn't work as DLL 2011-07-21 13:47:16 +01:00
Nick Mathewson
2f0fadbe8b Add src/test/test{-child}.exe to gitignore. bug3626 2011-07-21 08:40:25 -04:00
Steven Murdoch
2eca016594 XXX Hack to allow tor-fw-helper to be built on Windows
For some reason, --with-libminiupnpc-dir doesn't work on Windows, so this
hardcodes /local/lib as the path in which libminiupnpc.a can be found.
Also, libminiupnpc needs libws2_32 and libiphlpapi under Windows, so this
hardcodes these libraries when building the ./configure test program.
These changes almost certainly break *nix, so should be fixed before merge.
2011-07-21 13:09:50 +01:00
Roger Dingledine
d017cd67ff remember our future plan for bug 3617
(that is, to change the default for "UseOptimisticData auto" to
1 once we are more convinced that it works correctly.)
2011-07-21 00:34:58 -04:00
Nick Mathewson
2c98104c74 Add another precondition for isolation-clearing; fix 3620 2011-07-20 20:27:36 -04:00
Nick Mathewson
5df99cec98 Do not cannibalize a circuit with isolation values set. 2011-07-20 14:40:47 -04:00
Nick Mathewson
cd3709a2b0 For accuracy, s/exit_allows_optimistic_data/may_use_optimistic_data/ 2011-07-20 14:14:21 -04:00
Nick Mathewson
6e923ed8cd Add an OptimisticData option to control client-side optimistic data 2011-07-20 14:14:21 -04:00
Sebastian Hahn
9b0d3719ae Don't assert for listener connections 2011-07-20 19:42:11 +02:00
Nick Mathewson
e05ddf3e18 Check for port config before addr config in client port options
Otherwise, we'll fail, since "9050" looks like a perfectly fine address.
2011-07-20 13:40:09 -04:00
Nick Mathewson
6fa99ab32f Oops: we need to call parse_client_ports with validate_only==0 at least once 2011-07-20 13:35:02 -04:00
Nick Mathewson
1d7beea2ab Merge remote-tracking branch 'origin/maint-0.2.2' 2011-07-20 13:17:59 -04:00
Nick Mathewson
718252b253 Check return value in fmt_addr
Previously, if tor_addr_to_str() returned NULL, we would reuse the
last value returned by fmt_addr().  (This could happen if we were
erroneously asked to format an AF_UNSPEC address.)  Now instead we
return "???".
2011-07-20 13:17:48 -04:00
Nick Mathewson
2a6d12c7ad Fix a warning message. (Found by rransom) 2011-07-20 13:15:04 -04:00