aboutsummaryrefslogtreecommitdiff
path: root/src/common
AgeCommit message (Collapse)Author
2011-09-01Fix double-closing a stdio streamSteven Murdoch
After a stream reached eof, we fclose it, but then test_util_spawn_background_partial_read() reads from it again, which causes an error and thus another fclose(). Some platforms are fine with this, others (e.g. debian-sid-i386) trigger a double-free() error. The actual code used by Tor (log_from_pipe() and tor_check_port_forwarding()) handle this case correctly.
2011-08-31Tweaks on last process-launch patchesNick Mathewson
2011-09-01Make a version of tor_read_all_handle() for non-Windows platformsSteven Murdoch
Mainly used for testing reading from subprocesses. To be more generic we now pass in a pointer to a process_handle_t rather than a Windows- specific HANDLE.
2011-08-31Add a missing include to util.c to get waitpid() on LinuxNick Mathewson
2011-08-30Rename tor_join_cmdline to tor_join_win_cmdline; tweak doxygenNick Mathewson
2011-08-30Merge remote-tracking branch 'sjmurdoch/bug2046'Nick Mathewson
2011-08-30Document limitation of log_from_handle with partial readsSteven Murdoch
2011-08-30Factor out and re-write code for splitting lines from a handleSteven Murdoch
Now handles non-printable characters and will not output a spurious new-line if given a partial line.
2011-08-29Refactor out command line formattingSteven Murdoch
Now correctly handles whitespace, quotes and backslashes. Passes all unit tests.
2011-08-29Add a sanity checkSteven Murdoch
2011-08-29Replace two magic tristates with #define'd namesSteven Murdoch
- process_handle_t.status - return value of tor_get_exit_code()
2011-08-28Make signature of tor_spawn_background more conventionalSteven Murdoch
Conventionally in Tor, structs are returned as pointers, so change tor_spawn_background() to return the process handle in a pointer rather than as return value.
2011-08-24Add write watermarks to filtered bufferevents.Nick Mathewson
2011-08-24Apply rate-limiting to the lowest bufferevent in the stack.Nick Mathewson
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-24Appease "make check-spaces"Steven Murdoch
2011-08-24Improve comments and fix one bugSteven Murdoch
2011-08-24We don't need to find our own path, just tell Windows to searchSteven Murdoch
2011-08-24Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-08-24lround() missing in MSVCGisle Vanem
lround() is missing in MS Visual-C's <math.h>. Not available anywhere. Here is an easy patch.
2011-08-23Fix compilation errors under *nixSteven Murdoch
2011-08-22Tidy up subprocess codeSteven Murdoch
- Better error handling - Write description of functions - Don't assume non-negative process return values
2011-08-22Fix some compiler warningsSteven Murdoch
2011-08-22Merge branch 'bug1983-port-tor-fw-helper-to-windows' into bug2046Steven Murdoch
Conflicts: configure.in src/tools/tor-fw-helper/Makefile.am src/tools/tor-fw-helper/tor-fw-helper-upnp.c src/tools/tor-fw-helper/tor-fw-helper.c
2011-08-18Automatically use filtering bufferevents with IOCP.Nick Mathewson
2011-08-18Merge remote branch 'origin/master' into bug2046Steven Murdoch
2011-08-18Complete logging of output from port forwarding helperSteven Murdoch
2011-08-17Call evthread_use_windows_threads when running with IOCP on windowsNick Mathewson
2011-08-17Actually pick a random port when "auto" is specifiedSebastian Hahn
ddc65e2b3303559ab7b842a176ee6c2eda9e4027 had broken this
2011-08-11Don't warn on http connection to my orportSebastian Hahn
Also remove a few other related warnings that could occur during the ssl handshake. We do this because the relay operator can't do anything about them, and they aren't their fault.
2011-08-10Merge branch 'bug1692-squashed'Nick Mathewson
2011-08-10Add smartlist_[v]asprintf_addRobert Ransom
I should have added this before implementing #2411.
2011-08-09Get rid of an unused parameter warning on winSebastian Hahn
2011-08-09Sockets are unsigned on windowsSebastian Hahn
this gets rid of a warning about signed/unsigned comparison
2011-08-01Initial patch to build Tor with msvc and nmakeNick Mathewson
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-07-25Test case for reading the partial output of a background processSteven Murdoch
2011-07-23Fix compilation on non-Windows platformsSteven Murdoch
2011-07-23If hProcess is NULL, read_all_handle returns if it would blockSteven Murdoch
2011-07-22Use PeekNamedPipe to avoid blocking ReadFile when there is nothing to readSteven Murdoch
2011-07-22Add code to read all from a handle, but this block foreverSteven Murdoch
See http://stackoverflow.com/questions/3722409/windows-child-process-with-redirected-input-and-output for a potential solution
2011-07-21Add Windows version of tor_spawn_background and ancillary functionsSteven Murdoch
2011-07-21Generalize process spawning so its test compiles (but fails) in WindowsSteven Murdoch
- 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-20Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-07-20Check return value in fmt_addrNick Mathewson
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-19Turn streq_opt into a generic strcmp_opt.Nick Mathewson
2011-07-19Implement stream isolationNick Mathewson
This is the meat of proposal 171: we change circuit_is_acceptable() to require that the connection is compatible with every connection that has been linked to the circuit; we update circuit_is_better to prefer attaching streams to circuits in the way that decreases the circuits' usefulness the least; and we update link_apconn_to_circ() to do the appropriate bookkeeping.
2011-07-15Make WIN32_WINNT defines conditionalNick Mathewson
Requested by Gisle Vanem on tor-dev. I'm not quite sure this is the right solution, but it's probably harmless.
2011-07-11Document feature3116 fns and improve outputNick Mathewson
- We were reporting the _bottom_ N failing states, not the top N. - With bufferevents enabled, we logged all TLS states as being "in bufferevent", which isn't actually informative. - When we had nothing to report, we reported nothing too loudly. - Also, we needed documentation.
2011-07-11Record the states of failing OR connectionsNick Mathewson
This code lets us record the state of any outgoing OR connection that fails before it becomes open, so we can notice if they're all dying in the same SSL state or the same OR handshake state. More work is still needed: - We need documentation - We need to actually call the code that reports the failure when we realize that we're having a hard time connecting out or making circuits. - We need to periodically clear out all this data -- perhaps, whenever we build a circuit successfully? - We'll eventually want to expose it to controllers, perhaps. Partial implementation of feature 3116.
2011-07-01Merge branch 'cov217_master'Nick Mathewson
2011-07-01Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson