[tor-bugs] #9659 [Tor Browser]: Optimistic Data SOCKS variant (patch for #3875) leads to loop on HTTP requests if no SOCKS response yet

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Sep 19 15:01:54 UTC 2015


#9659: Optimistic Data SOCKS variant (patch for #3875) leads to loop on HTTP
requests if no SOCKS response yet
-------------------------+-------------------------------------------------
     Reporter:           |      Owner:  tbb-team
  cypherpunks            |     Status:  needs_review
         Type:  defect   |  Milestone:
     Priority:  normal   |    Version:
    Component:  Tor      |   Keywords:  tbb-usability, tbb-crash-hang, tbb-
  Browser                |  firefox-patch
   Resolution:           |  Parent ID:
Actual Points:           |
       Points:           |
-------------------------+-------------------------------------------------
Changes (by cypherpunks):

 * priority:  major => normal
 * status:  new => needs_review


Comment:

 {{{
 --- nsSocketTransport2.cpp.orig
 +++ nsSocketTransport2.cpp
 @@ -1868,10 +1868,18 @@
              // If the connect is still not ready, then continue
 polling...
              //
              if ((PR_WOULD_BLOCK_ERROR == code) || (PR_IN_PROGRESS_ERROR
 == code)) {
 -                // Set up the select flags for connect...
 -                mPollFlags = (PR_POLL_EXCEPT | PR_POLL_WRITE);
 -                // Update poll timeout in case it was changed
 -                mPollTimeout = mTimeouts[TIMEOUT_CONNECT];
 +                if (mState == STATE_SENTGET) { // stuff sent, nothing to
 write
 +                    // Set up the select flags for response reading...
 +                    mPollFlags = (PR_POLL_EXCEPT | PR_POLL_READ);
 +                    // Update poll timeout in case it was changed
 +                    mPollTimeout = mTimeouts[TIMEOUT_READ_WRITE];
 +                }
 +                else {
 +                    // Set up the select flags for connect...
 +                    mPollFlags = (PR_POLL_EXCEPT | PR_POLL_WRITE);
 +                    // Update poll timeout in case it was changed
 +                    mPollTimeout = mTimeouts[TIMEOUT_CONNECT];
 +                }
              }
              //
              // The SOCKS proxy rejected our request. Find out why.
 }}}
 What do you think?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/9659#comment:19>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list