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 c8dd446..2bed0a1 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 @@
   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 @@
 
   // 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];