Update of /cvsroot/pywin32/pywin32/isapi/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25746/isapi/src
Modified Files:
ControlBlock.h FilterContext.h PyExtensionObjects.cpp
PyExtensionObjects.h PyFilterObjects.cpp PyFilterObjects.h
PythonEng.cpp PythonEng.h StdAfx.h Utils.cpp Utils.h
pyISAPI.cpp
Log Message:
make isapi sources py3k-friendly
Index: ControlBlock.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/ControlBlock.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ControlBlock.h 15 May 2008 10:57:09 -0000 1.6
--- ControlBlock.h 3 Feb 2009 00:51:42 -0000 1.7
***************
*** 34,43 ****
! void SetLogMessage(LPCTSTR msg)
{
strncpy(m_pECB->lpszLogData, msg, HSE_LOG_BUFFER_LEN);
}
! DWORD WriteStream(LPCTSTR buffer, const int buffLen, const int reserved=0)
{
DWORD dwBufLen = buffLen;
--- 34,43 ----
! void SetLogMessage(const char *msg)
{
strncpy(m_pECB->lpszLogData, msg, HSE_LOG_BUFFER_LEN);
}
! DWORD WriteStream(char *buffer, const int buffLen, const int reserved=0)
{
DWORD dwBufLen = buffLen;
***************
*** 45,49 ****
return dwBufLen;
}
! BOOL WriteClient(LPCTSTR buffer, DWORD *buffLen, const int reserved = 0)
{
return m_pECB->WriteClient(m_pECB->ConnID, (void *) buffer, buffLen, reserved);
--- 45,49 ----
return dwBufLen;
}
! BOOL WriteClient(char *buffer, DWORD *buffLen, const int reserved = 0)
{
return m_pECB->WriteClient(m_pECB->ConnID, (void *) buffer, buffLen, reserved);
***************
*** 63,69 ****
}
! bool GetServerVariable(LPCTSTR varName, LPSTR lpBuff, DWORD *pBuffSize)
{
! BOOL bOK = m_pECB->GetServerVariable(m_pECB->ConnID,(LPSTR) varName,lpBuff,pBuffSize);
if (!bOK)
*pBuffSize = 0;
--- 63,69 ----
}
! bool GetServerVariable(char *varName, LPSTR lpBuff, DWORD *pBuffSize)
{
! BOOL bOK = m_pECB->GetServerVariable(m_pECB->ConnID, varName, lpBuff, pBuffSize);
if (!bOK)
*pBuffSize = 0;
***************
*** 86,97 ****
}
! BOOL Redirect(LPCTSTR url)
{
! DWORD buffSize = strlen(url);
! BOOL bOK = (m_pECB->ServerSupportFunction)( m_pECB->ConnID, HSE_REQ_SEND_URL_REDIRECT_RESP, (LPSTR) url, &buffSize,0);
return bOK;
}
! BOOL MapURLToPath(LPCTSTR buffer, LPDWORD pSizeofBuffer)
{
BOOL bOK = (m_pECB->ServerSupportFunction)(m_pECB->ConnID,
--- 86,97 ----
}
! BOOL Redirect(char *url)
{
! DWORD buffSize = (DWORD)strlen(url);
! BOOL bOK = (m_pECB->ServerSupportFunction)( m_pECB->ConnID, HSE_REQ_SEND_URL_REDIRECT_RESP, url, &buffSize,0);
return bOK;
}
! BOOL MapURLToPath(char *buffer, LPDWORD pSizeofBuffer)
{
BOOL bOK = (m_pECB->ServerSupportFunction)(m_pECB->ConnID,
***************
*** 115,119 ****
DWORD bufsize = sizeof(buf)/sizeof(buf[0]);
if (GetServerVariable("HTTP_CONNECTION",buf, &bufsize)){
! bKeepAlive = strcmpi(buf, "keep-alive")==0;
}
return bKeepAlive;
--- 115,119 ----
DWORD bufsize = sizeof(buf)/sizeof(buf[0]);
if (GetServerVariable("HTTP_CONNECTION",buf, &bufsize)){
! bKeepAlive = _strcmpi(buf, "keep-alive")==0;
}
return bKeepAlive;
Index: PyFilterObjects.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyFilterObjects.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** PyFilterObjects.h 3 Jan 2009 06:11:46 -0000 1.8
--- PyFilterObjects.h 3 Feb 2009 00:51:42 -0000 1.9
***************
*** 40,45 ****
// Python support
static void deallocFunc(PyObject *ob);
! static PyObject *getattr(PyObject *self, char *name);
! static int setattr(PyObject *self, char *name, PyObject *v);
};
--- 40,45 ----
// Python support
static void deallocFunc(PyObject *ob);
! static PyObject *getattro(PyObject *self, PyObject *ob);
! static int setattro(PyObject *self, PyObject *obname, PyObject *v);
};
***************
*** 56,61 ****
// Python support
static void deallocFunc(PyObject *ob);
! static PyObject *getattr(PyObject *self, char *name);
! static int setattr(PyObject *self, char *name, PyObject *v);
// class methods
--- 56,61 ----
// Python support
static void deallocFunc(PyObject *ob);
! static PyObject *getattro(PyObject *self, PyObject *obname);
! static int setattro(PyObject *self, PyObject *obname, PyObject *v);
// class methods
***************
*** 67,77 ****
static PyObject * SendResponseHeader(PyObject *self, PyObject *args);
static PyObject * DisableNotifications(PyObject *self, PyObject *args);
protected:
- #pragma warning( disable : 4251 )
- static struct memberlist PyHFC_memberlist[];
- #pragma warning( default : 4251 )
-
DWORD m_notificationType;
DWORD m_revision;
--- 67,74 ----
static PyObject * SendResponseHeader(PyObject *self, PyObject *args);
static PyObject * DisableNotifications(PyObject *self, PyObject *args);
+ static struct PyMemberDef members[];
protected:
DWORD m_notificationType;
DWORD m_revision;
***************
*** 90,95 ****
// Python support
static void deallocFunc(PyObject *ob);
! static PyObject *getattr(PyObject *self, char *name);
! static int setattr(PyObject *self, char *name, PyObject *v);
};
--- 87,92 ----
// Python support
static void deallocFunc(PyObject *ob);
! static PyObject *getattro(PyObject *self, PyObject *obname);
! static int setattro(PyObject *self, PyObject *obname, PyObject *v);
};
***************
*** 106,111 ****
// Python support
static void deallocFunc(PyObject *ob);
- static PyObject *getattr(PyObject *self, char *name);
- static int setattr(PyObject *self, char *name, PyObject *v);
};
--- 103,106 ----
***************
*** 122,127 ****
// Python support
static void deallocFunc(PyObject *ob);
! static PyObject *getattr(PyObject *self, char *name);
! static int setattr(PyObject *self, char *name, PyObject *v);
};
--- 117,122 ----
// Python support
static void deallocFunc(PyObject *ob);
! static PyObject *getattro(PyObject *self, PyObject *obname);
! static int setattro(PyObject *self, PyObject *obname, PyObject *v);
};
***************
*** 138,143 ****
// Python support
static void deallocFunc(PyObject *ob);
! static PyObject *getattr(PyObject *self, char *name);
! static int setattr(PyObject *self, char *name, PyObject *v);
};
--- 133,138 ----
// Python support
static void deallocFunc(PyObject *ob);
! static PyObject *getattro(PyObject *self, PyObject *obname);
! static int setattro(PyObject *self, PyObject *obname, PyObject *v);
};
***************
*** 153,158 ****
// Python support
static void deallocFunc(PyObject *ob);
! static PyObject *getattr(PyObject *self, char *name);
! static int setattr(PyObject *self, char *name, PyObject *v);
};
--- 148,153 ----
// Python support
static void deallocFunc(PyObject *ob);
! static PyObject *getattro(PyObject *self, PyObject *obname);
! static int setattro(PyObject *self, PyObject *obname, PyObject *v);
};
Index: Utils.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/Utils.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Utils.h 17 Jan 2007 04:40:12 -0000 1.2
--- Utils.h 3 Feb 2009 00:51:42 -0000 1.3
***************
*** 53,60 ****
// Dump out an HTML error response page
! char *HTMLErrorResp(LPCTSTR msg);
// returns the pathname of this module
! char *GetModulePath(void);
// Write entry to the event log
--- 53,60 ----
// Dump out an HTML error response page
! char *HTMLErrorResp(const char *msg);
// returns the pathname of this module
! TCHAR *GetModulePath(void);
// Write entry to the event log
Index: pyISAPI.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/pyISAPI.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** pyISAPI.cpp 17 Jan 2007 04:36:54 -0000 1.8
--- pyISAPI.cpp 3 Feb 2009 00:51:42 -0000 1.9
***************
*** 50,54 ****
char g_CallbackModuleName[_MAX_PATH + _MAX_FNAME] = "";
! #define TRACE OutputDebugString
// This is an entry point for py2exe.
--- 50,54 ----
char g_CallbackModuleName[_MAX_PATH + _MAX_FNAME] = "";
! #define TRACE(x) OutputDebugString(_T(x))
// This is an entry point for py2exe.
***************
*** 56,60 ****
{
strncpy(g_CallbackModuleName, modname,
! sizeof(g_CallbackModuleName)/sizeof(g_CallbackModuleName[0]));
// cast BOOL->bool without compiler warning!
g_IsFrozen = is_frozen ? TRUE : FALSE;
--- 56,60 ----
{
strncpy(g_CallbackModuleName, modname,
! sizeof(g_CallbackModuleName)/sizeof(g_CallbackModuleName[0]));
// cast BOOL->bool without compiler warning!
g_IsFrozen = is_frozen ? TRUE : FALSE;
Index: PythonEng.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/PythonEng.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** PythonEng.cpp 15 May 2008 10:57:09 -0000 1.6
--- PythonEng.cpp 3 Feb 2009 00:51:42 -0000 1.7
***************
*** 38,41 ****
--- 38,44 ----
extern char g_CallbackModuleName[_MAX_PATH + _MAX_FNAME];
+ extern void InitExtensionTypes();
+ extern void InitFilterTypes();
+
/////////////////////////////////////////////////////////////////////
// Python Engine
***************
*** 71,75 ****
if (!g_IsFrozen) {
! char *dll_path = GetModulePath();
AddToPythonPath(dll_path);
free(dll_path);
--- 74,78 ----
if (!g_IsFrozen) {
! TCHAR *dll_path = GetModulePath();
AddToPythonPath(dll_path);
free(dll_path);
***************
*** 88,91 ****
--- 91,99 ----
"InternalReloadException");
Py_XDECREF(isapi_package);
+
+ // ready our types.
+ InitExtensionTypes();
+ InitFilterTypes();
+
PyGILState_Release(old_state);
FindModuleName();
***************
*** 97,103 ****
void CPythonEngine::FindModuleName()
{
! TCHAR szFilePath[_MAX_PATH];
! TCHAR szBase[_MAX_FNAME];
! TCHAR *module_name;
// If a name for the module has been magically setup (eg, via a frozen
--- 105,111 ----
void CPythonEngine::FindModuleName()
{
! char szFilePath[_MAX_PATH];
! char szBase[_MAX_FNAME];
! char *module_name;
// If a name for the module has been magically setup (eg, via a frozen
***************
*** 109,113 ****
// find out where our DLL/EXE module lives
// NOTE: the long file name does not get returned (don't know why)
! ::GetModuleFileName(g_hInstance, szFilePath, sizeof(szFilePath));
::_splitpath( szFilePath, NULL, NULL, szBase, NULL);
module_name = szBase + 1; // skip first char.
--- 117,121 ----
// find out where our DLL/EXE module lives
// NOTE: the long file name does not get returned (don't know why)
! ::GetModuleFileNameA(g_hInstance, szFilePath, sizeof(szFilePath));
::_splitpath( szFilePath, NULL, NULL, szBase, NULL);
module_name = szBase + 1; // skip first char.
***************
*** 118,122 ****
bool CPythonEngine::AddToPythonPath(LPCTSTR pPathName)
{
! PyObject *obPathList = PySys_GetObject(_T("path"));
if (obPathList==NULL) {
return false;
--- 126,130 ----
bool CPythonEngine::AddToPythonPath(LPCTSTR pPathName)
{
! PyObject *obPathList = PySys_GetObject("path");
if (obPathList==NULL) {
return false;
***************
*** 129,138 ****
// Current Python versions handle neither this, nor Unicode on
// sys.path, so correct this here.
! size_t len = strlen(pPathName);
! if (len > 4 && strncmp(pPathName, "\\\\?\\", 4)==0) {
pPathName += 4;
len -= 4;
}
PyObject *obNew = PyString_FromStringAndSize(pPathName, len);
if (obNew==NULL) {
return false;
--- 137,150 ----
// Current Python versions handle neither this, nor Unicode on
// sys.path, so correct this here.
! size_t len = _tcslen(pPathName);
! if (len > 4 && _tcsncmp(pPathName, _T("\\\\?\\"), 4)==0) {
pPathName += 4;
len -= 4;
}
+ #if (PY_VERSION_HEX < 0x03000000)
PyObject *obNew = PyString_FromStringAndSize(pPathName, len);
+ #else
+ PyObject *obNew = PyUnicode_FromWideChar(pPathName, len);
+ #endif
if (obNew==NULL) {
return false;
***************
*** 349,353 ****
// general error handler
! void ExtensionError(CControlBlock *pcb, LPCTSTR errmsg)
{
char *windows_error = ::GetLastError() ?
--- 361,365 ----
// general error handler
! void ExtensionError(CControlBlock *pcb, const char *errmsg)
{
char *windows_error = ::GetLastError() ?
***************
*** 390,394 ****
}
! void FilterError(CFilterContext *pfc, LPCTSTR errmsg)
{
char *windows_error = ::GetLastError() ?
--- 402,406 ----
}
! void FilterError(CFilterContext *pfc, const char *errmsg)
{
char *windows_error = ::GetLastError() ?
Index: PyExtensionObjects.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyExtensionObjects.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** PyExtensionObjects.h 3 Jan 2009 06:11:46 -0000 1.9
--- PyExtensionObjects.h 3 Feb 2009 00:51:42 -0000 1.10
***************
*** 39,44 ****
// Python support
static void deallocFunc(PyObject *ob);
! static PyObject *getattr(PyObject *self, char *name);
! static int setattr(PyObject *self, char *name, PyObject *v);
};
--- 39,44 ----
// Python support
static void deallocFunc(PyObject *ob);
! static PyObject *getattro(PyObject *self, PyObject *name);
! static int setattro(PyObject *self, PyObject *name, PyObject *v);
};
***************
*** 46,65 ****
{
CControlBlock * m_pcb;
-
DWORD m_version; // Version info of this spec
- HCONN m_connID; // Context number not to be modified!
-
- PyObject * m_method; // REQUEST_METHOD
- PyObject * m_queryString; // QUERY_STRING
- PyObject * m_pathInfo; // PATH_INFO
- PyObject * m_pathTranslated; // PATH_TRANSLATED
-
DWORD m_totalBytes; // Total bytes indicated from client
DWORD m_available; // Available number of bytes
- PyObject * m_data; // Pointer to cbAvailable bytes
- PyObject * m_contentType; // Content type of client data
-
DWORD m_HttpStatusCode; // The status of the current transaction when the request is completed.
- PyObject * m_logData; // log data string
public:
--- 46,53 ----
***************
*** 77,82 ****
// Python support
static void deallocFunc(PyObject *ob);
! static PyObject *getattr(PyObject *self, char *name);
! static int setattr(PyObject *self, char *name, PyObject *v);
// class methods
--- 65,70 ----
// Python support
static void deallocFunc(PyObject *ob);
! static PyObject *getattro(PyObject *self, PyObject *obname);
! static int setattro(PyObject *self, PyObject *obname, PyObject *v);
// class methods
***************
*** 106,113 ****
static PyObject * IsSessionActive(PyObject *self, PyObject * args);
! protected:
! #pragma warning( disable : 4251 )
! static struct memberlist PyECB_memberlist[];
! #pragma warning( default : 4251 )
};
--- 94,98 ----
static PyObject * IsSessionActive(PyObject *self, PyObject * args);
! static struct PyMemberDef members[];
};
Index: PythonEng.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/PythonEng.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PythonEng.h 11 Oct 2006 07:55:10 -0000 1.2
--- PythonEng.h 3 Feb 2009 00:51:42 -0000 1.3
***************
*** 30,46 ****
#include "FilterContext.h"
- /////////////////////////////////////////////////////
- // Engine exception
- ////////////////////////////////////////////////////
-
- class CPythonEngineException
- {
- public:
- CPythonEngineException(LPCTSTR errMsg = "") {m_errStr = strdup(errMsg);}
- ~CPythonEngineException(){free(m_errStr);}
- public:
- char *m_errStr;
- };
-
class CPythonEngine
{
--- 30,33 ----
***************
*** 92,97 ****
// general error handler
! void ExtensionError(CControlBlock *pcb, LPCTSTR errmsg);
! void FilterError(CFilterContext *pfc, LPCTSTR errmsg);
class CEnterLeavePython {
--- 79,84 ----
// general error handler
! void ExtensionError(CControlBlock *pcb, const char *errmsg);
! void FilterError(CFilterContext *pfc, const char *errmsg);
class CEnterLeavePython {
Index: Utils.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/Utils.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Utils.cpp 17 Jan 2007 04:40:12 -0000 1.3
--- Utils.cpp 3 Feb 2009 00:51:42 -0000 1.4
***************
*** 33,39 ****
static WCHAR *source_name = L"ISAPI Filter or Extension";
// returns the pathname of this module
! char *GetModulePath(void)
{
// directory values
--- 33,60 ----
static WCHAR *source_name = L"ISAPI Filter or Extension";
+ // some py3k-friendly type conversions.
+ const char *PyISAPIString_AsBytes(PyObject *ob, DWORD *psize /* = NULL */)
+ {
+ #if (PY_VERSION_HEX >= 0x03000000)
+ // py3k - check for unicode object and use default encoding.
+ if (PyUnicode_Check(ob)) {
+ ob = _PyUnicode_AsDefaultEncodedString(ob, NULL);
+ if (ob == NULL)
+ return NULL;
+ }
+ #endif
+ // These 'PyString_' calls are all mapped to the bytes API in py3k...
+ if (!PyString_Check(ob)) {
+ PyErr_Format(PyExc_ValueError, "Expected a string object (got %s)", ob->ob_type->tp_name);
+ return NULL;
+ }
+ if (psize)
+ *psize = PyString_Size(ob);
+ return PyString_AsString(ob);
+ }
+
// returns the pathname of this module
! TCHAR *GetModulePath(void)
{
// directory values
***************
*** 45,57 ****
// NOTE: the long file name does not get returned (don't know why)
::GetModuleFileName(g_hInstance, szFilePath, sizeof(szFilePath));
! ::_splitpath( szFilePath, szDrive, szDir, NULL, NULL );
! int dir_len = strlen(szDir);
! if (dir_len && szDir[dir_len-1] == '\\')
! szDir[dir_len-1] = '\0';
! char *result = (char *)malloc(strlen(szDrive)+strlen(szDir)+1);
if (result) {
! strcpy(result, szDrive);
! strcat(result, szDir);
}
return result;
--- 66,78 ----
// NOTE: the long file name does not get returned (don't know why)
::GetModuleFileName(g_hInstance, szFilePath, sizeof(szFilePath));
! ::_tsplitpath( szFilePath, szDrive, szDir, NULL, NULL );
! int dir_len = _tcslen(szDir);
! if (dir_len && szDir[dir_len-1] == _T('\\'))
! szDir[dir_len-1] = _T('\0');
! TCHAR *result = (TCHAR *)malloc((_tcslen(szDrive)+_tcslen(szDir)+1)*sizeof(TCHAR));
if (result) {
! _tcscpy(result, szDrive);
! _tcscat(result, szDir);
}
return result;
***************
*** 66,70 ****
if (!result) return NULL;
result[0] = '\0';
! int nLen =FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
nErrNo,
--- 87,91 ----
if (!result) return NULL;
result[0] = '\0';
! int nLen =FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
nErrNo,
***************
*** 83,87 ****
// format an error
! char *HTMLErrorResp(LPCTSTR msg)
{
const char *htmlBody = "<html><head><title>Python ISAPI Error</title></head>"
--- 104,108 ----
// format an error
! char *HTMLErrorResp(const char *msg)
{
const char *htmlBody = "<html><head><title>Python ISAPI Error</title></head>"
***************
*** 106,110 ****
sizeof mod_name/sizeof WCHAR);
if (!mod_name[0]) {
! OutputDebugString("GetModuleFileNameW failed!");
return;
}
--- 127,131 ----
sizeof mod_name/sizeof WCHAR);
if (!mod_name[0]) {
! OutputDebugString(_T("GetModuleFileNameW failed!"));
return;
}
***************
*** 147,151 ****
hEventSource = RegisterEventSourceW(NULL, source_name);
if (hEventSource) {
! ReportEvent(hEventSource, // handle of event source
eventType, // event type
0, // event category
--- 168,172 ----
hEventSource = RegisterEventSourceW(NULL, source_name);
if (hEventSource) {
! ReportEventA(hEventSource, // handle of event source
eventType, // event type
0, // event category
Index: PyExtensionObjects.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyExtensionObjects.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** PyExtensionObjects.cpp 27 Jan 2009 13:07:21 -0000 1.14
--- PyExtensionObjects.cpp 3 Feb 2009 00:51:42 -0000 1.15
***************
*** 136,141 ****
PyTypeObject PyVERSION_INFOType =
{
! PyObject_HEAD_INIT(&PyType_Type)
! 0,
"HSE_VERSION_INFO",
sizeof(PyVERSION_INFO),
--- 136,140 ----
PyTypeObject PyVERSION_INFOType =
{
! PYISAPI_OBJECT_HEAD
"HSE_VERSION_INFO",
sizeof(PyVERSION_INFO),
***************
*** 143,148 ****
PyVERSION_INFO::deallocFunc, /* tp_dealloc */
0, /* tp_print */
! PyVERSION_INFO::getattr, /* tp_getattr */
! PyVERSION_INFO::setattr, /* tp_setattr */
0,
0, /* tp_repr */
--- 142,147 ----
PyVERSION_INFO::deallocFunc, /* tp_dealloc */
0, /* tp_print */
! 0, /* tp_getattr */
! 0, /* tp_setattr */
0,
0, /* tp_repr */
***************
*** 153,159 ****
0, /* tp_call */
0, /* tp_str */
};
-
PyVERSION_INFO::PyVERSION_INFO(HSE_VERSION_INFO *pvi)
{
--- 152,161 ----
0, /* tp_call */
0, /* tp_str */
+ PyVERSION_INFO::getattro, /* tp_getattro */
+ PyVERSION_INFO::setattro, /* tp_setattro */
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT, /* tp_flags */
};
PyVERSION_INFO::PyVERSION_INFO(HSE_VERSION_INFO *pvi)
{
***************
*** 167,184 ****
}
! PyObject *PyVERSION_INFO::getattr(PyObject *self, char *name)
{
PyVERSION_INFO *me = (PyVERSION_INFO *)self;
if (!me->m_pvi)
return PyErr_Format(PyExc_RuntimeError, "VERSION_INFO structure no longer exists");
! if (strcmp(name, "ExtensionDesc")==0) {
return PyString_FromString(me->m_pvi->lpszExtensionDesc);
}
! return PyErr_Format(PyExc_AttributeError, "PyVERSION_INFO has no attribute '%s'", name);
}
! int PyVERSION_INFO::setattr(PyObject *self, char *name, PyObject *v)
{
PyVERSION_INFO *me = (PyVERSION_INFO *)self;
if (!me->m_pvi) {
PyErr_Format(PyExc_RuntimeError, "VERSION_INFO structure no longer exists");
--- 169,188 ----
}
! PyObject *PyVERSION_INFO::getattro(PyObject *self, PyObject *obname)
{
PyVERSION_INFO *me = (PyVERSION_INFO *)self;
if (!me->m_pvi)
return PyErr_Format(PyExc_RuntimeError, "VERSION_INFO structure no longer exists");
! TCHAR *name=PYISAPI_ATTR_CONVERT(obname);
! if (_tcscmp(name, _T("ExtensionDesc"))==0) {
return PyString_FromString(me->m_pvi->lpszExtensionDesc);
}
! return PyObject_GenericGetAttr(self, obname);
}
! int PyVERSION_INFO::setattro(PyObject *self, PyObject *obname, PyObject *v)
{
PyVERSION_INFO *me = (PyVERSION_INFO *)self;
+ TCHAR *name=PYISAPI_ATTR_CONVERT(obname);
if (!me->m_pvi) {
PyErr_Format(PyExc_RuntimeError, "VERSION_INFO structure no longer exists");
***************
*** 190,206 ****
}
// @prop string|ExtensionDesc|The description of the extension.
! else if (strcmp(name, "ExtensionDesc")==0) {
! if (!PyString_Check(v)) {
! PyErr_Format(PyExc_ValueError, "FilterDesc must be a string (got %s)", v->ob_type->tp_name);
return -1;
! }
! if (PyString_Size(v) > HSE_MAX_EXT_DLL_NAME_LEN) {
PyErr_Format(PyExc_ValueError, "String is too long - max of %d chars", HSE_MAX_EXT_DLL_NAME_LEN);
return -1;
}
! strcpy(me->m_pvi->lpszExtensionDesc, PyString_AsString(v));
} else {
! PyErr_SetString(PyExc_AttributeError, "can't modify read only VERSION_INFO attributes.");
! return -1;
}
return 0;
--- 194,210 ----
}
// @prop string|ExtensionDesc|The description of the extension.
! else if (_tcscmp(name, _T("ExtensionDesc"))==0) {
! DWORD size;
! const char *bytes = PyISAPIString_AsBytes(v, &size);
! if (!bytes)
return -1;
! if (size > HSE_MAX_EXT_DLL_NAME_LEN) {
PyErr_Format(PyExc_ValueError, "String is too long - max of %d chars", HSE_MAX_EXT_DLL_NAME_LEN);
return -1;
}
! strcpy(me->m_pvi->lpszExtensionDesc, bytes);
! return 0;
} else {
! return PyObject_GenericSetAttr(self, obname, v);
}
return 0;
***************
*** 226,246 ****
// @object EXTENSION_CONTROL_BLOCK|A python representation of an ISAPI
// EXTENSION_CONTROL_BLOCK.
! struct memberlist PyECB::PyECB_memberlist[] = {
{"Version", T_INT, ECBOFF(m_version), READONLY},
- // XXX - ConnID 64bit issue?
- {"ConnID", T_INT, ECBOFF(m_connID), READONLY},
-
- {"Method", T_OBJECT, ECBOFF(m_method), READONLY},
- {"QueryString", T_OBJECT, ECBOFF(m_queryString), READONLY},
- {"PathInfo", T_OBJECT, ECBOFF(m_pathInfo), READONLY},
- {"PathTranslated", T_OBJECT, ECBOFF(m_pathTranslated), READONLY},
-
{"TotalBytes", T_INT, ECBOFF(m_totalBytes), READONLY},
{"AvailableBytes", T_INT, ECBOFF(m_available), READONLY},
- {"AvailableData", T_OBJECT, ECBOFF(m_data), READONLY},
- {"ContentType", T_OBJECT, ECBOFF(m_contentType), READONLY},
-
{"HttpStatusCode", T_INT, ECBOFF(m_HttpStatusCode)},
- {"LogData", T_OBJECT, ECBOFF(m_logData)},
{NULL}
};
--- 230,238 ----
// @object EXTENSION_CONTROL_BLOCK|A python representation of an ISAPI
// EXTENSION_CONTROL_BLOCK.
! struct PyMemberDef PyECB::members[] = {
{"Version", T_INT, ECBOFF(m_version), READONLY},
{"TotalBytes", T_INT, ECBOFF(m_totalBytes), READONLY},
{"AvailableBytes", T_INT, ECBOFF(m_available), READONLY},
{"HttpStatusCode", T_INT, ECBOFF(m_HttpStatusCode)},
{NULL}
};
***************
*** 272,277 ****
PyTypeObject PyECBType =
{
! PyObject_HEAD_INIT(&PyType_Type)
! 0,
"EXTENSION_CONTROL_BLOCK",
sizeof(PyECB),
--- 264,268 ----
PyTypeObject PyECBType =
{
! PYISAPI_OBJECT_HEAD
"EXTENSION_CONTROL_BLOCK",
sizeof(PyECB),
***************
*** 279,284 ****
PyECB::deallocFunc, /* tp_dealloc */
0, /* tp_print */
! PyECB::getattr, /* tp_getattr */
! PyECB::setattr, /* tp_setattr */
0,
0, /* tp_repr */
--- 270,275 ----
PyECB::deallocFunc, /* tp_dealloc */
0, /* tp_print */
! 0, /* tp_getattr */
! 0, /* tp_setattr */
0,
0, /* tp_repr */
***************
*** 289,312 ****
0, /* tp_call */
0, /* tp_str */
};
PyECB::PyECB(CControlBlock * pcb):
-
- m_version(0), // @prop integer|Version|Version info of this spec (read-only)
- m_connID(0), // @prop integer|ConnID|Context number (read-only)
-
- m_method(NULL), // @prop string|Method|REQUEST_METHOD
- m_queryString(NULL), // @prop string|QueryString|QUERY_STRING
- m_pathInfo(NULL), // @prop string|PathInfo|PATH_INFO
- m_pathTranslated(NULL), // @prop string|PathTranslated|PATH_TRANSLATED
m_totalBytes(0), // @prop int|TotalBytes|Total bytes indicated from client
m_available(0), // @prop int|AvailableBytes|Available number of bytes
! m_data(NULL), // @prop string|AvailableData|Pointer to cbAvailable bytes
! m_contentType(NULL), // @prop string|ContentType|Content type of client data
! m_HttpStatusCode(0), // @prop int|HttpStatusCode|The status of the current transaction when the request is completed.
! m_logData(NULL) // @prop string|LogData|log data string
{
ob_type = &PyECBType;
--- 280,324 ----
0, /* tp_call */
0, /* tp_str */
+ PyECB::getattro, /* tp_getattro */
+ PyECB::setattro, /* tp_setattro */
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT, /* tp_flags */
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ PyECB_methods, /* tp_methods */
+ PyECB::members, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
};
PyECB::PyECB(CControlBlock * pcb):
+ m_version(0), // @prop integer|Version|Version info of this spec (read-only)
m_totalBytes(0), // @prop int|TotalBytes|Total bytes indicated from client
m_available(0), // @prop int|AvailableBytes|Available number of bytes
! m_HttpStatusCode(0) // @prop int|HttpStatusCode|The status of the current transaction when the request is completed.
! // <keep a blank line above this for autoduck!> these props are managed manually...
! // @prop bytes|Method|REQUEST_METHOD
! // @prop long|ConnID|Context number (read-only)
! // @prop bytes|QueryString|QUERY_STRING
! // @prop bytes|PathInfo|PATH_INFO
! // @prop bytes|PathTranslated|PATH_TRANSLATED
! // @prop bytes|AvailableData|Pointer to cbAvailable bytes
! // @prop bytes|ContentType|Content type of client data
! // @prop bytes|LogData|log data string
{
ob_type = &PyECBType;
***************
*** 317,345 ****
EXTENSION_CONTROL_BLOCK * pecb = pcb->GetECB();
! m_version = pecb->dwVersion;
!
! m_connID = pecb->ConnID;
m_HttpStatusCode = pecb->dwHttpStatusCode;
- m_logData = PyString_FromString("");
- m_method = PyString_FromString(pecb->lpszMethod);
- m_queryString = PyString_FromString(pecb->lpszQueryString);
- m_pathInfo = PyString_FromString(pecb->lpszPathInfo);
- m_pathTranslated = PyString_FromString(pecb->lpszPathTranslated);
m_totalBytes = pecb->cbTotalBytes;
m_available = pecb->cbAvailable;
- m_data = PyString_FromStringAndSize((const char *) pecb->lpbData, pecb->cbAvailable);
- m_contentType = PyString_FromString(pecb->lpszContentType);
}
PyECB::~PyECB()
{
- Py_XDECREF(m_logData);
- Py_XDECREF(m_method);
- Py_XDECREF(m_queryString);
- Py_XDECREF(m_pathInfo);
- Py_XDECREF(m_pathTranslated);
- Py_XDECREF(m_data);
- Py_XDECREF(m_contentType);
-
if (m_pcb)
delete m_pcb;
--- 329,342 ----
EXTENSION_CONTROL_BLOCK * pecb = pcb->GetECB();
! m_version = pecb->dwVersion;
! // load up the simple integers etc into members so we can use normal
! // python structmember T_ macros.
m_HttpStatusCode = pecb->dwHttpStatusCode;
m_totalBytes = pecb->cbTotalBytes;
m_available = pecb->cbAvailable;
}
PyECB::~PyECB()
{
if (m_pcb)
delete m_pcb;
***************
*** 347,370 ****
! PyObject *PyECB::getattr(PyObject *self, char *name)
{
! // see if its a member variable
! for (int i=0; i<ARRAYSIZE(PyECB::PyECB_memberlist); i++){
! if (PyECB::PyECB_memberlist[i].name && _tcsicmp(name, PyECB::PyECB_memberlist[i].name) == 0)
! return PyMember_Get((char *)self, PyECB::PyECB_memberlist, name);
! }
!
! // see if its the special members attribute
! if (_tcscmp(name, _T("__members__"))==0)
! return PyMember_Get((char *)self, PyECB::PyECB_memberlist, name);
if (_tcscmp(name, _T("softspace"))==0) // help 'print' semantics.
return PyInt_FromLong(1);
! // must be a method
! return Py_FindMethod(PyECB_methods, self, name);
}
! int PyECB::setattr(PyObject *self, char *name, PyObject *v)
{
if (v == NULL) {
--- 344,384 ----
! PyObject *PyECB::getattro(PyObject *self, PyObject *obname)
{
! TCHAR *name=PYISAPI_ATTR_CONVERT(obname);
if (_tcscmp(name, _T("softspace"))==0) // help 'print' semantics.
return PyInt_FromLong(1);
! EXTENSION_CONTROL_BLOCK * pecb = ((PyECB *)self)->m_pcb->GetECB();
!
! if (_tcscmp(name, _T("Method"))==0)
! return PyString_FromString(pecb->lpszMethod);
!
! if (_tcscmp(name, _T("QueryString"))==0)
! return PyString_FromString(pecb->lpszQueryString);
!
! if (_tcscmp(name, _T("PathInfo"))==0)
! return PyString_FromString(pecb->lpszPathInfo);
!
! if (_tcscmp(name, _T("PathTranslated"))==0)
! return PyString_FromString(pecb->lpszPathTranslated);
!
! if (_tcscmp(name, _T("AvailableData"))==0)
! return PyString_FromStringAndSize((const char *) pecb->lpbData, pecb->cbAvailable);
!
! if (_tcscmp(name, _T("ContentType"))==0)
! return PyString_FromString(pecb->lpszContentType);
!
! if (_tcscmp(name, _T("LogData"))==0)
! return PyErr_Format(PyExc_AttributeError, "LogData attribute can only be set");
!
! if (_tcscmp(name, _T("ConnID"))==0)
! return PyLong_FromVoidPtr(pecb->ConnID);
!
! return PyObject_GenericGetAttr(self, obname);
}
! int PyECB::setattro(PyObject *self, PyObject *obname, PyObject *v)
{
if (v == NULL) {
***************
*** 372,405 ****
return -1;
}
! if (_tcscmp(name, _T("HttpStatusCode"))==0){
! int res = PyMember_Set((char *)self, PyECB::PyECB_memberlist, name, v);
! if (res == 0){
! DWORD status = PyInt_AsLong(v);
! PyECB * pecb = (PyECB *) self;
! if (pecb->m_pcb)
! pecb->m_pcb->SetStatus(status);
!
! }
!
! return res;
}
-
- if ( _tcscmp(name, _T("LogData"))==0){
- int res = PyMember_Set((char *)self, PyECB::PyECB_memberlist, name, v);
- if (res == 0){
- char * logMsg = PyString_AsString(v);
- PyECB * pecb = (PyECB *) self;
- if (pecb->m_pcb)
- pecb->m_pcb->SetLogMessage(logMsg);
-
- }
! return res;
}
PyErr_SetString(PyExc_AttributeError, "can't modify read only ECB attributes only HTTPStatusCode and LogData can be changed.");
return -1;
-
}
--- 386,412 ----
return -1;
}
+ TCHAR *name=PYISAPI_ATTR_CONVERT(obname);
! if (_tcscmp(name, _T("HttpStatusCode"))==0) {
! PyECB * pecb = (PyECB *) self;
! DWORD status = PyInt_AsLong(v);
! pecb->m_HttpStatusCode = status;
! if (pecb->m_pcb)
! pecb->m_pcb->SetStatus(status);
! return 0;
}
! if ( _tcscmp(name, _T("LogData"))==0) {
! const char *logMsg = PyISAPIString_AsBytes(v);
! if (!logMsg)
! return -1;
! PyECB * pecb = (PyECB *) self;
! if (pecb->m_pcb)
! pecb->m_pcb->SetLogMessage(logMsg);
! return 0;
}
PyErr_SetString(PyExc_AttributeError, "can't modify read only ECB attributes only HTTPStatusCode and LogData can be changed.");
return -1;
}
***************
*** 415,420 ****
{
BOOL bRes = FALSE;
! TCHAR * buffer = NULL;
! DWORD buffLen = 0;
int reserved = 0;
--- 422,428 ----
{
BOOL bRes = FALSE;
! char *buffer = NULL;
! Py_ssize_t buffLenIn = 0;
! DWORD buffLenOut = 0;
int reserved = 0;
***************
*** 422,437 ****
// @pyparm string/buffer|data||The data to write
// @pyparm int|reserved|0|
! if (!PyArg_ParseTuple(args, "s#|l:WriteClient", &buffer, &buffLen, &reserved))
return NULL;
DWORD bytesWritten = 0;
if (pecb->m_pcb){
Py_BEGIN_ALLOW_THREADS
! bRes = pecb->m_pcb->WriteClient(buffer, &buffLen, reserved);
Py_END_ALLOW_THREADS
if (!bRes)
return SetPyECBError("WriteClient");
}
! return PyInt_FromLong(buffLen);
// @rdesc the result is the number of bytes written.
}
--- 430,446 ----
// @pyparm string/buffer|data||The data to write
// @pyparm int|reserved|0|
! if (!PyArg_ParseTuple(args, "s#|l:WriteClient", &buffer, &buffLenIn, &reserved))
return NULL;
DWORD bytesWritten = 0;
+ buffLenOut = Py_SAFE_DOWNCAST(buffLenIn, Py_ssize_t, DWORD);
if (pecb->m_pcb){
Py_BEGIN_ALLOW_THREADS
! bRes = pecb->m_pcb->WriteClient(buffer, &buffLenOut, reserved);
Py_END_ALLOW_THREADS
if (!bRes)
return SetPyECBError("WriteClient");
}
! return PyInt_FromLong(buffLenOut);
// @rdesc the result is the number of bytes written.
}
***************
*** 444,448 ****
{
BOOL bRes = FALSE;
! TCHAR * variable = NULL;
PyObject *def = NULL;
--- 453,457 ----
{
BOOL bRes = FALSE;
! char *variable = NULL;
PyObject *def = NULL;
***************
*** 544,550 ****
PyObject * pyRes = NULL;
if (nSize>0)
! pyRes =PyString_FromStringAndSize((LPCTSTR) pBuff, nSize);
else
! pyRes = PyString_FromString("");
delete [] pBuff;
--- 553,559 ----
PyObject * pyRes = NULL;
if (nSize>0)
! pyRes =PyString_FromStringAndSize((const char *)pBuff, nSize);
else
! pyRes = PyString_FromStringAndSize("", 0);
delete [] pBuff;
***************
*** 558,564 ****
{
BOOL bRes = FALSE;
! TCHAR * reply = NULL;
! TCHAR * headers = NULL;
int bKeepAlive = 0;
PyECB * pecb = (PyECB *) self;
--- 567,574 ----
{
BOOL bRes = FALSE;
! char *reply = NULL;
! char *headers = NULL;
int bKeepAlive = 0;
+ Py_ssize_t cchStatus, cchHeader;
PyECB * pecb = (PyECB *) self;
***************
*** 570,578 ****
// @pyparm bool|keepAlive|False|
if (!PyArg_ParseTuple(args, "s#s#|i:SendResponseHeaders",
! &SendHeaderExInfo.pszStatus, &SendHeaderExInfo.cchStatus,
! &SendHeaderExInfo.pszHeader, &SendHeaderExInfo.cchHeader,
&bKeepAlive))
return NULL;
SendHeaderExInfo.fKeepConn = (bKeepAlive) ? TRUE:FALSE;
if (pecb->m_pcb){
--- 580,590 ----
// @pyparm bool|keepAlive|False|
if (!PyArg_ParseTuple(args, "s#s#|i:SendResponseHeaders",
! &SendHeaderExInfo.pszStatus, &cchStatus,
! &SendHeaderExInfo.pszHeader, &cchHeader,
&bKeepAlive))
return NULL;
+ SendHeaderExInfo.cchStatus = Py_SAFE_DOWNCAST(cchStatus, Py_ssize_t, DWORD);
+ SendHeaderExInfo.cchHeader = Py_SAFE_DOWNCAST(cchHeader, Py_ssize_t, DWORD);
SendHeaderExInfo.fKeepConn = (bKeepAlive) ? TRUE:FALSE;
if (pecb->m_pcb){
***************
*** 628,632 ****
{
BOOL bRes = FALSE;
! TCHAR * url = NULL;
PyECB * pecb = (PyECB *) self;
--- 640,644 ----
{
BOOL bRes = FALSE;
! char *url = NULL;
PyECB * pecb = (PyECB *) self;
***************
*** 1011,1012 ****
--- 1023,1030 ----
return NULL;
}
+
+ void InitExtensionTypes()
+ {
+ PyType_Ready(&PyVERSION_INFOType);
+ PyType_Ready(&PyECBType);
+ }
Index: FilterContext.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/FilterContext.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FilterContext.h 22 Feb 2008 23:03:06 -0000 1.2
--- FilterContext.h 3 Feb 2009 00:51:42 -0000 1.3
***************
*** 2,5 ****
--- 2,6 ----
#define __FILTER_CONTEXT_H__
+ // This class should slowly die - its indirection offers no value...
class CFilterContext
{
***************
*** 37,47 ****
}
- DWORD WriteClient(LPCTSTR buffer, const int buffLen, const int reserved=0)
- {
- DWORD dwBufLen = buffLen;
- m_pHFC->WriteClient(m_pHFC, (void *) buffer, &dwBufLen, reserved);
- return dwBufLen;
- }
-
BOOL AddResponseHeaders(LPSTR headers, const int reserved=0)
{
--- 38,41 ----
***************
*** 50,56 ****
! bool GetServerVariable(LPCTSTR varName, LPSTR lpBuff, DWORD *pBuffSize)
{
! BOOL bOK = m_pHFC->GetServerVariable(m_pHFC,(LPSTR) varName,lpBuff,pBuffSize);
if (!bOK)
*pBuffSize = 0;
--- 44,50 ----
! bool GetServerVariable(char *varName, LPSTR lpBuff, DWORD *pBuffSize)
{
! BOOL bOK = m_pHFC->GetServerVariable(m_pHFC, varName, lpBuff, pBuffSize);
if (!bOK)
*pBuffSize = 0;
***************
*** 64,69 ****
return m_pHFC->ServerSupportFunction(m_pHFC,sfReq, pData, ul1, ul2);
}
- private:
HTTP_FILTER_CONTEXT* m_pHFC; // IIS filter context block
DWORD m_notificationType;
void *m_data;
--- 58,63 ----
return m_pHFC->ServerSupportFunction(m_pHFC,sfReq, pData, ul1, ul2);
}
HTTP_FILTER_CONTEXT* m_pHFC; // IIS filter context block
+ private:
DWORD m_notificationType;
void *m_data;
Index: StdAfx.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/StdAfx.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** StdAfx.h 3 Jan 2009 06:11:46 -0000 1.2
--- StdAfx.h 3 Feb 2009 00:51:42 -0000 1.3
***************
*** 33,36 ****
--- 33,37 ----
#include "Utils.h"
+ #define PY_SSIZE_T_CLEAN
#include "Python.h"
***************
*** 49,52 ****
--- 50,91 ----
#undef WRITE_RESTRICTED
+ // ***** py3k support *****
+ // Note that when built for py3k, 'UNICODE' is defined, which conveniently
+ // means TCHAR is the same size as the native unicode object in all versions.
+ // Note however that ISAPI is always an ANSI API - so even when UNICODE is
+ // defined, most strings passed and received from ISAPI itself remain 'char *'
+ // in all versions.
+
+ // most of these taken from pywintypes...
+ #if (PY_VERSION_HEX < 0x03000000)
+
+ // Macros to handle PyObject layout changes in Py3k
+ #define PYISAPI_OBJECT_HEAD PyObject_HEAD_INIT(&PyType_Type) 0,
+ #define PYISAPI_ATTR_CONVERT PyString_AsString
+
+ #else // Py3k definitions
+
+ // Macros to handle PyObject layout changes in Py3k
+ #define PYISAPI_OBJECT_HEAD PyVarObject_HEAD_INIT(NULL, 0)
+ #define PYISAPI_ATTR_CONVERT PyUnicode_AsUnicode
+
+ // And some old py2k functions we can map to their new names...
+ #define PyString_Check PyBytes_Check
+ #define PyString_Size PyBytes_Size
+ #define PyString_AsString PyBytes_AsString
+ #define PyString_FromString PyBytes_FromString
+ #define PyString_FromStringAndSize PyBytes_FromStringAndSize
+ #define PyString_AS_STRING PyBytes_AS_STRING
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_Check PyLong_Check
+
+ #endif
+
+ // A helper that on py3k takes a str or unicode as input and returns a
+ // string - exactly how the 's#' PyArg_ParseTuple format string does...
+ // On py2k accepts str objects only.
+ const char *PyISAPIString_AsBytes(PyObject *ob, DWORD *psize=NULL);
+
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
Index: PyFilterObjects.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyFilterObjects.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** PyFilterObjects.cpp 3 Jul 2008 13:30:04 -0000 1.11
--- PyFilterObjects.cpp 3 Feb 2009 00:51:42 -0000 1.12
***************
*** 34,39 ****
PyTypeObject PyFILTER_VERSIONType =
{
! PyObject_HEAD_INIT(&PyType_Type)
! 0,
"HTTP_FILTER_VERSION",
sizeof(PyFILTER_VERSION),
--- 34,38 ----
PyTypeObject PyFILTER_VERSIONType =
{
! PYISAPI_OBJECT_HEAD
[...995 lines suppressed...]
CHECK_SET_FILTER_LOG_LONG(Win32Status);
! return PyObject_GenericSetAttr(self, obname, v);
}
***************
*** 1128,1129 ****
--- 1167,1179 ----
delete (PyFILTER_LOG *)ob;
}
+
+ void InitFilterTypes()
+ {
+ PyType_Ready(&PyFILTER_VERSIONType);
+ PyType_Ready(&PyHFCType);
+ PyType_Ready(&PyURL_MAPType);
+ PyType_Ready(&PyPREPROC_HEADERSType);
+ PyType_Ready(&PyRAW_DATAType);
+ PyType_Ready(&PyAUTHENTType);
+ PyType_Ready(&PyFILTER_LOGType);
+ }
|