summaryrefslogtreecommitdiff
path: root/src/or
AgeCommit message (Collapse)Author
2011-07-11Disable recording new broken conns when we have bootstrappedNick Mathewson
Rationale: right now there seems to be no way for our bootstrap status to dip under 100% once it has reached 100%. Thus, recording broken connections after that point is useless, and wastes memory. If at some point in the future we allow our bootstrap level to go backwards, then we should change this rule so that we disable recording broken connection states _as long as_ the bootstrap status is 100%.
2011-07-11Clear broken connection map on successful bootstrapNick Mathewson
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-11Report the states of failed TLS connections from bootstrap_problemNick Mathewson
2011-07-11Limit the number of different handshake reasons to reportNick Mathewson
If connections failed in more than 10 different states, let's just report the top ten states.
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-11Make a function staticNick Mathewson
Now that connection_dir_about_to_close() is in directory.c, there's no reason to expose connection_dir_request_failed().
2011-07-11Split connection_about_to_close_connection into separate functionsNick Mathewson
This patch does NOTHING but: - move code - add declarations and includes as needed to make the new code work - declare the new functions.
2011-07-11Fix compilation from 2841 branchNick Mathewson
2011-07-11Merge remote-tracking branch 'public/bug2841'Nick Mathewson
Conflicts: src/or/config.c
2011-07-11Look at the right consensus in router_add_to_routerlist()Nick Mathewson
Just looking at the "latest" consensus could give us a microdesc consensus, if microdescs were enabled. That would make us decide that every routerdesc was unlisted in the latest consensus and drop them all: Ouch. Fixes bug 3113; bugfix on 0.2.3.1-alpha.
2011-07-11Merge branch 'bug2797'Nick Mathewson
2011-07-08Remove a redundant condition in compare_addr_to_node_policyNick Mathewson
A && A == A. Found by frosty_un
2011-07-07Make nodelist_purge avoid orphaned microdescs in rs-less nodesNick Mathewson
We have an invariant that a node_t should have an md only if it has a routerstatus. nodelist_purge tried to preserve this by removing all nodes without a routerstatus or a routerinfo. But this left nodes with a routerinfo and a microdesc untouched, even if they had a routerstatus. Bug found by frosty_un.
2011-07-07Kill redundant checks around routerset_contains_*()Nick Mathewson
All of the routerset_contains*() functions return 0 if their routerset_t argument is NULL. Therefore, there's no point in doing "if (ExcludeNodes && routerset_contains*(ExcludeNodes...))", for example. This patch fixes every instance of if (X && routerstatus_contains*(X,...)) Note that there are other patterns that _aren't_ redundant. For example, we *don't* want to change: if (EntryNodes && !routerstatus_contains(EntryNodes,...)) Fixes #2797. No bug here; just needless code.
2011-07-07Merge remote-tracking branch 'public/bug3153'Nick Mathewson
Conflicts: src/or/nodelist.c
2011-07-07Merge branch 'bug3263'Nick Mathewson
2011-07-07Have transitions in public_server_mode count as affects_descriptorNick Mathewson
Previously, we'd get a new descriptor for free when public_server_mode() changed, since it would count as affects_workers, which would call init_keys(), which would make us regenerate a new descriptor. But now that we fixed bug 3263, init_keys() is no longer necessarily a new descriptor, and so we need to make sure that public_server_mode() counts as a descriptor transition.
2011-07-07Remove unused var in write_to_evbuffer_zlibNick Mathewson
2011-07-07Avoid double-free in bufferevent read/write cbsNick Mathewson
Fixes bug 3404; bugfix on 0.2.3.1-alpha.
2011-07-07Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-07-07Correctly send a SUCCEEDED event for rdns requestsSebastian Hahn
The issue was that we overlooked the possibility of reverse DNS success at the end of connection_ap_handshake_socks_resolved(). Issue discovered by katmagic, thanks!
2011-07-06Merge branch 'maint-0.2.2'Roger Dingledine
2011-07-06appease check-spacesRoger Dingledine
2011-07-05Merge remote-tracking branch 'rransom-tor/bug3465-023-v2'Nick Mathewson
2011-07-05Merge remote-tracking branch 'rransom-tor/bug3465-022' into maint-0.2.2Nick Mathewson
2011-07-03Refactor the interfaces of transport/proxy lookup fnsNick Mathewson
Returning a tristate is needless here; we can just use the yielded transport/proxy_type field to tell whether there's a proxy, and have the return indicate success/failure. Also, store the proxy_type in the or_connection_t rather than letting it get out of sync if a configuration reload happens between launching the or_connection and deciding what to say with it.
2011-07-03Future-proof and user-proof parse_bridge_lineNick Mathewson
2011-07-02Simplify parse_client_transport_lineNick Mathewson
2011-07-02Style and grammar tweaks on 2841 branchNick Mathewson
2011-07-02Small tweaks to 2841 codeNick Mathewson
- const-ify some transport_t pointers - Remove a vestigial argument to parse_bridge_line - Make it compile without warnings on my laptop with --enable-gcc-warnings
2011-07-01Merge branch 'cov217_master'Nick Mathewson
2011-07-01Merge remote-tracking branch 'origin/maint-0.2.2'Nick Mathewson
2011-07-01Merge branch 'cov217_022_squashed' into maint-0.2.2Nick Mathewson
2011-07-01Use strlcpy when copying node IDs into measured_bw_line_tNick Mathewson
We were using strncpy before, which isn't our style for stuff like this. This isn't a bug, though: before calling strncpy, we were checking that strlen(src) was indeed == HEX_DIGEST_LEN, which is less than sizeof(dst), so there was no way we could fail to NUL-terminate. Still, strncpy(a,b,sizeof(a)) is an idiom that we ought to squash everyplace. Fixes CID #427.
2011-07-01Merge remote-tracking branch 'origin/maint-0.2.1' into maint-0.2.2Nick Mathewson
2011-07-01Use strlcpy in create_unix_sockaddr()Nick Mathewson
Using strncpy meant that if listenaddress were ever >= sizeof(sockaddr_un.sun_path), we would fail to nul-terminate sun_path. This isn't a big deal: we never read sun_path, and the kernel is smart enough to reject the sockaddr_un if it isn't nul-terminated. Nonetheless, it's a dumb failure mode. Instead, we should reject addresses that don't fit in sockaddr_un.sun_path. Coverity found this; it's CID 428. Bugfix on 0.2.0.3-alpha.
2011-07-01Fix a rare memory leak in rend_cache_storeNick Mathewson
When we rejected a descriptor for not being the one we wanted, we were letting the parsed descriptor go out of scope. Found by Coverity; CID # 30. Bugfix on 0.2.1.26. (No changes file yet, since this is not in any 0.2.1.x release.)
2011-07-01Defensive programming: don't crash with broken node_tNick Mathewson
Every node_t has either a routerinfo_t or a routerstatus_t, so every node_t *should* have a nickname. Nonetheless, let's make sure in hex_digest_nickname_matches(). Should quiet CID 434.
2011-07-01Don't shadow parameters with local variablesNick Mathewson
This is a little error-prone when the local has a different type from the parameter, and is very error-prone with both have the same type. Let's not do this. Fixes CID #437,438,439,440,441.
2011-07-01Replace 4 more sscanf()s with tor_sscanf()Nick Mathewson
For some inexplicable reason, Coverity departs from its usual standards of avoiding false positives here, and warns about all sscanf usage, even when the formatting strings are totally safe. Addresses CID # 447, 446.
2011-07-01Replace a "const const" with a "const"Nick Mathewson
Looks like this squeaked in while I was doing a search-and-replace to constify things. Coverity CID 483.
2011-06-28Trivial code tweaks and documentation updates.George Kadianakis
2011-06-25Make handle_control_setevents table-drivenRobert Ransom
2011-06-25Merge branch 'bug3465-022' into bug3465-023Robert Ransom
* bug3465-022: Add BUILDTIMEOUT_SET to the result of GETINFO events/names Correct a comment Fix minor comment issues
2011-06-25Add BUILDTIMEOUT_SET to the result of GETINFO events/namesRobert Ransom
2011-06-24Correct a commentRobert Ransom
2011-06-24Merge remote-tracking branch 'rransom-tor/bug3456'Nick Mathewson
2011-06-24Correct terminology in commentRobert Ransom
2011-06-24Store cpath_build_state_t flags in one-bit bitfields, not intsRobert Ransom