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

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Jul 9 12:06:08 EDT 2008


Author: erickson
Date: 2008-07-09 12:06:01 -0400 (Wed, 09 Jul 2008)
New Revision: 1362

Modified:
   trunk/src/gateway/osrf_http_translator.c
Log:
using a static buffer to store the multipart content type string

Modified: trunk/src/gateway/osrf_http_translator.c
===================================================================
--- trunk/src/gateway/osrf_http_translator.c	2008-07-08 22:16:02 UTC (rev 1361)
+++ trunk/src/gateway/osrf_http_translator.c	2008-07-09 16:06:01 UTC (rev 1362)
@@ -36,6 +36,7 @@
 char* domainName = NULL;
 int osrfConnected = 0;
 char recipientBuf[128];
+char contentTypeBuf[80];
 
 // for development only, writes to apache error log
 static void _dbg(char* s, ...) {
@@ -264,9 +265,10 @@
     apr_table_set(trans->apreq->headers_out, OSRF_HTTP_HEADER_FROM, msg->sender);
     apr_table_set(trans->apreq->headers_out, OSRF_HTTP_HEADER_THREAD, trans->thread);
     if(trans->multipart) {
-        char buf[strlen(MULTIPART_CONTENT_TYPE) + strlen(trans->delim) + 1];
-        sprintf(buf, MULTIPART_CONTENT_TYPE, trans->delim);
-	    ap_set_content_type(trans->apreq, buf);
+        sprintf(contentTypeBuf, MULTIPART_CONTENT_TYPE, trans->delim);
+        contentTypeBuf[79] = '\0';
+        osrfLogDebug(OSRF_LOG_MARK, "content type %s : %s : %s", MULTIPART_CONTENT_TYPE, trans->delim, contentTypeBuf);
+	    ap_set_content_type(trans->apreq, contentTypeBuf);
         ap_rprintf(trans->apreq, "--%s\n", trans->delim);
     } else {
 	    ap_set_content_type(trans->apreq, JSON_CONTENT_TYPE);



More information about the opensrf-commits mailing list