You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by "Jens Geyer (Jira)" <ji...@apache.org> on 2026/10/14 21:53:00 UTC

[jira] [Created] (THRIFT-6417) c_glib write loops do not treat a zero return as an error

Jens Geyer created THRIFT-6417:
----------------------------------

             Summary: c_glib write loops do not treat a zero return as an error
                 Key: THRIFT-6417
                 URL: https://issues.apache.org/jira/browse/THRIFT-6417
             Project: Thrift
          Issue Type: Improvement
          Components: C glib - Library
            Reporter: Jens Geyer


The write loops of {{thrift_socket_write()}} ({{send()}}), {{thrift_fd_transport_write()}} ({{write()}}) and {{thrift_ssl_socket_write()}} ({{SSL_write()}}) treat only a negative return as an error. If one of these calls returned 0 for a non-empty buffer, the loop would call it again without end and without making progress. C++ treats the same case as an error: {{TSocket}} and {{TFDTransport}} throw on a 0 from {{send()}} and {{write()}}, and {{TSSLSocket::write()}} handles any {{SSL_write()}} result {{<= 0}} through its SSL error path.

Proposed change: handle a zero return like an error, as C++ does, and cover the three loops with tests that substitute the system call.

_Drafted with AI assistance (Claude Opus 5 and Claude Opus 5.5); reviewed and filed by Jens Geyer._



--
This message was sent by Atlassian Jira
(v8.20.10#820010)