[
https://issues.apache.org/jira/browse/THRIFT-2680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14117666#comment-14117666
]
Hudson commented on THRIFT-2680:
--------------------------------
SUCCESS: Integrated in Thrift #1267 (See
[https://builds.apache.org/job/Thrift/1267/])
THRIFT-2680 c_glib: ThriftFramedTransport fails when peer unexpectedly closes
connection (roger: rev 7fa9848b85479f81767a36a96e7e9805683015d4)
* lib/c_glib/src/thrift/c_glib/transport/thrift_framed_transport.c
* lib/c_glib/test/testframedtransport.c
> c_glib: ThriftFramedTransport fails when peer unexpectedly closes connection
> ----------------------------------------------------------------------------
>
> Key: THRIFT-2680
> URL: https://issues.apache.org/jira/browse/THRIFT-2680
> Project: Thrift
> Issue Type: Bug
> Components: C glib - Library
> Affects Versions: 0.9.1
> Environment: Fedora 20 64-bit on x86_64
> Reporter: Simon South
> Assignee: Roger Meier
> Priority: Minor
> Labels: c_glib, library
> Attachments:
> thrift-2680-1-c_glib-test-framed-transport-read-after-peer-close.patch,
> thrift-2680-2-c_glib-framed-transport-handle-closed-connection-gracefully.patch
>
>
> Working on the integration test suite for c_glib exposed a problem with
> ThriftFramedTransport: If the peer closes the connection unexpectedly,
> {{thrift_framed_transport_read_frame}} will fail with either a critical GLib
> warning or a segmentation fault.
> The attached patches fix this issue. The changes are, in order:
> 1. Add a suitable test case to {{testframedtransport.c}}.
> 2. Modify {{thrift_framed_transport_read_frame}} and
> {{thrift_framed_transport_read_frame_slow}} so they check for and respond to
> errors returned from other Thrift methods. Additionally,
> {{thrift_framed_transport_read_frame_slow}} should now always return -1 in
> case of read error, which includes "successfully" reading zero bytes from the
> peer (which generally indicates a prematurely closed connection).
> I've also taken the liberty of gently rewriting
> {{thrift_framed_transport_read_frame}} so it
> * Correctly uses an unsigned integer variable to hold the frame's size,
> * Uses {{thrift_transport_...}} functions to invoke class methods instead of
> the rather brittle practice of dereferencing class members directly, and
> * Accurately reports success or failure.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)