/* * Copyright 1995, 1998 Perforce Software. * * This file is part of WebKeeper, a perforce client apache module. * * License is hereby granted to use this software and distribute it * freely, as long as this copyright notice is retained and modifications * are clearly marked. * * ALL WARRANTIES ARE HEREBY DISCLAIMED. * * $Id: //public/perforce/webkeeper/mod_webkeep.h#2 $ */ #ifndef __WEBKEEPH #define __WEBKEEPH 1 /* #define DEBUG_webkeep 1 */ /* I didnt want to get into stdargs and varargs Hence a hack where I use debugS with "" strings when args are less than 3) */ #ifdef DEBUG_webkeep #define debug(x) fprintf(stderr, x) #define debugS(format,x,y,z) fprintf(stderr, format, x, y, z) #else #define debug(x) #define debugS(format,x,y,z) #endif /* * webkeep.h - glue mod_webkeep.c to the Perforce api via webkeep.cc * * This header file is for inclusion by mod_webkeep.c when building * webkeeper into an Apache web server. */ /* Define custom error codes to pass to apapche from mod_webkeep2.cc I dont want to include httpd.h in mod_webkeep2.cc since it causes redefinitions against p4api include files */ #define __WK_BAD_REQUEST -1 #define __WK_NOT_FOUND -2 #define __WK_SERVER_ERROR -3 typedef struct _WebKeepPrinter WebKeepPrinter; typedef struct _WebKeepConnect WebKeepConnect; /* * WebKeepConnect - pointers to configuration data stored by Apache */ struct _WebKeepConnect { char *port; /* WebKeepPort - default $P4PORT, perforce:1666 */ char *user; /* WebKeepUser - default $P4USER, $USERNAME */ char *pass; /* WebKeepPasswd - no default */ char *client; /* WebKeepClient - default $P4CLIENT, hostname */ int sync; /* WebKeepSync - Should client be sync'ed */ } ; /* * WebKeepPrinter - callbacks to Apache code */ struct _WebKeepPrinter { int status; void *closure; /* flags */ int ignoreerrors; int collectinfo; /* building directory */ int print; /* printing file */ /* counters */ int errorcount; /* directories and files (for directrory listing) */ void *files; void *dirs; /* pathType */ int isFile; int isDir; void (*data)(WebKeepPrinter *,const char*); void (*text)(WebKeepPrinter *,char *,int); void (*error)(WebKeepPrinter *,char *,int); void (*dir)(WebKeepPrinter *); } ; # ifdef CPLUSPLUS extern "C" { # endif void webKeepPrint( WebKeepConnect *p4, char *path, WebKeepPrinter *printer ); void webKeepSync( WebKeepConnect *p4, char *path, WebKeepPrinter *printer ); int webKeepFileExists( WebKeepConnect *p4, char *path ); int webKeepDirExists( WebKeepConnect *p4, char *path ); # ifdef CPLUSPLUS } # endif #endif
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 1844 | Chetan Patil |
Made following changes to the webkeeper code: - Directory listing (uses p4 dirs and files to build the listing) - If for a directory, the trailing slash is missing, redirect to a new url with a trailing slash (mod_dir code). - Debug statements for debugging - Bug fix where sync was being used unintialized (mod_webkeep2.cc). This has not been tested with the syncing capability of Webkeeper. - Code outputs http content type based on if the data is gif, jpeg or binary data; previously it only output octet-stream for all non-textual data. - Code tries to reduce the impact on the perforce server by caching some information between processing phases (isFile and isDir) - Misc Minor edits |