---------------------------------------------------------------- BEFORE YOU POST, search the faq at <http://java.apache.org/faq/> WHEN YOU POST, include all relevant version numbers, log files, and configuration files. Don't make us guess your problem!!! ---------------------------------------------------------------- I am writing an ISAPI filter. I am trying to test it out and productionize it on an IIS Web server with JServ servlet Engine serving up my servlets. The function I am using is pPreProcData->AddHeader(pFC, lpszNameH, lpszValueH). The filter function seems to work fine (successful return code and message in the trace file), but when I use the "SnoopServlet" or the "EchoServlet" I do NOT find my "user-defined" headers in the HTTP request. I was wondering whether JServ was "eating away" these custom HTTP headers. I am using Apache Servlet Engine and IBM java runtime environment on MS Windows NT4.0. It would be great if somebody can help me out here. Attached below is parts of the ISAPI filter code ------------------------------------------- #define WIN32_LEAN_AN_MEAN #include <windows.h> #include <httpfilt.h> #include <stdio.h> //#include <debug.h> #define FILTER_DESCRIPTION "Skeleton Filter" #define BUFF_MAX 64 #define MAX_BUFF_SIZE 64 DWORD HandleEvent_PreProcHeaders(HTTP_FILTER_CONTEXT *pFC, PHTTP_FILTER_PREPROC_HEADERS pPreProcData); /* Helper functions for tracing */ void trace(char *); FILE *log; BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dvReason, LPVOID lpv) { CHAR ModuleName[BUFF_MAX+1]; switch (dvReason) { case DLL_PROCESS_ATTACH: GetModuleFileName(NULL, ModuleName, BUFF_MAX); //Debug((DEST, "filtersample1: DLL loaded by - %s", ModuleName)); GetModuleFileName(hinstDLL, ModuleName, BUFF_MAX); //Debug((DEST, "filtersample1: DLL module name is - %s", ModuleName)); log = fopen("E:\\Temp\\filtersample1.log", "a"); trace ("Log initialized..."); break; case DLL_PROCESS_DETACH: //Debug((DEST, "filtersample1: DLL being unloaded")); trace ("Log closed"); if (log != NULL) fclose(log); break; case DLL_THREAD_ATTACH: trace ("Thread Attach"); //Debug((DEST, "filtersample1: Thread Entering DllMain")); break; case DLL_THREAD_DETACH: trace ("Thread Detach"); //Debug((DEST, "filtersample1: Thread leaving DllMain")); break; } return TRUE; } BOOL WINAPI GetFilterVersion(HTTP_FILTER_VERSION *pVersion) { trace ("Entering GetFilterVersion..."); pVersion->dwServerFilterVersion = HTTP_FILTER_REVISION; strncpy(pVersion->lpszFilterDesc, FILTER_DESCRIPTION, SF_MAX_FILTER_DESC_LEN); pVersion->dwFlags = (SF_NOTIFY_SECURE_PORT | SF_NOTIFY_NONSECURE_PORT | SF_NOTIFY_READ_RAW_DATA | SF_NOTIFY_AUTHENTICATION | SF_NOTIFY_ACCESS_DENIED | SF_NOTIFY_PREPROC_HEADERS | SF_NOTIFY_URL_MAP | SF_NOTIFY_SEND_RAW_DATA | SF_NOTIFY_LOG | SF_NOTIFY_END_OF_NET_SESSION | SF_NOTIFY_ORDER_DEFAULT); return TRUE; } DWORD WINAPI HttpFilterProc(HTTP_FILTER_CONTEXT *pFC, DWORD dwNotificationType, VOID *pvData) { DWORD dwRet = SF_STATUS_REQ_NEXT_NOTIFICATION; //trace("Entering HttpFilterProc"); switch (dwNotificationType) { case SF_NOTIFY_PREPROC_HEADERS: dwRet = HandleEvent_PreProcHeaders(pFC, (PHTTP_FILTER_PREPROC_HEADERS)pvData); break; } return dwRet; } DWORD HandleEvent_PreProcHeaders(HTTP_FILTER_CONTEXT *pFC, PHTTP_FILTER_PREPROC_HEADERS pPreProcData) { DWORD dwRet = SF_STATUS_REQ_NEXT_NOTIFICATION; CHAR HeaderBuff[BUFF_MAX+1]; DWORD dwBytes = BUFF_MAX+1; CHAR srvrBuff[MAX_BUFF_SIZE]; DWORD dwBuffSize = MAX_BUFF_SIZE; LPSTR lpszName = "VikramHeader"; LPSTR lpszValue = "Alaska"; LPSTR lpszNameH = "HTTP_VikramHeader"; LPSTR lpszValueH = "Alaska"; trace("Notification Type: SF_NOTIFY_PREPROC_HEADERS"); pPreProcData->GetHeader(pFC, "User-Agent:", HeaderBuff, &dwBytes); if (0 == dwBytes) trace("HeaderBuff is 0 char long"); else trace("HeaderBuff is >0 char long"); trace("HeaderBuff: "); trace((char *)HeaderBuff); /* Code to Add Response Header */ if (pPreProcData->AddHeader(pFC, lpszNameH, lpszValueH)) { trace ("Header variable added"); } else { trace ("Unable to add Header"); } /* Set Header */ if (pPreProcData->SetHeader(pFC, lpszName, lpszValue)) { trace ("Header variable Set"); } else { trace ("Unable to Set Header"); } /* if (pFC->GetServerVariable(pFC, "DCS_KEY", srvrBuff, &dwBuffSize)) { trace("DCS_KEY: "); // Code to Add Response Header } else { // An error occurred //if (GetLastError trace ("An error occured during Server Variable extraction"); } */ return dwRet; } void trace(char *str) { if (log != NULL) fprintf(log, "filtersample1: %s\n", str); } ------------------------- -- -------------------------------------------------------------- Please read the FAQ! <http://java.apache.org/faq/> To subscribe: [EMAIL PROTECTED] To unsubscribe: [EMAIL PROTECTED] Search Archives: <http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/> Problems?: [EMAIL PROTECTED]