[Opensrf-commits] r1364 - trunk/src/gateway

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Jul 9 14:33:13 EDT 2008


Author: erickson
Date: 2008-07-09 14:33:10 -0400 (Wed, 09 Jul 2008)
New Revision: 1364

Modified:
   trunk/src/gateway/osrf_http_translator.c
Log:
added the string mangling to collapse a set of responses into 1 for non-multipart requests

Modified: trunk/src/gateway/osrf_http_translator.c
===================================================================
--- trunk/src/gateway/osrf_http_translator.c	2008-07-09 18:32:37 UTC (rev 1363)
+++ trunk/src/gateway/osrf_http_translator.c	2008-07-09 18:33:10 UTC (rev 1364)
@@ -362,8 +362,16 @@
                 int i;
                 OSRF_BUFFER_ADD(buf, osrfListGetIndex(trans->messages, 0));
                 for(i = 1; i < trans->messages->size; i++) {
-                    // yay! string mangling
+                    buffer_chomp(buf); // chomp off the closing array bracket
+                    char* body = osrfListGetIndex(trans->messages, i);
+                    char newbuf[strlen(body)];
+                    sprintf(newbuf, body+1); // chomp off the opening array bracket
+                    OSRF_BUFFER_ADD_CHAR(buf, ',');
+                    OSRF_BUFFER_ADD(buf, newbuf);
                 }
+                
+                ap_rputs(buf->buf, trans->apreq);
+                buffer_free(buf);
             }
         }
     }



More information about the opensrf-commits mailing list