added the string mangling to collapse a set of responses into 1 for non-multipart...
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 9 Jul 2008 18:33:10 +0000 (18:33 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 9 Jul 2008 18:33:10 +0000 (18:33 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1364 9efc2488-bf62-4759-914b-345cdb29e865

src/gateway/osrf_http_translator.c

index 186f781..ed5cbf4 100644 (file)
@@ -362,8 +362,16 @@ static int osrfHttpTranslatorProcess(osrfHttpTranslator* trans) {
                 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);
             }
         }
     }