Update of /cvsroot/pywin32/pywin32/isapi/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26622
Modified Files:
FilterContext.h PyFilterObjects.cpp PyFilterObjects.h
Log Message:
Add filter_context.AddResponseHeaders()
Index: FilterContext.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/FilterContext.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FilterContext.h 6 Oct 2004 05:11:53 -0000 1.1
--- FilterContext.h 22 Feb 2008 23:03:06 -0000 1.2
***************
*** 44,47 ****
--- 44,53 ----
}
+ BOOL AddResponseHeaders(LPSTR headers, const int reserved=0)
+ {
+ return m_pHFC->AddResponseHeaders(m_pHFC, headers, reserved);
+ }
+
+
bool GetServerVariable(LPCTSTR varName, LPSTR lpBuff, DWORD *pBuffSize)
{
Index: PyFilterObjects.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyFilterObjects.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** PyFilterObjects.h 10 Oct 2006 11:05:23 -0000 1.5
--- PyFilterObjects.h 22 Feb 2008 23:03:06 -0000 1.6
***************
*** 64,67 ****
--- 64,68 ----
static PyObject * GetData(PyObject *self, PyObject *args);
static PyObject * WriteClient(PyObject *self, PyObject *args);
+ static PyObject * AddResponseHeaders(PyObject *self, PyObject *args);
static PyObject * GetServerVariable(PyObject *self, PyObject *args);
// ServerSupportFunction implemented functions.
Index: PyFilterObjects.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyFilterObjects.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** PyFilterObjects.cpp 14 Dec 2006 08:35:34 -0000 1.8
--- PyFilterObjects.cpp 22 Feb 2008 23:03:06 -0000 1.9
***************
*** 212,215 ****
--- 212,240 ----
}
+ // @pymethod |HTTP_FILTER_CONTEXT|AddResponseHeaders|
+ PyObject * PyHFC::AddResponseHeaders(PyObject *self, PyObject *args)
+ {
+ BOOL bRes = FALSE;
+ char * buffer = NULL;
+ int reserved = 0;
+
+ PyHFC * phfc = (PyHFC *) self;
+ // @pyparm string|data||
+ // @pyparm int|reserverd|0|
+ if (!PyArg_ParseTuple(args, "s|l:WriteClient", &buffer, &reserved))
+ return NULL;
+
+ if (phfc->m_pfc){
+ Py_BEGIN_ALLOW_THREADS
+ bRes = phfc->m_pfc->AddResponseHeaders(buffer, reserved);
+ Py_END_ALLOW_THREADS
+ if (!bRes)
+ return SetPyHFCError("AddResponseHeaders");
+ }
+
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+
// @pymethod string|HTTP_FILTER_CONTEXT|GetServerVariable|
PyObject * PyHFC::GetServerVariable(PyObject *self, PyObject *args)
***************
*** 326,329 ****
--- 351,355 ----
{"GetServerVariable", PyHFC::GetServerVariable, 1}, // @pymeth GetServerVariable|
{"WriteClient", PyHFC::WriteClient, 1}, // @pymeth WriteClient|
+ {"AddResponseHeaders", PyHFC::AddResponseHeaders, 1}, // @pymeth AddResponseHeaders|Specifies a response header for IIS to send to the client.
{"write", PyHFC::WriteClient, 1}, // @pymeth write|A synonym for WriteClient, this allows you to 'print >> fc'
{"SendResponseHeader", PyHFC::SendResponseHeader, 1}, // @pymeth SendResponseHeader|
|