[
https://issues.apache.org/jira/browse/THRIFT-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12637648#action_12637648
]
David Reiss commented on THRIFT-96:
-----------------------------------
I think the TSocket change is solid. The TUnderlyingTransport change is mostly
good, but it does change two behaviors.
1/ TBufferedTransport now uses the underlying peek instead of trying to read.
mcslee, can you give us some insight into why the current version of
TBufferedTransport::peek does a read instead of calling the underlying peek?
2/ The read buffer for TFramedTransport is allocated unnecessarily at
construction time. This is not optimal, but I guess it is not a big deal since
we reuse it if it is big enough.
> TSocket.peek fails on FreeBSD
> -----------------------------
>
> Key: THRIFT-96
> URL: https://issues.apache.org/jira/browse/THRIFT-96
> Project: Thrift
> Issue Type: Bug
> Components: Library (C++)
> Environment: FreeBSD
> Reporter: Alexander Shigin
> Attachments: thrift-freebsd-read.patch, thrift-peek-fix.patch,
> thrift-peek-fix.patch
>
>
> POSIX says what recv(2) should returns 0 if peer has performed a shutdown.
> This feature uses in TBufferedTransport
> {code}
> bool peek() {
> if (rBase_ == rBound_) {
> setReadBuffer(rBuf_.get(), transport_->read(rBuf_.get(), rBufSize_));
> }
> return (rBound_ > rBase_);
> }
> {code}
> The decision works fine on linux, but fails on freebsd. In freebsd, recv
> returns -1 and errno==ECONNRESET.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.