Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-96

TSocket.peek fails on FreeBSD

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • C++ - Library
    • None
    • FreeBSD

    • Patch Available

    Description

      POSIX says what recv(2) should returns 0 if peer has performed a shutdown. This feature uses in TBufferedTransport

        bool peek() {
          if (rBase_ == rBound_) {
            setReadBuffer(rBuf_.get(), transport_->read(rBuf_.get(), rBufSize_));
          }
          return (rBound_ > rBase_);
        }
      

      The decision works fine on linux, but fails on freebsd. In freebsd, recv returns -1 and errno==ECONNRESET.

      Attachments

        1. thrift-freebsd-read.patch
          0.7 kB
          Alexander Shigin
        2. thrift-peek-fix.patch
          9 kB
          Alexander Shigin
        3. thrift-peek-fix.patch
          7 kB
          Alexander Shigin
        4. thrift-peek-fix-2.patch
          9 kB
          Alexander Shigin

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            shigin Alexander Shigin
            shigin Alexander Shigin
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment