[tor-bugs] #5324 [Tor Relay]: connection_handle_read_impl() has wrong function comment?
Tor Bug Tracker & Wiki
torproject-admin at torproject.org
Tue Mar 6 23:27:45 UTC 2012
#5324: connection_handle_read_impl() has wrong function comment?
-----------------------+----------------------------------------------------
Reporter: arma | Owner:
Type: defect | Status: new
Priority: normal | Milestone: Tor: 0.2.3.x-final
Component: Tor Relay | Version:
Keywords: | Parent:
Points: | Actualpoints:
-----------------------+----------------------------------------------------
Comment(by nickm):
Changing that code would indeed create the bug you mention.
Probably the best bet would be, if the connection is bandwidth blocked but
there is still pending data, stick it on a linked list of such
connections. Later, when its read bucket becomes nonempty, take it off
that list and treat it as if it had just become readable.
> (If I would have the new bug, is it hard to make libevent trigger the
callback when SSL_pending is true, or is this a rat's nest I would rather
avoid?)
It's a misuse of Libevent's "event" interface to have them look at
something besides the network. It would be a better use of bufferevents,
but bufferevents already handle this case. (They handle this in the same
way that Tor does, though.) The place to hack would probably be in
bufferevent_openssl.c, but that would only affect bufferevent builds.
You could also do this by using filtering bufferevents (which I *think*
we've got the bugs out of at this point, mostly-sorta?); in that case, the
underlying transport does not read more than its buckets allow it to read.
You could also manually trigger events yourself, but the timing and
circumstances for that are weird enough that I think you'd be better off
looking at my linked list idea above.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/5324#comment:3>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list