[tor-bugs] #16355 [Torsocks]: [PATCH] Add usleep to data_impl functions
Tor Bug Tracker & Wiki
blackhole at torproject.org
Wed Jun 24 02:43:30 UTC 2015
#16355: [PATCH] Add usleep to data_impl functions
-----------------------------+-------------------------------------
Reporter: cypherpunks | Owner: dgoulet
Type: enhancement | Status: new
Priority: trivial | Milestone:
Component: Torsocks | Version:
Resolution: | Keywords: torsocks cpu spike hang
Actual Points: | Parent ID:
Points: |
-----------------------------+-------------------------------------
Comment (by cypherpunks):
Here's a patch set to make send/recv_data_impl block rather than busy wait
in the EAGAIN/EWOULDBLOCK case. It also makes them returns EIO, rather
than whatever error code 1 is, in the case of a short read before EOF.
If there is a concern the file descriptor numbers may be arbitrarily high
here, it could be changed to use poll instead of select. I choose select
by default in portable code because poll is known to be broken on certain
platforms, particularly OS X -- although in this case, the file descriptor
may always be a socket, in which case OS X poll is not broken.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/16355#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list