You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2003/09/15 05:54:34 UTC
cvs commit: xml-axis/c/src/common Packet.cpp
sanjaya 2003/09/14 20:54:34
Modified: c/src/common Packet.cpp
Log:
added new function set_header to set http headers to the Ax_soapstream
structure.
Revision Changes Path
1.6 +17 -2 xml-axis/c/src/common/Packet.cpp
Index: Packet.cpp
===================================================================
RCS file: /home/cvs/xml-axis/c/src/common/Packet.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Packet.cpp 1 Sep 2003 07:28:28 -0000 1.5
+++ Packet.cpp 15 Sep 2003 03:54:34 -0000 1.6
@@ -61,9 +61,24 @@
#include "Packet.h"
#include <string.h>
-
+#include <stdlib.h>
#include <stdio.h>
+
+int set_header(Ax_soapstream* soap, char * pchkey, char * pchvalue)
+{
+ int y = soap->so.http.ip_headercount;
+ Ax_header * temp = soap->so.http.ip_headers;
+ soap->so.http.ip_headers = (Ax_header*)realloc(temp,
+ (sizeof(Ax_header)*(y+1)));
+ soap->so.http.ip_headers[y].headername = pchkey;
+ soap->so.http.ip_headers[y].headervalue = pchvalue;
+ soap->so.http.ip_headercount = y+1;
+
+ return 0;
+}
+
+
const char* get_header(const Ax_soapstream* soap,const char* pchkey)
{
const Ax_header* hdrs = NULL;
@@ -91,7 +106,7 @@
for (int ix=0; ix<count; ix++)
{
//header* hdr = hdrs + ix;
- if (strcmp((hdrs+ix)->headername, SOAPACTIONHEADER) == 0)
+ if (strcmp((hdrs+ix)->headername, pchkey) == 0)
{
return (hdrs+ix)->headervalue;
}