From: Bryan Duxbury Date: Thu, 9 Jun 2011 00:21:55 +0000 (+0000) Subject: THRIFT-1140. glib_c: Framed Transport Client using C (Glib) Library hangs when connec... X-Git-Tag: 0.7.0~73 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=f3138ad24b124446814167d12fb5004691cf4024;p=common%2Fthrift.git THRIFT-1140. glib_c: Framed Transport Client using C (Glib) Library hangs when connecting to Ruby Server Include the size of the whole buffer. Patch: Lukas Fittl git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1133611 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/c_glib/src/transport/thrift_framed_transport.c b/lib/c_glib/src/transport/thrift_framed_transport.c index c8dd4467..2bed0a12 100644 --- a/lib/c_glib/src/transport/thrift_framed_transport.c +++ b/lib/c_glib/src/transport/thrift_framed_transport.c @@ -81,7 +81,7 @@ thrift_framed_transport_read_frame (ThriftTransport *transport, guchar tmpdata[sz]; bytes = THRIFT_TRANSPORT_GET_CLASS (t->transport)->read (t->transport, tmpdata, - sz - sizeof (sz), + sz, error); /* add the data to the buffer */ @@ -205,7 +205,7 @@ thrift_framed_transport_flush (ThriftTransport *transport, GError **error) // get the size of the frame in host and network byte order sz_hbo = t->w_buf->len + sizeof(sz_nbo); - sz_nbo = (gint32) htonl ((guint32) sz_hbo); + sz_nbo = (gint32) htonl ((guint32) t->w_buf->len); // copy the size of the frame and then the frame itself guchar tmpdata[sz_hbo];