qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1512495 - /qpid/proton/trunk/proton-c/src/proton.c
Date Fri, 09 Aug 2013 21:11:50 GMT
Author: chug
Date: Fri Aug  9 21:11:49 2013
New Revision: 1512495

URL: http://svn.apache.org/r1512495
Log:
PROTON-402: [proton-c] Example proton.c with no args causes seg fault
allocate a bigger buffer to hold received message.


Modified:
    qpid/proton/trunk/proton-c/src/proton.c

Modified: qpid/proton/trunk/proton-c/src/proton.c
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/src/proton.c?rev=1512495&r1=1512494&r2=1512495&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/src/proton.c (original)
+++ qpid/proton/trunk/proton-c/src/proton.c Fri Aug  9 21:11:49 2013
@@ -194,7 +194,7 @@ void server_callback(pn_connector_t *cto
         printf("  payload = \"");
       }
       while (true) {
-        ssize_t n = pn_link_recv(link, msg, 1024);
+        ssize_t n = pn_link_recv(link, msg, 48);
         if (n == PN_EOS) {
           pn_link_advance(link);
           pn_delivery_update(delivery, PN_ACCEPTED);
@@ -296,7 +296,7 @@ void client_callback(pn_connector_t *cto
 
   pn_connection_t *connection = pn_connector_connection(ctor);
   char tagstr[1024];
-  PN_ENSURE(client_msg.buf, client_msg.capacity, (size_t) ctx->size, char);
+  PN_ENSURE(client_msg.buf, client_msg.capacity, (size_t) ctx->size + 16, char);
   char *msg = client_msg.buf;
   PN_ENSURE(client_data.buf, client_data.capacity, (size_t) ctx->size + 16, char);
   char *data = client_data.buf;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message