andya 2003/11/14 05:08:23 Modified: jk/native2/server/dsapi/test test.dsp test.c printf_logger.c Log: Various changes, mainly cosmetic and some documentation now. Revision Changes Path 1.2 +2 -2 jakarta-tomcat-connectors/jk/native2/server/dsapi/test/test.dsp Index: test.dsp =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/dsapi/test/test.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test.dsp 13 Nov 2003 17:11:36 -0000 1.1 +++ test.dsp 14 Nov 2003 13:08:23 -0000 1.2 @@ -51,7 +51,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libapr.lib libaprutil.lib ws2_32.lib wsock32.lib pcre.lib pcreposix.lib notes.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\..\..\apr\Release" /libpath:"..\..\..\..\..\..\pcre\lib" /libpath:"..\..\..\..\..\..\apr-util\Release" /libpath:"$(NOTESAPI)\lib\mswin32" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib wsock32.lib pcre.lib pcreposix.lib notes.lib libapr.lib libaprutil.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\..\..\..\pcre\lib" /libpath:"..\..\..\..\..\..\apr\Release" /libpath:"..\..\..\..\..\..\apr-util\Release" /libpath:"$(NOTESAPI)\lib\mswin32" !ELSEIF "$(CFG)" == "test - Win32 Debug" @@ -76,7 +76,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libapr.lib libaprutil.lib ws2_32.lib wsock32.lib pcre.lib pcreposix.lib notes.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\..\..\apr\Release" /libpath:"..\..\..\..\..\..\pcre\lib" /libpath:"..\..\..\..\..\..\apr-util\Release" /libpath:"$(NOTESAPI)\lib\mswin32" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib wsock32.lib pcre.lib pcreposix.lib notes.lib libapr.lib libaprutil.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\..\..\..\pcre\lib" /libpath:"..\..\..\..\..\..\apr\Release" /libpath:"..\..\..\..\..\..\apr-util\Release" /libpath:"$(NOTESAPI)\lib\mswin32" !ENDIF 1.2 +70 -11 jakarta-tomcat-connectors/jk/native2/server/dsapi/test/test.c Index: test.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/dsapi/test/test.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- test.c 13 Nov 2003 17:11:36 -0000 1.1 +++ test.c 14 Nov 2003 13:08:23 -0000 1.2 @@ -1,4 +1,65 @@ -/* test.c */ +/* ========================================================================= * + * * + * The Apache Software License, Version 1.1 * + * * + * Copyright (c) 1999-2001 The Apache Software Foundation. * + * All rights reserved. * + * * + * ========================================================================= * + * * + * Redistribution and use in source and binary forms, with or without modi- * + * fication, are permitted provided that the following conditions are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice * + * notice, this list of conditions and the following disclaimer. * + * * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * 3. The end-user documentation included with the redistribution, if any, * + * must include the following acknowlegement: * + * * + * "This product includes software developed by the Apache Software * + * Foundation <http://www.apache.org/>." * + * * + * Alternately, this acknowlegement may appear in the software itself, if * + * and wherever such third-party acknowlegements normally appear. * + * * + * 4. The names "The Jakarta Project", "Jk", and "Apache Software * + * Foundation" must not be used to endorse or promote products derived * + * from this software without prior written permission. For written * + * permission, please contact <[EMAIL PROTECTED]>. * + * * + * 5. Products derived from this software may not be called "Apache" nor may * + * "Apache" appear in their names without prior written permission of the * + * Apache Software Foundation. * + * * + * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES * + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * + * THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY * + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * + * POSSIBILITY OF SUCH DAMAGE. * + * * + * ========================================================================= * + * * + * This software consists of voluntary contributions made by many indivi- * + * duals on behalf of the Apache Software Foundation. For more information * + * on the Apache Software Foundation, please see <http://www.apache.org/>. * + * * + * ========================================================================= */ + +/*************************************************************************** + * Description: Test harness for DSAPI plugin for Lotus Domino * + * Author: Andy Armstrong <[EMAIL PROTECTED]> * + * Version: $Revision$ * + ***************************************************************************/ #include <stdio.h> #include <string.h> @@ -12,14 +73,16 @@ unsigned int HttpFilterProc(FilterContext *context, unsigned int eventType, void *eventData); void TestMain(void); +/* Hardwired HTTP request. + */ + #define SERVER "localhost" #define PORT "80" #define URI "/examples/jsp/num/numguess.jsp" -#define VERSION "1.1" +#define HTTPVERSION "1.1" typedef struct _ServerContext { - char *rq; char *hdrs; } ServerContext; @@ -31,7 +94,7 @@ fr->method = kRequestGET; fr->URL = URI; - fr->version = VERSION; + fr->version = HTTPVERSION; fr->userName = NULL; fr->password = NULL; fr->clientCert = NULL; @@ -44,12 +107,9 @@ static int fcGetRequestContents(struct _FilterContext *context, char **contents, unsigned int *errID) { - ServerContext *sc = (ServerContext *) context->serverContext; - printf("fc.GetRequestContents(%p, %p, %p)\n", context, contents, errID); - - *contents = sc->rq; - return strlen(sc->rq) + 1; + *contents = ""; + return 0; } static int fcGetServerVariable(struct _FilterContext *context, char *name, void *buffer, @@ -65,7 +125,7 @@ } else if (strcmp(name, "REMOTE_ADDR") == 0) { strcpy((char *) buffer, "127.0.0.1"); } else if (strcmp(name, "SERVER_SOFTWARE") == 0) { - strcpy((char *) buffer, "TestHarness 1.0"); + strcpy((char *) buffer, "TestHarness/1.0"); } else { return 0; } @@ -124,7 +184,6 @@ ServerContext sc; int rc; - sc.rq = "GET " URI " HTTP/" VERSION; sc.hdrs = "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*\n" "Accept-Language: en-us\n" "User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)\n" 1.2 +2 -1 jakarta-tomcat-connectors/jk/native2/server/dsapi/test/printf_logger.c Index: printf_logger.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/server/dsapi/test/printf_logger.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- printf_logger.c 13 Nov 2003 17:11:36 -0000 1.1 +++ printf_logger.c 14 Nov 2003 13:08:23 -0000 1.2 @@ -59,7 +59,8 @@ * Description: Utility functions (mainly configuration) * * Author: Gal Shachor <[EMAIL PROTECTED]> * * Author: Henri Gomez <[EMAIL PROTECTED]> * - * Version: $Revision$ * + * Author: Andy Armstrong <[EMAIL PROTECTED]> * + * Version: $Revision$ * ***************************************************************************/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]