[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #21654 [Core Tor/Tor]: Don't use fgets() when we might get EAGAIN



#21654: Don't use fgets() when we might get EAGAIN
--------------------------+----------------------------------
 Reporter:  nickm         |          Owner:  ahf
     Type:  defect        |         Status:  needs_review
 Priority:  Medium        |      Milestone:  Tor: unspecified
Component:  Core Tor/Tor  |        Version:
 Severity:  Normal        |     Resolution:
 Keywords:                |  Actual Points:
Parent ID:                |         Points:
 Reviewer:                |        Sponsor:
--------------------------+----------------------------------

Comment (by nickm):

 Hm.  I wonder if we should propagate this switch from FILE to fileno even
 higher in the read_all_handle code.  That is, on anything where we call
 tor_read_all_handle, we shouldn't be using fgets() at all: It's not safe
 to mix buffered IO (like FILE) does and non-buffered IO.

 Alternatively, for an easier alternative, we can try turning off buffering
 on these particular FILEs.  I forget how to do that.  setvbuf?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/21654#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs