*
* Revisions :
* $Log: acconfig.h,v $
+ * Revision 1.9 2001/07/29 19:08:52 jongfoster
+ * Changing _CONFIG_H to CONFIG_H_INCLUDED.
+ * Also added protection against using a MinGW32 or CygWin version of
+ * config.h from within MS Visual C++
+ *
* Revision 1.8 2001/07/29 17:09:17 jongfoster
* Major changes to build system in order to fix these bugs:
* - pthreads under Linux was broken - changed -lpthread to -pthread
#undef VERSION
/*
- * Status of the code: alpha, beta or stable
+ * Status of the code: "alpha", "beta" or "stable".
*/
#undef CODE_STATUS
#undef STATIC_PCRS
/*
- * Allow JunkBuster to be "disabled" so it is just a normal non-blocking
- * non-anonymizing proxy. This is useful if you're trying to access a
- * blocked or broken site - just change the setting in the config file
- * and send a SIGHUP (UN*X), or use the handy "Disable" menu option (Windows
- * GUI).
+ * Allows the use of an ACL to control access to the proxy by IP address.
*/
-#undef TOGGLE
+#undef FEATURE_ACL
/*
- * If a stream is compressed via gzip (Netscape specific I think), then
- * it cannot be modified with Perl regexps. This forces it to be
- * uncompressed.
- */
-#undef DENY_GZIP
-
-/*
- * Enables statistics function.
+ * Allows the use of jar files to capture cookies.
*/
-#undef STATISTICS
+#undef FEATURE_COOKIE_JAR
/*
- * Bypass filtering for 1 page only
+ * If a stream is compressed via gzip, then it cannot be filtered through
+ * the PCRE regexps. (Commonly happens with Netscape browsers).
+ * This forces it to be uncompressed.
*/
-#undef FORCE_LOAD
+#undef FEATURE_DENY_GZIP
/*
* Locally redirect remote script-redirect URLs
*/
-#undef FAST_REDIRECTS
+#undef FEATURE_FAST_REDIRECTS
/*
- * Split the show-proxy-args page into a page for each config file.
- */
-#undef SPLIT_PROXY_ARGS
-
-/*
- * Kills JavaScript popups - window.open, onunload, etc.
+ * Bypass filtering for 1 page only
*/
-#undef KILLPOPUPS
+#undef FEATURE_FORCE_LOAD
/*
- * Support for webDAV - e.g. so Microsoft Outlook can access HotMail e-mail
+ * Allow blocking using images as well as HTML.
+ * If you do not define this then everything is blocked as HTML.
+ *
+ * Note that this is required if you want to use FEATURE_IMAGE_DETECT_MSIE.
*/
-#undef WEBDAV
+#undef FEATURE_IMAGE_BLOCKING
/*
* Detect image requests automatically for MSIE. Will fall back to
* other image-detection methods (i.e. "+image" permission) for other
* browsers.
*
- * You must also define IMAGE_BLOCKING to use this feature.
+ * You must also define FEATURE_IMAGE_BLOCKING to use this feature.
*
* It detects the following header pair as an image request:
*
* These limitations are due to IE making inconsistent choices
* about which "Accept:" header to send.
*/
-#undef DETECT_MSIE_IMAGES
+#undef FEATURE_IMAGE_DETECT_MSIE
/*
- * Allow blocking using images as well as HTML.
- * If you do not define this then everything is blocked as HTML.
- *
- * Note that this is required if you want to use DETECT_MSIE_IMAGES.
- */
-#undef IMAGE_BLOCKING
-
-/*
- * Allows the use of ACL files to control access to the proxy by IP address.
+ * Kills JavaScript popups - window.open, onunload, etc.
*/
-#undef ACL_FILES
+#undef FEATURE_KILL_POPUPS
/*
- * Allows the use of trust files.
+ * Use POSIX threads instead of native threads.
*/
-#undef TRUST_FILES
+#undef FEATURE_PTHREAD
/*
- * Allows the use of jar files to capture cookies.
+ * Enables statistics function.
*/
-#undef JAR_FILES
+#undef FEATURE_STATISTICS
/*
- * Define this to use the Windows GUI for editing the blocklist.
- * FIXME: This feature is only partially implemented and does not work
- * FIXME: This #define can never be set by ./configure.
+ * Allow JunkBuster to be "disabled" so it is just a normal non-blocking
+ * non-anonymizing proxy. This is useful if you're trying to access a
+ * blocked or broken site - just change the setting in the config file,
+ * or use the handy "Disable" menu option in the Windows GUI.
*/
-#undef WIN_GUI_EDIT
+#undef FEATURE_TOGGLE
/*
- * Use POSIX threads instead of native threads.
+ * Allows the use of trust files.
*/
-#undef FEATURE_PTHREAD
+#undef FEATURE_TRUST
/*
* Defined on Solaris only. Makes the system libraries thread safe.
-const char actions_rcs[] = "$Id: actions.c,v 1.7 2001/06/09 10:55:28 jongfoster Exp $";
+const char actions_rcs[] = "$Id: actions.c,v 1.8 2001/06/29 13:19:52 oes Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/actions.c,v $
*
* Revisions :
* $Log: actions.c,v $
+ * Revision 1.8 2001/06/29 13:19:52 oes
+ * Removed logentry from cancelled commit
+ *
* Revision 1.7 2001/06/09 10:55:28 jongfoster
* Changing BUFSIZ ==> BUFFER_SIZE
*
alias_list = next;
}
-#ifndef SPLIT_PROXY_ARGS
- if (!suppress_blocklists)
- {
- fs->proxy_args = strsav(fs->proxy_args, "</pre>");
- }
-#endif /* ndef SPLIT_PROXY_ARGS */
-
/* the old one is now obsolete */
if (current_actions_file)
{
-const char cgi_rcs[] = "$Id: cgi.c,v 1.11 2001/07/18 17:24:37 oes Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.12 2001/07/29 18:47:05 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgi.c,v $
*
* Revisions :
* $Log: cgi.c,v $
+ * Revision 1.12 2001/07/29 18:47:05 jongfoster
+ * Adding missing #include "loadcfg.h"
+ *
* Revision 1.11 2001/07/18 17:24:37 oes
* Changed to conform to new pcrs interface
*
int i;
struct map *exports = default_exports(csp, "show-status");
-#ifdef SPLIT_PROXY_ARGS
FILE * fp;
char buf[BUFFER_SIZE];
char * p;
}
break;
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
case 't':
if (csp->tlist)
{
file_description = "Trust List";
}
break;
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
}
if (NULL != filename)
}
-#endif /* def SPLIT_PROXY_ARGS */
-
exports = map(exports, "redirect-url", 1, REDIRECT_URL, 1);
s = NULL;
s = show_defines();
exports = map(exports, "defines", 1, s, 0);
-#ifdef STATISTICS
+#ifdef FEATURE_STATISTICS
exports = add_stats(exports);
-#else
+#else /* ndef FEATURE_STATISTICS */
exports = map_block_killer(exports, "statistics");
-#endif /* ndef STATISTICS */
-
-#ifdef SPLIT_PROXY_ARGS
+#endif /* ndef FEATURE_STATISTICS */
exports = map_block_killer(exports, "no-split-args");
exports = map(exports, "re-filter-filename", 1, "None specified", 1);
}
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
if (csp->tlist)
{
exports = map(exports, "trust-filename", 1, csp->tlist->filename, 1);
}
#else
exports = map_block_killer(exports, "trust-support");
-#endif /* ndef TRUST_FILES */
-
-#else /* ifndef SPLIT_PROXY_ARGS */
- exports = map_block_killer(exports, "split-args");
-
- if (csp->clist)
- {
- map(exports, "clist", 1, csp->clist->proxy_args , 1);
- }
-
- if (csp->rlist)
- {
- map(exports, "rlist", 1, csp->rlist->proxy_args , 1);
- }
-
-#ifdef TRUST_FILES
- if (csp->tlist)
- {
- map(exports, "tlist", 1, csp->tlist->proxy_args , 1);
- }
-#endif /* def TRUST_FILES */
-
-#endif /* ndef SPLIT_PROXY_ARGS */
+#endif /* ndef FEATURE_TRUST */
rsp->body = fill_template(csp, "show-status", exports);
free_map(exports);
}
-#ifdef STATISTICS
+#ifdef FEATURE_STATISTICS
/*********************************************************************
*
* Function : add_stats
return(exports);
}
-#endif /* def STATISTICS */
+#endif /* def FEATURE_STATISTICS */
/*
Local Variables:
#ifndef CGI_H_INCLUDED
#define CGI_H_INCLUDED
-#define CGI_H_VERSION "$Id: cgi.h,v 1.6 2001/06/29 21:45:41 oes Exp $"
+#define CGI_H_VERSION "$Id: cgi.h,v 1.7 2001/07/29 18:43:08 jongfoster Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgi.h,v $
*
* Revisions :
* $Log: cgi.h,v $
+ * Revision 1.7 2001/07/29 18:43:08 jongfoster
+ * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to
+ * ANSI C rules.
+ *
* Revision 1.6 2001/06/29 21:45:41 oes
* Indentation, CRLF->LF, Tab-> Space
*
extern char *make_menu(const char *self);
extern char *dump_map(struct map *map);
-#ifdef STATISTICS
+#ifdef FEATURE_STATISTICS
extern struct map *add_stats(struct map *exports);
-#endif /* def STATISTICS */
+#endif /* def FEATURE_STATISTICS */
/*
-const char errlog_rcs[] = "$Id: errlog.c,v 1.14 2001/07/19 19:03:48 haroon Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 1.15 2001/07/29 17:41:10 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.c,v $
*
* Revisions :
* $Log: errlog.c,v $
+ * Revision 1.15 2001/07/29 17:41:10 jongfoster
+ * Now prints thread ID for each message (pthreads only)
+ *
* Revision 1.14 2001/07/19 19:03:48 haroon
* - Added case for LOG_LEVEL_POPUPS
*
case LOG_LEVEL_RE_FILTER:
outc = sprintf(outbuf, "IJB(%d) Re-Filter: ", this_thread);
break;
-#ifdef FORCE_LOAD
+#ifdef FEATURE_FORCE_LOAD
case LOG_LEVEL_FORCE:
outc = sprintf(outbuf, "IJB(%d) Force: ", this_thread);
break;
-#endif /* def FORCE_LOAD */
-#ifdef FAST_REDIRECTS
+#endif /* def FEATURE_FORCE_LOAD */
+#ifdef FEATURE_FAST_REDIRECTS
case LOG_LEVEL_REDIRECTS:
outc = sprintf(outbuf, "IJB(%d) Redirect: ", this_thread);
break;
-#endif /* def FAST_REDIRECTS */
+#endif /* def FEATURE_FAST_REDIRECTS */
case LOG_LEVEL_DEANIMATE:
outc = sprintf(outbuf, "IJB(%d) Gif-Deanimate: ", this_thread);
break;
outc = 0;
outbuf[0] = '\0';
break;
-#ifdef KILLPOPUPS
+#ifdef FEATURE_KILL_POPUPS
case LOG_LEVEL_POPUPS:
outc = sprintf(outbuf, "IJB(%d) Kill-Popups: ", this_thread);
break;
-#endif /* def KILLPOPUPS */
+#endif /* def FEATURE_KILL_POPUPS */
default:
outc = sprintf(outbuf, "IJB(%d) UNKNOWN LOG TYPE(%d): ", this_thread, loglevel);
break;
#ifndef ERRLOG_H_INCLUDED
#define ERRLOG_H_INCLUDED
-#define ERRLOG_H_VERSION "$Id: errlog.h,v 1.7 2001/07/19 19:02:53 haroon Exp $"
+#define ERRLOG_H_VERSION "$Id: errlog.h,v 1.8 2001/07/29 18:43:08 jongfoster Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.h,v $
*
* Revisions :
* $Log: errlog.h,v $
+ * Revision 1.8 2001/07/29 18:43:08 jongfoster
+ * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to
+ * ANSI C rules.
+ *
* Revision 1.7 2001/07/19 19:02:53 haroon
* Added define for LOG_LEVEL_POPUPS
*
#define LOG_LEVEL_IO 0x0004
#define LOG_LEVEL_HEADER 0x0008
#define LOG_LEVEL_LOG 0x0010
-#ifdef FORCE_LOAD
+#ifdef FEATURE_FORCE_LOAD
#define LOG_LEVEL_FORCE 0x0020
-#endif /* def FORCE_LOAD */
+#endif /* def FEATURE_FORCE_LOAD */
#define LOG_LEVEL_RE_FILTER 0x0040
-#ifdef FAST_REDIRECTS
+#ifdef FEATURE_FAST_REDIRECTS
#define LOG_LEVEL_REDIRECTS 0x0080
-#endif /* def FAST_REDIRECTS */
+#endif /* def FEATURE_FAST_REDIRECTS */
#define LOG_LEVEL_DEANIMATE 0x0100
#define LOG_LEVEL_CLF 0x0200 /* Common Log File format */
-#ifdef KILLPOPUPS
+#ifdef FEATURE_KILL_POPUPS
#define LOG_LEVEL_POPUPS 0x0400 /* Kill Popups */
-#endif /* def KILLPOPUPS */
+#endif /* def FEATURE_KILL_POPUPS */
/* Following are always on: */
#define LOG_LEVEL_INFO 0x1000
-const char filters_rcs[] = "$Id: filters.c,v 1.24 2001/07/25 17:22:51 oes Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.25 2001/07/26 10:09:46 oes Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/filters.c,v $
*
* Revisions :
* $Log: filters.c,v $
+ * Revision 1.25 2001/07/26 10:09:46 oes
+ * Made browser detection a little less naive
+ *
* Revision 1.24 2001/07/25 17:22:51 oes
* Added workaround for Netscape bug that prevents display of page when loading a component fails.
*
#define ijb_isdigit(__X) isdigit((int)(unsigned char)(__X))
-#ifdef ACL_FILES
+#ifdef FEATURE_ACL
/*********************************************************************
*
* Function : block_acl
return(0);
}
-#endif /* def ACL_FILES */
+#endif /* def FEATURE_ACL */
/*********************************************************************
*********************************************************************/
struct http_response *block_url(struct client_state *csp)
{
+#ifdef FEATURE_IMAGE_BLOCKING
char *p;
+#endif /* def FEATURE_IMAGE_BLOCKING */
struct http_response *rsp;
struct map *exports = NULL;
* If it's an image-url, send back an image or redirect
* as specified by the relevant +image action
*/
-#ifdef IMAGE_BLOCKING
+#ifdef FEATURE_IMAGE_BLOCKING
if (((csp->action->flags & ACTION_IMAGE_BLOCKER) != 0)
&& is_imageurl(csp))
{
}
}
else
-#endif /* def IMAGE_BLOCKING */
+#endif /* def FEATURE_IMAGE_BLOCKING */
/*
* Else, generate an HTML "blocked" message:
{
exports = default_exports(csp, NULL);
-#ifdef FORCE_LOAD
+#ifdef FEATURE_FORCE_LOAD
exports = map(exports, "force-prefix", 1, FORCE_PREFIX, 1);
-#else
+#else /* ifndef FEATURE_FORCE_LOAD */
exports = map_block_killer(exports, "force-support");
-#endif /* ndef FORCE_LOAD */
+#endif /* ndef FEATURE_FORCE_LOAD */
exports = map(exports, "hostport", 1, csp->http->hostport, 1);
exports = map(exports, "hostport-html", 1, html_encode(csp->http->hostport), 0);
}
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
/*********************************************************************
*
* Function : trust_url FIXME: I should be called distrust_url
/*
* Export the force prefix or the force conditional block killer
*/
-#ifdef FORCE_LOAD
+#ifdef FEATURE_FORCE_LOAD
exports = map(exports, "force-prefix", 1, FORCE_PREFIX, 1);
-#else
+#else /* ifndef FEATURE_FORCE_LOAD */
exports = map_block_killer(exports, "force-support");
-#endif /* ndef FORCE_LOAD */
+#endif /* ndef FEATURE_FORCE_LOAD */
/*
* Build the response
return(finish_http_response(rsp));
}
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
-#ifdef FAST_REDIRECTS
+#ifdef FEATURE_FAST_REDIRECTS
/*********************************************************************
*
* Function : redirect_url
}
}
-#endif /* def FAST_REDIRECTS */
+#endif /* def FEATURE_FAST_REDIRECTS */
-#ifdef IMAGE_BLOCKING
+#ifdef FEATURE_IMAGE_BLOCKING
/*********************************************************************
*
* Function : is_imageurl
*
* Description : Given a URL, decide whether it is an image or not,
* using either the info from a previous +image action
- * or, #ifdef DETECT_MSIE_IMAGES, the info from the
- * browser's accept header.
+ * or, #ifdef FEATURE_IMAGE_DETECT_MSIE, the info from
+ * the browser's accept header.
*
* Parameters :
* 1 : csp = Current client state (buffers, headers, etc...)
*********************************************************************/
int is_imageurl(struct client_state *csp)
{
-#ifdef DETECT_MSIE_IMAGES
+#ifdef FEATURE_IMAGE_DETECT_MSIE
if ((csp->accept_types
& (ACCEPT_TYPE_IS_MSIE|ACCEPT_TYPE_MSIE_IMAGE|ACCEPT_TYPE_MSIE_HTML))
== (ACCEPT_TYPE_IS_MSIE|ACCEPT_TYPE_MSIE_IMAGE))
{
return 0;
}
-#endif
+#endif /* def FEATURE_IMAGE_DETECT_MSIE */
return ((csp->action->flags & ACTION_IMAGE) != 0);
}
-#endif /* def IMAGE_BLOCKING */
+#endif /* def FEATURE_IMAGE_BLOCKING */
-#ifdef TRUST_FILES
+#ifdef FEATURE_COOKIE_JAR
/*********************************************************************
*
* Function : is_untrusted_url
}
return(1);
}
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_COOKIE_JAR */
/*********************************************************************
#ifndef FILTERS_H_INCLUDED
#define FILTERS_H_INCLUDED
-#define FILTERS_H_VERSION "$Id: filters.h,v 1.11 2001/07/13 14:00:18 oes Exp $"
+#define FILTERS_H_VERSION "$Id: filters.h,v 1.12 2001/07/29 19:01:11 jongfoster Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/filters.h,v $
*
* Revisions :
* $Log: filters.h,v $
+ * Revision 1.12 2001/07/29 19:01:11 jongfoster
+ * Changed _FILENAME_H to FILENAME_H_INCLUDED.
+ * Added forward declarations for needed structures.
+ *
* Revision 1.11 2001/07/13 14:00:18 oes
* - Introduced gif_deanimate_response
* - Renamed re_process_buffer to pcrs_filter_response
/*
* ACL checking
*/
-#ifdef ACL_FILES
+#ifdef FEATURE_ACL
extern int block_acl(struct access_control_addr *dst, struct client_state *csp);
extern int acl_addr(char *aspec, struct access_control_addr *aca);
-#endif /* def ACL_FILES */
+#endif /* def FEATURE_ACL */
/*
* Interceptors
*/
extern struct http_response *block_url(struct client_state *csp);
extern struct http_response *redirect_url(struct client_state *csp);
-#ifdef TRUST_FILES
+#ifdef FEATURE_COOKIE_JAR
extern struct http_response *trust_url(struct client_state *csp);
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_COOKIE_JAR */
/*
* Request inspectors
*/
-#ifdef TRUST_FILES
+#ifdef FEATURE_COOKIE_JAR
extern int is_untrusted_url(struct client_state *csp);
-#endif /* def TRUST_FILES */
-#ifdef IMAGE_BLOCKING
+#endif /* def FEATURE_COOKIE_JAR */
+#ifdef FEATURE_IMAGE_BLOCKING
extern int is_imageurl(struct client_state *csp);
-#endif /* def IMAGE_BLOCKING */
+#endif /* def FEATURE_IMAGE_BLOCKING */
/*
* Determining applicable actions
-const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.14 2001/07/18 13:47:59 oes Exp $";
+const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.15 2001/07/29 17:40:43 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $
*
* Revisions :
* $Log: jbsockets.c,v $
+ * Revision 1.15 2001/07/29 17:40:43 jongfoster
+ * Fixed compiler warning by adding a cast
+ *
* Revision 1.14 2001/07/18 13:47:59 oes
* Eliminated dirty hack for getsockbyname()
*
int flags;
#endif /* !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) */
-#ifdef ACL_FILES
+#ifdef FEATURE_ACL
struct access_control_addr dst[1];
-#endif /* def ACL_FILES */
+#endif /* def FEATURE_ACL */
memset((char *)&inaddr, 0, sizeof inaddr);
return(-1);
}
-#ifdef ACL_FILES
+#ifdef FEATURE_ACL
dst->addr = ntohl(addr);
dst->port = portnum;
errno = EPERM;
return(-1);
}
-#endif /* def ACL_FILES */
+#endif /* def FEATURE_ACL */
inaddr.sin_addr.s_addr = addr;
inaddr.sin_family = AF_INET;
-const char jcc_rcs[] = "$Id: jcc.c,v 1.32 2001/07/29 18:47:05 jongfoster Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.33 2001/07/29 19:32:00 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
*
* Revisions :
* $Log: jcc.c,v $
+ * Revision 1.33 2001/07/29 19:32:00 jongfoster
+ * Renaming _main() [mingw32 only] to real_main(), for ANSI compliance.
+ *
* Revision 1.32 2001/07/29 18:47:05 jongfoster
* Adding missing #include "loadcfg.h"
*
struct client_state clients[1];
struct file_list files[1];
-#ifdef STATISTICS
+#ifdef FEATURE_STATISTICS
int urls_read = 0; /* total nr of urls read inc rejected */
int urls_rejected = 0; /* total nr of urls rejected */
-#endif /* def STATISTICS */
+#endif /* def FEATURE_STATISTICS */
static void listen_loop(void);
static void chat(struct client_state *csp)
{
/*
- * This next lines are a little ugly, but they simplifies the if statements below.
- * Basically if TOGGLE, then we want the if to test "csp->toggled_on", else we don't
- * And if FORCE_LOAD, then we want the if to test "csp->toggled_on", else we don't
+ * This next lines are a little ugly, but they simplifies the if statements
+ * below. Basically if TOGGLE, then we want the if to test "csp->toggled_on",
+ * else we don't. And if FEATURE_FORCE_LOAD, then we want the if to test
+ * "csp->toggled_on", else we don't
*/
-#ifdef TOGGLE
+#ifdef FEATURE_TOGGLE
# define IS_TOGGLED_ON_AND (csp->toggled_on) &&
-#else /* ifndef TOGGLE */
+#else /* ifndef FEATURE_TOGGLE */
# define IS_TOGGLED_ON_AND
-#endif /* ndef TOGGLE */
-#ifdef FORCE_LOAD
+#endif /* ndef FEATURE_TOGGLE */
+#ifdef FEATURE_FORCE_LOAD
# define IS_NOT_FORCED_AND (!csp->force) &&
-#else /* ifndef FORCE_LOAD */
+#else /* ifndef FEATURE_FORCE_LOAD */
# define IS_NOT_FORCED_AND
-#endif /* def FORCE_LOAD */
+#endif /* def FEATURE_FORCE_LOAD */
#define IS_ENABLED_AND IS_TOGGLED_ON_AND IS_NOT_FORCED_AND
int byte_count = 0;
const struct forward_spec * fwd;
struct http_request *http;
-#ifdef KILLPOPUPS
+#ifdef FEATURE_KILL_POPUPS
int block_popups; /* bool, 1==will block popups */
int block_popups_now = 0; /* bool, 1==currently blocking popups */
-#endif /* def KILLPOPUPS */
+#endif /* def FEATURE_KILL_POPUPS */
int pcrs_filter; /* bool, 1==will filter through pcrs */
int gif_deanimate; /* bool, 1==will deanimate gifs */
continue; /* more to come! */
}
-#ifdef FORCE_LOAD
+#ifdef FEATURE_FORCE_LOAD
/* If this request contains the FORCE_PREFIX,
* better get rid of it now and set the force flag --oes
*/
{
csp->force = 0;
}
-#endif /* def FORCE_LOAD */
+#endif /* def FEATURE_FORCE_LOAD */
parse_http_request(req, http, csp);
freez(req);
/* decide what we're to do with cookies */
-#ifdef TOGGLE
+#ifdef FEATURE_TOGGLE
if (!csp->toggled_on)
{
/* Most compatible set of actions (i.e. none) */
init_current_action(csp->action);
}
else
-#endif /* ndef TOGGLE */
+#endif /* ndef FEATURE_TOGGLE */
{
url_actions(http, csp);
}
-#ifdef JAR_FILES
+#ifdef FEATURE_COOKIE_JAR
/*
* If we're logging cookies in a cookie jar, and the user has not
* supplied any wafers, and the user has not told us to suppress the
{
enlist(csp->action->multi[ACTION_MULTI_WAFER], VANILLA_WAFER);
}
-#endif /* def JAR_FILES */
+#endif /* def FEATURE_COOKIE_JAR */
-#ifdef KILLPOPUPS
+#ifdef FEATURE_KILL_POPUPS
block_popups = ((csp->action->flags & ACTION_NO_POPUPS) != 0);
-#endif /* def KILLPOPUPS */
+#endif /* def FEATURE_KILL_POPUPS */
pcrs_filter = (csp->rlist != NULL) && /* There are expressions to be used */
((csp->action->flags & ACTION_FILTER) != 0);
( NULL != (rsp = block_url(csp)))
/* ..or untrusted */
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
|| ( NULL != (rsp = trust_url(csp)))
-#endif
+#endif /* def FEATURE_TRUST */
/* ..or a fast redirect kicked in */
-#ifdef FAST_REDIRECTS
+#ifdef FEATURE_FAST_REDIRECTS
|| (((csp->action->flags & ACTION_FAST_REDIRECTS) != 0) &&
(NULL != (rsp = redirect_url(csp))))
-#endif /* def FAST_REDIRECTS */
+#endif /* def FEATURE_FAST_REDIRECTS */
))
)
{
log_error(LOG_LEVEL_ERROR, "write to: %s failed: %E", http->host);
}
-#ifdef STATISTICS
+#ifdef FEATURE_STATISTICS
/* Count as a rejected request */
csp->rejected = 1;
-#endif /* def STATISTICS */
+#endif /* def FEATURE_STATISTICS */
/* Log (FIXME: All intercept reasons apprear as "crunch" with Status 200) */
log_error(LOG_LEVEL_GPC, "%s%s crunch!", http->hostport, http->path);
*/
buf[n] = '\0';
-#ifdef KILLPOPUPS
+#ifdef FEATURE_KILL_POPUPS
/* Filter the popups on this read. */
if (block_popups_now)
{
filter_popups(buf, n);
}
-#endif /* def KILLPOPUPS */
+#endif /* def FEATURE_KILL_POPUPS */
/* Normally, this would indicate that we've read
* as much as the server has sent us and we can
* may be in the buffer)
*/
-#ifdef KILLPOPUPS
+#ifdef FEATURE_KILL_POPUPS
/* Start blocking popups if appropriate. */
if ((csp->content_type & CT_TEXT) && /* It's a text / * MIME-Type */
filter_popups(csp->iob->cur, csp->iob->eod - csp->iob->cur);
}
-#endif /* def KILLPOPUPS */
+#endif /* def FEATURE_KILL_POPUPS */
/* Buffer and pcrs filter this if appropriate. */
log_error(LOG_LEVEL_CONNECT, "OK");
}
-#if defined(TOGGLE)
+#ifdef FEATURE_TOGGLE
/* by haroon - most of credit to srt19170 */
csp->toggled_on = g_bToggleIJB;
-#endif
+#endif /* def FEATURE_TOGGLE */
if (run_loader(csp))
{
/* Never get here - LOG_LEVEL_FATAL causes program exit */
}
-#ifdef ACL_FILES
+#ifdef FEATURE_ACL
if (block_acl(NULL,csp))
{
log_error(LOG_LEVEL_CONNECT, "Connection dropped due to ACL");
freez(csp);
continue;
}
-#endif /* def ACL_FILES */
+#endif /* def FEATURE_ACL */
/* add it to the list of clients */
csp->next = clients->next;
#ifndef JCC_H_INCLUDED
#define JCC_H_INCLUDED
-#define JCC_H_VERSION "$Id: jcc.h,v 1.4 2001/07/29 18:58:15 jongfoster Exp $"
+#define JCC_H_VERSION "$Id: jcc.h,v 1.5 2001/07/29 19:32:00 jongfoster Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.h,v $
*
* Revisions :
* $Log: jcc.h,v $
+ * Revision 1.5 2001/07/29 19:32:00 jongfoster
+ * Renaming _main() [mingw32 only] to real_main(), for ANSI compliance.
+ *
* Revision 1.4 2001/07/29 18:58:15 jongfoster
* Removing nested #includes, adding forward declarations for needed
* structures, and changing the #define _FILENAME_H to FILENAME_H_INCLUDED.
/* Global variables */
-#ifdef STATISTICS
+#ifdef FEATURE_STATISTICS
extern int urls_read;
extern int urls_rejected;
-#endif /*def STATISTICS*/
+#endif /*def FEATURE_STATISTICS*/
extern struct client_state clients[];
-const char killpopup_rcs[] = "$Id: killpopup.c,v 1.6 2001/07/19 19:11:35 haroon Exp $";
+const char killpopup_rcs[] = "$Id: killpopup.c,v 1.7 2001/07/20 19:29:25 haroon Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/killpopup.c,v $
*
* Revisions :
* $Log: killpopup.c,v $
+ * Revision 1.7 2001/07/20 19:29:25 haroon
+ * - In v1.5 forgot to add that I implemented LOG_LEVEL_POPUPS in errlog.c,
+ * errlog.h and killpopup.c. In that case, it is superfluous to have define for
+ * POPUP_VERBOSE, so I removed the defines and logging is now done
+ * via log_error(LOG_LEVEL_POPUPS, ....)
+ *
* Revision 1.6 2001/07/19 19:11:35 haroon
* - Implemented Guy's idea of replacing window.open( with 1;''.concat(
* - Implemented Guy's idea of replacing .resizeTo( with .scrollTo(
const char killpopup_h_rcs[] = KILLPOPUP_H_VERSION;
-#ifdef KILLPOPUPS
+#ifdef FEATURE_KILL_POPUPS
/*********************************************************************
*
}
-#endif /* def KILLPOPUPS */
+#endif /* def FEATURE_KILL_POPUPS */
/*
Local Variables:
#ifndef KILLPOPUP_H_INCLUDED
#define KILLPOPUP_H_INCLUDED
-#define KILLPOPUP_H_VERSION "$Id: killpopup.h,v 1.2 2001/05/20 01:21:20 jongfoster Exp $"
+#define KILLPOPUP_H_VERSION "$Id: killpopup.h,v 1.3 2001/07/29 18:59:21 jongfoster Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/killpopup.h,v $
*
* Revisions :
* $Log: killpopup.h,v $
+ * Revision 1.3 2001/07/29 18:59:21 jongfoster
+ * - Changing #define _KILLPOPUP_H to KILLPOPUP_H_INCLUDED
+ * - Adding extern "C" {}
+ *
* Revision 1.2 2001/05/20 01:21:20 jongfoster
* Version 2.9.4 checkin.
* - Merged popupfile and cookiefile, and added control over PCRS
extern "C" {
#endif
-#ifdef KILLPOPUPS
+#ifdef FEATURE_KILL_POPUPS
extern void filter_popups(char *buff, int size);
-#endif /* def KILLPOPUPS */
+#endif /* def FEATURE_KILL_POPUPS */
/* Revision control strings from this header and associated .c file */
extern const char killpopup_rcs[];
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.18 2001/07/13 14:01:14 oes Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.19 2001/07/15 17:45:16 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
*
* Revisions :
* $Log: loadcfg.c,v $
+ * Revision 1.19 2001/07/15 17:45:16 jongfoster
+ * Removing some unused #includes
+ *
* Revision 1.18 2001/07/13 14:01:14 oes
* - Removed all #ifdef PCRS
* - Removed vim-settings
#define ijb_isupper(__X) isupper((int)(unsigned char)(__X))
#define ijb_tolower(__X) tolower((int)(unsigned char)(__X))
-#ifdef TOGGLE
+#ifdef FEATURE_TOGGLE
/* by haroon - indicates if ijb is enabled */
int g_bToggleIJB = 1; /* JunkBusters is enabled by default. */
-#endif
+#endif /* def FEATURE_TOGGLE */
/* The filename of the configfile */
const char *configfile = NULL;
{
struct configuration_spec * config = (struct configuration_spec *)data;
struct forward_spec *cur_fwd = config->forward;
-#ifdef ACL_FILES
+#ifdef FEATURE_ACL
struct access_control_list *cur_acl = config->acl;
while (cur_acl != NULL)
cur_acl = next_acl;
}
config->acl = NULL;
-#endif /* def ACL_FILES */
+#endif /* def FEATURE_ACL */
while (cur_fwd != NULL)
{
}
config->forward = NULL;
-#ifdef JAR_FILES
+#ifdef FEATURE_COOKIE_JAR
if ( NULL != config->jar )
{
fclose( config->jar );
config->jar = NULL;
}
-#endif /* def JAR_FILES */
+#endif /* def FEATURE_COOKIE_JAR */
freez((char *)config->confdir);
freez((char *)config->logdir);
freez((char *)config->proxy_info_url);
freez((char *)config->proxy_args);
-#ifdef JAR_FILES
+#ifdef FEATURE_COOKIE_JAR
freez((char *)config->jarfile);
-#endif /* def JAR_FILES */
-
-#ifndef SPLIT_PROXY_ARGS
- freez((char *)config->suppress_message);
-#endif /* ndef SPLIT_PROXY_ARGS */
+#endif /* def FEATURE_COOKIE_JAR */
freez((char *)config->re_filterfile);
log_error(LOG_LEVEL_INFO, "loading configuration file '%s':", configfile);
-#ifdef TOGGLE
+#ifdef FEATURE_TOGGLE
g_bToggleIJB = 1;
-#endif
+#endif /* def FEATURE_TOGGLE */
fs->f = config = (struct configuration_spec *)zalloc(sizeof(*config));
char cmd[BUFFER_SIZE];
char arg[BUFFER_SIZE];
char tmp[BUFFER_SIZE];
-#ifdef ACL_FILES
+#ifdef FEATURE_ACL
struct access_control_list *cur_acl;
-#endif /* def ACL_FILES */
+#endif /* def FEATURE_ACL */
struct forward_spec *cur_fwd;
int vec_count;
char *vec[3];
/****************************************************************************
* deny-access source-ip[/significant-bits] [dest-ip[/significant-bits]]
****************************************************************************/
-#ifdef ACL_FILES
+#ifdef FEATURE_ACL
case hash_deny_access:
vec_count = ssplit(arg, " \t", vec, SZ(vec), 1, 1);
config->acl = cur_acl;
continue;
-#endif /* def ACL_FILES */
+#endif /* def FEATURE_ACL */
/****************************************************************************
* forward url-pattern (.|http-proxy-host[:port])
* jarfile jar-file-name
* In logdir by default
****************************************************************************/
-#ifdef JAR_FILES
+#ifdef FEATURE_COOKIE_JAR
case hash_jarfile :
freez((char *)config->jarfile);
config->jarfile = make_path(config->logdir, arg);
continue;
-#endif /* def JAR_FILES */
+#endif /* def FEATURE_COOKIE_JAR */
/****************************************************************************
* listen-address [ip][:port]
/****************************************************************************
* permit-access source-ip[/significant-bits] [dest-ip[/significant-bits]]
****************************************************************************/
-#ifdef ACL_FILES
+#ifdef FEATURE_ACL
case hash_permit_access:
vec_count = ssplit(arg, " \t", vec, SZ(vec), 1, 1);
config->acl = cur_acl;
continue;
-#endif /* def ACL_FILES */
+#endif /* def FEATURE_ACL */
/****************************************************************************
* proxy-info-url url
config->multi_threaded = 0;
continue;
-/****************************************************************************
- * FIXME: Document this FIXME2: Shouldn't we throw this out? --oes
- ****************************************************************************/
-#ifndef SPLIT_PROXY_ARGS
- case hash_suppress_blocklists :
- if (arg[0] != '\0')
- {
- config->suppress_message = strdup(arg);
- }
- else
- {
- /* There will be NO reference in proxy-args. */
- config->suppress_message = NULL;
- }
-
- config->suppress_blocklists = 1;
- continue;
-#endif /* ndef SPLIT_PROXY_ARGS */
-
/****************************************************************************
* toggle (0|1)
****************************************************************************/
-#ifdef TOGGLE
+#ifdef FEATURE_TOGGLE
case hash_toggle :
g_bToggleIJB = atoi(arg);
continue;
-#endif /* def TOGGLE */
+#endif /* def FEATURE_TOGGLE */
/****************************************************************************
* trust-info-url url
****************************************************************************/
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
case hash_trust_info_url :
enlist(config->trust_info, arg);
continue;
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
/****************************************************************************
* trustfile filename
* (In confdir by default.)
****************************************************************************/
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
case hash_trustfile :
freez((char *)config->trustfile);
config->trustfile = make_path(config->confdir, arg);
continue;
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
/****************************************************************************
/****************************************************************************/
/* Warnings about unsupported features */
/****************************************************************************/
-#ifndef ACL_FILES
+#ifndef FEATURE_ACL
case hash_deny_access:
-#endif /* ndef ACL_FILES */
-#ifndef JAR_FILES
+#endif /* ndef FEATURE_ACL */
+#ifndef FEATURE_COOKIE_JAR
case hash_jarfile :
-#endif /* ndef JAR_FILES */
-#ifndef ACL_FILES
+#endif /* ndef FEATURE_COOKIE_JAR */
+#ifndef FEATURE_ACL
case hash_permit_access:
-#endif /* ndef ACL_FILES */
-#ifdef SPLIT_PROXY_ARGS
- case hash_suppress_blocklists :
-#endif /* def SPLIT_PROXY_ARGS */
-#ifndef TOGGLE
+#endif /* ndef FEATURE_ACL */
+#ifndef FEATURE_TOGGLE
case hash_toggle :
-#endif /* ndef TOGGLE */
-#ifndef TRUST_FILES
+#endif /* ndef FEATURE_TOGGLE */
+#ifndef FEATURE_TRUST
case hash_trustfile :
case hash_trust_info_url :
-#endif /* ndef TRUST_FILES */
+#endif /* ndef FEATURE_TRUST */
#ifndef _WIN_CONSOLE
case hash_hide_console :
add_loader(load_re_filterfile, config);
}
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
if (config->trustfile)
{
add_loader(load_trustfile, config);
}
-#endif
+#endif /* def FEATURE_TRUST */
-#ifdef JAR_FILES
+#ifdef FEATURE_COOKIE_JAR
if ( NULL != config->jarfile )
{
if ( NULL == (config->jar = fopen(config->jarfile, "a")) )
}
setbuf(config->jar, NULL);
}
-#endif /* def JAR_FILES */
+#endif /* def FEATURE_COOKIE_JAR */
if ( NULL == config->haddr )
{
}
freez(fake_csp);
-#ifndef SPLIT_PROXY_ARGS
- if (!suppress_blocklists)
- {
- fs->proxy_args = strsav(fs->proxy_args, "</pre>");
- }
-#endif /* ndef SPLIT_PROXY_ARGS */
-
/* FIXME: this is a kludge for win32 */
#if defined(_WIN32) && !defined (_WIN_CONSOLE)
g_actions_file = config->actions_file;
g_re_filterfile = config->re_filterfile;
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
g_trustfile = config->trustfile;
-#endif
+#endif /* def FEATURE_TRUST */
#endif /* defined(_WIN32) && !defined (_WIN_CONSOLE) */
#ifndef LOADCFG_H_INCLUDED
#define LOADCFG_H_INCLUDED
-#define LOADCFG_H_VERSION "$Id: loadcfg.h,v 1.5 2001/05/26 00:28:36 jongfoster Exp $"
+#define LOADCFG_H_VERSION "$Id: loadcfg.h,v 1.6 2001/07/29 18:58:15 jongfoster Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loadcfg.h,v $
*
* Revisions :
* $Log: loadcfg.h,v $
+ * Revision 1.6 2001/07/29 18:58:15 jongfoster
+ * Removing nested #includes, adding forward declarations for needed
+ * structures, and changing the #define _FILENAME_H to FILENAME_H_INCLUDED.
+ *
* Revision 1.5 2001/05/26 00:28:36 jongfoster
* Automatic reloading of config file.
* Removed obsolete SIGHUP support (Unix) and Reload menu option (Win32).
/* Global variables */
-#ifdef TOGGLE
+#ifdef FEATURE_TOGGLE
/* indicates if ijb is enabled */
extern int g_bToggleIJB;
-#endif
+#endif /* def FEATURE_TOGGLE */
extern const char *configfile;
-const char loaders_rcs[] = "$Id: loaders.c,v 1.22 2001/07/20 15:16:17 haroon Exp $";
+const char loaders_rcs[] = "$Id: loaders.c,v 1.23 2001/07/20 15:51:54 oes Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loaders.c,v $
*
* Revisions :
* $Log: loaders.c,v $
+ * Revision 1.23 2001/07/20 15:51:54 oes
+ * Fixed indentation of prepocessor commands
+ *
* Revision 1.22 2001/07/20 15:16:17 haroon
* - per Guy's suggestion, added a while loop in sweep() to catch not just
* the last inactive CSP but all other consecutive inactive CSPs after that
* These are also entered in the main linked list of files.
*/
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
static struct file_list *current_trustfile = NULL;
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
static struct file_list *current_re_filterfile = NULL;
ncsp->rlist->active = 1;
}
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
if (ncsp->tlist) /* trust files */
{
ncsp->tlist->active = 1;
}
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
}
else
freez(ncsp->my_ip_addr_str);
freez(ncsp->my_hostname);
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
freez(ncsp->referrer);
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
freez(ncsp->x_forwarded);
freez(ncsp->iob->buf);
free_current_action(ncsp->action);
-#ifdef STATISTICS
+#ifdef FEATURE_STATISTICS
urls_read++;
if (ncsp->rejected)
{
urls_rejected++;
}
-#endif /* def STATISTICS */
+#endif /* def FEATURE_STATISTICS */
freez(ncsp);
(nfl->unloader)(nfl->f);
-#ifndef SPLIT_PROXY_ARGS
- freez(nfl->proxy_args);
-#endif /* ndef SPLIT_PROXY_ARGS */
-
freez(nfl->filename);
freez(nfl);
* This will be set to NULL, OR a struct
* file_list newly allocated on the
* heap, with the filename and lastmodified
- * fields filled, standard header giving file
- * name in proxy_args, and all others zeroed.
- * (proxy_args is only filled in if !defined
- * SPLIT_PROXY_ARGS and !suppress_blocklists).
+ * fields filled, and all others zeroed.
*
* Returns : If file unchanged: 0 (and sets newfl == NULL)
* If file changed: 1 and sets newfl != NULL
return 1;
}
-#ifndef SPLIT_PROXY_ARGS
- if (!suppress_blocklists)
- {
- char * p = html_encode(filename);
- if (p)
- {
- fs->proxy_args = strsav(fs->proxy_args, "<h2>The file `");
- fs->proxy_args = strsav(fs->proxy_args, p);
- fs->proxy_args = strsav(fs->proxy_args,
- "' contains the following patterns</h2>\n");
- freez(p);
- }
- fs->proxy_args = strsav(fs->proxy_args, "<pre>");
- }
-#endif /* ndef SPLIT_PROXY_ARGS */
*newfl = fs;
return 1;
while (fgets(linebuf, sizeof(linebuf), fp))
{
-#ifndef SPLIT_PROXY_ARGS
- if (fs && !suppress_blocklists)
- {
- char *html_line = html_encode(linebuf);
- if (html_line != NULL)
- {
- fs->proxy_args = strsav(fs->proxy_args, html_line);
- freez(html_line);
- }
- fs->proxy_args = strsav(fs->proxy_args, "<br>");
- }
-#endif /* ndef SPLIT_PROXY_ARGS */
-
/* Trim off newline */
if ((p = strpbrk(linebuf, "\r\n")) != NULL)
{
}
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
/*********************************************************************
*
* Function : unload_trustfile
fclose(fp);
-#ifndef SPLIT_PROXY_ARGS
- if (!suppress_blocklists)
- {
- fs->proxy_args = strsav(fs->proxy_args, "</pre>");
- }
-#endif /* ndef SPLIT_PROXY_ARGS */
-
/* the old one is now obsolete */
if (current_trustfile)
{
return(-1);
}
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
/*********************************************************************
fclose(fp);
-#ifndef SPLIT_PROXY_ARGS
- if (!suppress_blocklists)
- {
- fs->proxy_args = strsav(fs->proxy_args, "</pre>");
- }
-#endif /* ndef SPLIT_PROXY_ARGS */
-
/* the old one is now obsolete */
if ( NULL != current_re_filterfile )
{
#ifndef LOADERS_H_INCLUDED
#define LOADERS_H_INCLUDED
-#define LOADERS_H_VERSION "$Id: loaders.h,v 1.7 2001/07/13 14:01:54 oes Exp $"
+#define LOADERS_H_VERSION "$Id: loaders.h,v 1.8 2001/07/29 18:58:15 jongfoster Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loaders.h,v $
*
* Revisions :
* $Log: loaders.h,v $
+ * Revision 1.8 2001/07/29 18:58:15 jongfoster
+ * Removing nested #includes, adding forward declarations for needed
+ * structures, and changing the #define _FILENAME_H to FILENAME_H_INCLUDED.
+ *
* Revision 1.7 2001/07/13 14:01:54 oes
* Removed all #ifdef PCRS
*
extern int load_actions_file(struct client_state *csp);
extern int load_re_filterfile(struct client_state *csp);
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
extern int load_trustfile(struct client_state *csp);
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
-const char parsers_rcs[] = "$Id: parsers.c,v 1.18 2001/07/13 14:02:46 oes Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.19 2001/07/25 17:21:54 oes Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.c,v $
*
* Revisions :
* $Log: parsers.c,v $
+ * Revision 1.19 2001/07/25 17:21:54 oes
+ * client_uagent now saves copy of User-Agent: header value
+ *
* Revision 1.18 2001/07/13 14:02:46 oes
* - Included fix to repair broken HTTP requests that
* don't contain a path, not even '/'.
{ "cookie:", 7, client_send_cookie },
{ "x-forwarded-for:", 16, client_x_forwarded },
{ "proxy-connection:", 17, crumble },
-#ifdef DENY_GZIP
+#ifdef FEATURE_DENY_GZIP
{ "Accept-Encoding: gzip", 21, crumble },
-#endif /* def DENY_GZIP */
-#if defined(DETECT_MSIE_IMAGES)
+#endif /* def FEATURE_DENY_GZIP */
+#if defined(FEATURE_IMAGE_DETECT_MSIE)
{ "Accept:", 7, client_accept },
-#endif /* defined(DETECT_MSIE_IMAGES) */
-#ifdef FORCE_LOAD
+#endif /* defined(FEATURE_IMAGE_DETECT_MSIE) */
+#ifdef FEATURE_FORCE_LOAD
{ "Host:", 5, client_host },
-#endif /* def FORCE_LOAD */
+#endif /* def FEATURE_FORCE_LOAD */
/* { "if-modified-since:", 18, crumble }, */
{ NULL, 0, NULL }
};
http->ver = strdup(v[2]);
}
-#ifdef WEBDAV
-
-/* This next line is a little ugly, but it simplifies the if statement below. */
-/* Basically if using webDAV, we want the OR condition to use these too. */
-
-/*
- * by haroon
- * These are the headers as defined in RFC2518 to add webDAV support
- */
-
-#define OR_WEBDAV || \
- (0 == strcmpic(v[0], "propfind")) || \
- (0 == strcmpic(v[0], "proppatch")) || \
- (0 == strcmpic(v[0], "move")) || \
- (0 == strcmpic(v[0], "copy")) || \
- (0 == strcmpic(v[0], "mkcol")) || \
- (0 == strcmpic(v[0], "lock")) || \
- (0 == strcmpic(v[0], "unlock"))
-
-#else /* No webDAV support is enabled. Provide an empty OR_WEBDAV macro. */
-
-#define OR_WEBDAV
-
-#endif
-
/* or it could be a GET or a POST (possibly webDAV too) */
- if ((strcmpic(v[0], "get") == 0) ||
- (strcmpic(v[0], "head") == 0) OR_WEBDAV ||
- (strcmpic(v[0], "post") == 0))
+ if ((0 == strcmpic(v[0], "get"))
+ || (0 == strcmpic(v[0], "head"))
+ || (0 == strcmpic(v[0], "post"))
+ /* These are the headers as defined in RFC2518 to add webDAV support: */
+ || (0 == strcmpic(v[0], "propfind"))
+ || (0 == strcmpic(v[0], "proppatch"))
+ || (0 == strcmpic(v[0], "move"))
+ || (0 == strcmpic(v[0], "copy"))
+ || (0 == strcmpic(v[0], "mkcol"))
+ || (0 == strcmpic(v[0], "lock"))
+ || (0 == strcmpic(v[0], "unlock"))
+ )
{
http->ssl = 0;
http->gpc = strdup(v[0]);
char *client_referrer(const struct parsers *v, char *s, struct client_state *csp)
{
const char * newval;
-#ifdef FORCE_LOAD
+#ifdef FEATURE_FORCE_LOAD
/* Since the referrer can include the prefix even
* even if the request itself is non-forced, we must
* clean it unconditionally
*/
strclean(s, FORCE_PREFIX);
-#endif /* def FORCE_LOAD */
+#endif /* def FEATURE_FORCE_LOAD */
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
csp->referrer = strdup(s);
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
/*
* Are we sending referer?
csp->http->user_agent = strdup(s + 12);
}
-#ifdef DETECT_MSIE_IMAGES
+#ifdef FEATURE_IMAGE_DETECT_MSIE
if (strstr (s, "MSIE "))
{
/* This is Microsoft Internet Explorer.
*/
csp->accept_types |= ACCEPT_TYPE_IS_MSIE;
}
-#endif /* def DETECT_MSIE_IMAGES */
+#endif /* def FEATURE_IMAGE_DETECT_MSIE */
if ((csp->action->flags & ACTION_HIDE_USER_AGENT) == 0)
{
}
-#if defined(DETECT_MSIE_IMAGES)
+#if defined(FEATURE_IMAGE_DETECT_MSIE)
/*********************************************************************
*
* Function : client_accept
*********************************************************************/
char *client_accept(const struct parsers *v, char *s, struct client_state *csp)
{
-#ifdef DETECT_MSIE_IMAGES
+#ifdef FEATURE_IMAGE_DETECT_MSIE
if (strstr (s, "image/gif"))
{
/* Client will accept HTML. If this seems counterintuitive,
{
csp->accept_types |= ACCEPT_TYPE_MSIE_IMAGE;
}
-#endif /* def DETECT_MSIE_IMAGES */
+#endif /* def FEATURE_IMAGE_DETECT_MSIE */
return(strdup(s));
}
-#endif /* defined(DETECT_MSIE_IMAGES) */
+#endif /* defined(FEATURE_IMAGE_DETECT_MSIE) */
*********************************************************************/
char *server_set_cookie(const struct parsers *v, char *s, struct client_state *csp)
{
-#ifdef JAR_FILES
+#ifdef FEATURE_COOKIE_JAR
if (csp->config->jar)
{
fprintf(csp->config->jar, "%s\t%s\n", csp->http->host, (s + v->len + 1));
}
-#endif /* def JAR_FILES */
+#endif /* def FEATURE_COOKIE_JAR */
if ((csp->action->flags & ACTION_NO_COOKIE_SET) != 0)
{
}
-#ifdef FORCE_LOAD
+#ifdef FEATURE_FORCE_LOAD
/*********************************************************************
*
* Function : client_host
return(cleanhost);
}
-#endif /* def FORCE_LOAD */
+#endif /* def FEATURE_FORCE_LOAD */
-#ifdef FORCE_LOAD
+#ifdef FEATURE_FORCE_LOAD
/*********************************************************************
*
* Function : strclean
return(hits);
}
-#endif /* def FORCE_LOAD */
+#endif /* def FEATURE_FORCE_LOAD */
/*
#ifndef PARSERS_H_INCLUDED
#define PARSERS_H_INCLUDED
-#define PARSERS_H_VERSION "$Id: parsers.h,v 1.8 2001/07/13 14:01:54 oes Exp $"
+#define PARSERS_H_VERSION "$Id: parsers.h,v 1.9 2001/07/29 18:43:08 jongfoster Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.h,v $
*
* Revisions :
* $Log: parsers.h,v $
+ * Revision 1.9 2001/07/29 18:43:08 jongfoster
+ * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to
+ * ANSI C rules.
+ *
* Revision 1.8 2001/07/13 14:01:54 oes
* Removed all #ifdef PCRS
*
extern char *content_type(const struct parsers *v, char *s, struct client_state *csp);
extern char *content_length(const struct parsers *v, char *s, struct client_state *csp);
-#ifdef FORCE_LOAD
+#ifdef FEATURE_FORCE_LOAD
char *client_host(const struct parsers *v, char *s, struct client_state *csp);
int strclean(const char *string, const char *substring);
-#endif /* def FORCE_LOAD */
+#endif /* def FEATURE_FORCE_LOAD */
-#if defined(DETECT_MSIE_IMAGES)
+#if defined(FEATURE_IMAGE_DETECT_MSIE)
extern char *client_accept(const struct parsers *v, char *s, struct client_state *csp);
-#endif /* defined(DETECT_MSIE_IMAGES) */
+#endif /* defined(FEATURE_IMAGE_DETECT_MSIE) */
/* Revision control strings from this header and associated .c file */
extern const char parsers_rcs[];
#ifndef PROJECT_H_INCLUDED
#define PROJECT_H_INCLUDED
-#define PROJECT_H_VERSION "$Id: project.h,v 1.24 2001/07/25 17:20:27 oes Exp $"
+#define PROJECT_H_VERSION "$Id: project.h,v 1.25 2001/07/29 18:43:08 jongfoster Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/project.h,v $
*
* Revisions :
* $Log: project.h,v $
+ * Revision 1.25 2001/07/29 18:43:08 jongfoster
+ * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to
+ * ANSI C rules.
+ *
* Revision 1.24 2001/07/25 17:20:27 oes
* Introduced http->user_agent
*
/* Constants defining bitmask for csp->accept_types */
-#ifdef DETECT_MSIE_IMAGES
+#ifdef FEATURE_IMAGE_DETECT_MSIE
/* MSIE detected by user-agent string */
#define ACCEPT_TYPE_IS_MSIE 0x0001
*/
#define ACCEPT_TYPE_MSIE_HTML 0x0004
-#endif /* def DETECT_MSIE_IMAGES */
+#endif /* def FEATURE_IMAGE_DETECT_MSIE */
struct client_state
int sfd;
-#ifdef STATISTICS
+#ifdef FEATURE_STATISTICS
/* 1 if this URL was rejected, 0 otherwise. Allows actual stats inc to
* occur in main thread only for thread-safety.
*/
int rejected;
-#endif /* def STATISTICS */
+#endif /* def FEATURE_STATISTICS */
-#ifdef FORCE_LOAD
+#ifdef FEATURE_FORCE_LOAD
int force;
-#endif /* def FORCE_LOAD */
+#endif /* def FEATURE_FORCE_LOAD */
-#ifdef TOGGLE
+#ifdef FEATURE_TOGGLE
int toggled_on;
-#endif /* def TOGGLE */
+#endif /* def FEATURE_TOGGLE */
/*
* Client PC's IP address, as reported by the accept()_ function.
char *my_ip_addr_str;
char *my_hostname;
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
/* The referer in this request, if one was specified. */
char *referrer;
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
-#if defined(DETECT_MSIE_IMAGES)
+#if defined(FEATURE_IMAGE_DETECT_MSIE)
/* Types the client will accept.
* Bitmask - see ACCEPT_TYPE_XXX constants.
*/
int accept_types;
-#endif /* defined(DETECT_MSIE_IMAGES) */
+#endif /* defined(FEATURE_IMAGE_DETECT_MSIE) */
/* The URL that was requested */
struct http_request http[1];
struct file_list *rlist; /* pcrs job file */
size_t content_length; /* Length after content modification */
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
struct file_list *tlist; /* trustfile */
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
struct client_state *next;
};
/* Used internally by sweep(). Do not access from elsewhere. */
int active;
-#ifndef SPLIT_PROXY_ARGS
- /* String to be displayed as part of show-proxy-args display.
- * Read-only once the structure has been created.
- */
- char *proxy_args;
-#endif /* ndef SPLIT_PROXY_ARGS */
-
/* Following variables allow us to check if file has been changed.
* Read-only once the structure has been created.
*/
};
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
struct block_spec
{
struct url_spec url[1];
int reject;
struct block_spec *next;
};
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
#define SOCKS_NONE 0 /* Don't use a SOCKS server */
pcrs_job *joblist;
};
-#ifdef ACL_FILES
+#ifdef FEATURE_ACL
#define ACL_PERMIT 1 /* accept connection request */
#define ACL_DENY 2 /* reject connection request */
short action;
struct access_control_list *next;
};
-#endif /* def ACL_FILES */
+#endif /* def FEATURE_ACL */
/* Maximum number of loaders (actions, re_filter, ...) */
const char *re_filterfile;
-#ifdef JAR_FILES
+#ifdef FEATURE_COOKIE_JAR
const char * jarfile;
FILE * jar;
-#endif /* def JAR_FILES */
+#endif /* def FEATURE_COOKIE_JAR */
/*
* Port and IP to bind to.
const char *haddr;
int hport;
-#ifndef SPLIT_PROXY_ARGS
- const char *suppress_message;
-#endif /* ndef SPLIT_PROXY_ARGS */
-
-#ifndef SPLIT_PROXY_ARGS
- /* suppress listing config files */
- int suppress_blocklists;
-#endif /* ndef SPLIT_PROXY_ARGS */
-
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
const char * trustfile;
struct list trust_info[1];
struct url_spec *trust_list[64];
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
-#ifdef ACL_FILES
+#ifdef FEATURE_ACL
struct access_control_list *acl;
-#endif /* def ACL_FILES */
+#endif /* def FEATURE_ACL */
struct forward_spec *forward;
#define SZ(X) (sizeof(X) / sizeof(*X))
-#ifdef FORCE_LOAD
+#ifdef FEATURE_FORCE_LOAD
#define FORCE_PREFIX "/IJB-FORCE-LOAD"
-#endif /* def FORCE_LOAD */
+#endif /* def FEATURE_FORCE_LOAD */
/* Hardwired URLs */
#define HOME_PAGE_URL "http://ijbswa.sourceforge.net"
-const char showargs_rcs[] = "$Id: showargs.c,v 1.19 2001/07/13 14:11:36 oes Exp $";
+const char showargs_rcs[] = "$Id: showargs.c,v 1.20 2001/07/18 17:27:22 oes Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/showargs.c,v $
*
* Revisions :
* $Log: showargs.c,v $
+ * Revision 1.20 2001/07/18 17:27:22 oes
+ * Adapted to new #defines
+ *
* Revision 1.19 2001/07/13 14:11:36 oes
* - Included SHOW_RCS for deanimate.*
* - Removed all #ifdef PCRS
SHOW_RCS(jbsockets_rcs)
SHOW_RCS(jcc_h_rcs)
SHOW_RCS(jcc_rcs)
-#ifdef KILLPOPUPS
+#ifdef FEATURE_KILL_POPUPS
SHOW_RCS(killpopup_h_rcs)
SHOW_RCS(killpopup_rcs)
-#endif /* def KILLPOPUPS */
+#endif /* def FEATURE_KILL_POPUPS */
SHOW_RCS(list_h_rcs)
SHOW_RCS(list_rcs)
SHOW_RCS(loadcfg_h_rcs)
SHOW_RCS(w32log_h_rcs)
SHOW_RCS(w32log_rcs)
SHOW_RCS(w32res_h_rcs)
- SHOW_RCS(w32rulesdlg_h_rcs)
- SHOW_RCS(w32rulesdlg_rcs)
SHOW_RCS(w32taskbar_h_rcs)
SHOW_RCS(w32taskbar_rcs)
#endif /* ndef _WIN_CONSOLE */
b = strsav(b, " <li><code>#undef <b>STATIC_PCRS</b></code> - Using libpcrs rather than static built-in pcrs.</li>\n");
#endif /* ndef STATIC_PCRS */
-#ifdef TOGGLE
- b = strsav(b, " <li><code>#define <b>TOGGLE</b></code> - Allow JunkBuster to be \"disabled\" so it is just a normal non-blocking non-anonymizing proxy.</li>\n");
-#else /* ifndef TOGGLE */
- b = strsav(b, " <li><code>#undef <b>TOGGLE</b></code> - Do not allow JunkBuster to be \"disabled\" so it is just a normal non-blocking non-anonymizing proxy.</li>\n");
-#endif /* ndef TOGGLE */
-
-#ifdef FORCE_LOAD
- b = strsav(b, " <li><code>#define <b>FORCE_LOAD</b></code> - Enables bypassing filtering for a single page using the prefix \"" FORCE_PREFIX "\".</li>\n");
-#else /* ifndef FORCE_LOAD */
- b = strsav(b, " <li><code>#undef <b>FORCE_LOAD</b></code> - Disables bypassing filtering for a single page.</li>\n");
-#endif /* ndef FORCE_LOAD */
-
-#ifdef DENY_GZIP
- b = strsav(b, " <li><code>#define <b>DENY_GZIP</b></code> - Prevents requests from being compressed - required for PCRS on some sites.</li>\n");
-#else /* ifndef DENY_GZIP */
- b = strsav(b, " <li><code>#undef <b>DENY_GZIP</b></code> - Allows requests to be compressed if the browser and server support it.</li>\n");
-#endif /* ndef DENY_GZIP */
-
-#ifdef STATISTICS
- b = strsav(b, " <li><code>#define <b>STATISTICS</b></code> - Enables statistics function.</li>\n");
-#else /* ifndef STATISTICS */
- b = strsav(b, " <li><code>#undef <b>STATISTICS</b></code> - Disables statistics function.</li>\n");
-#endif /* ndef STATISTICS */
-
-#ifdef SPLIT_PROXY_ARGS
- b = strsav(b, " <li><code>#define <b>SPLIT_PROXY_ARGS</b></code> - Split this page up by placing the configuration files on separate pages.</li>\n");
-#else /* ifndef SPLIT_PROXY_ARGS */
- b = strsav(b, " <li><code>#undef <b>SPLIT_PROXY_ARGS</b></code> - This page contains the text of the configuration files, they are not split onto separate pages.</li>\n");
-#endif /* ndef SPLIT_PROXY_ARGS */
-
-#ifdef KILLPOPUPS
- b = strsav(b, " <li><code>#define <b>KILLPOPUPS</b></code> - Enables killing JavaScript popups.</li>\n");
-#else /* ifndef KILLPOPUPS */
- b = strsav(b, " <li><code>#undef <b>KILLPOPUPS</b></code> - Disables killing JavaScript popups.</li>\n");
-#endif /* ndef KILLPOPUPS */
-
-#ifdef WEBDAV
- b = strsav(b, " <li><code>#define <b>WEBDAV</b></code> - Enables support for webDAV - e.g. stops Microsoft Outlook from accessing HotMail e-mail.</li>\n");
-#else /* ifndef WEBDAV */
- b = strsav(b, " <li><code>#undef <b>WEBDAV</b></code> - Disables support for webDAV - e.g. so Microsoft Outlook can access HotMail e-mail.</li>\n");
-#endif /* ndef WEBDAV */
-
-#ifdef DETECT_MSIE_IMAGES
- b = strsav(b, " <li><code>#define <b>DETECT_MSIE_IMAGES</b></code> - Enables detecting image requests automatically for MSIE.</li>\n");
-#else /* ifndef DETECT_MSIE_IMAGES */
- b = strsav(b, " <li><code>#undef <b>DETECT_MSIE_IMAGES</b></code> - Disables detecting image requests automatically for MSIE.</li>\n");
-#endif /* ndef DETECT_MSIE_IMAGES */
-
-#ifdef IMAGE_BLOCKING
- b = strsav(b, " <li><code>#define <b>IMAGE_BLOCKING</b></code> - Enables sending \"blocked\" images instead of HTML.</li>\n");
-#else /* ifndef IMAGE_BLOCKING */
- b = strsav(b, " <li><code>#undef <b>IMAGE_BLOCKING</b></code> - Disables sending \"blocked\" images instead of HTML.</li>\n");
-#endif /* ndef IMAGE_BLOCKING */
-
-#ifdef ACL_FILES
- b = strsav(b, " <li><code>#define <b>ACL_FILES</b></code> - Enables the use of ACL files to control access to the proxy by IP address.</li>\n");
-#else /* ifndef ACL_FILES */
- b = strsav(b, " <li><code>#undef <b>ACL_FILES</b></code> - Disables the use of ACL files to control access to the proxy by IP address.</li>\n");
-#endif /* ndef ACL_FILES */
-
-#ifdef TRUST_FILES
- b = strsav(b, " <li><code>#define <b>TRUST_FILES</b></code> - Enables the use of trust files.</li>\n");
-#else /* ifndef TRUST_FILES */
- b = strsav(b, " <li><code>#undef <b>TRUST_FILES</b></code> - Disables the use of trust files.</li>\n");
-#endif /* ndef TRUST_FILES */
-
-#ifdef JAR_FILES
- b = strsav(b, " <li><code>#define <b>JAR_FILES</b></code> - Enables the use of jar files to capture cookies.</li>\n");
-#else /* ifndef JAR_FILES */
- b = strsav(b, " <li><code>#undef <b>JAR_FILES</b></code> - Disables the use of jar files to capture cookies.</li>\n");
-#endif /* ndef JAR_FILES */
-
-#ifdef FAST_REDIRECTS
- b = strsav(b, " <li><code>#define <b>FAST_REDIRECTS</b></code> - Enables intercepting remote script redirects.</li>\n");
-#else /* ifndef FAST_REDIRECTS */
- b = strsav(b, " <li><code>#undef <b>FAST_REDIRECTS</b></code> - Disables intercepting remote script redirects.</li>\n");
-#endif /* ndef FAST_REDIRECTS */
+#ifdef FEATURE_TOGGLE
+ b = strsav(b, " <li><code>#define <b>FEATURE_TOGGLE</b></code> - Allow JunkBuster to be \"disabled\" so it is just a normal non-blocking non-anonymizing proxy.</li>\n");
+#else /* ifndef FEATURE_TOGGLE */
+ b = strsav(b, " <li><code>#undef <b>FEATURE_TOGGLE</b></code> - Do not allow JunkBuster to be \"disabled\" so it is just a normal non-blocking non-anonymizing proxy.</li>\n");
+#endif /* ndef FEATURE_TOGGLE */
+
+#ifdef FEATURE_FORCE_LOAD
+ b = strsav(b, " <li><code>#define <b>FEATURE_FORCE_LOAD</b></code> - Enables bypassing filtering for a single page using the prefix \"" FORCE_PREFIX "\".</li>\n");
+#else /* ifndef FEATURE_FORCE_LOAD */
+ b = strsav(b, " <li><code>#undef <b>FEATURE_FORCE_LOAD</b></code> - Disables bypassing filtering for a single page.</li>\n");
+#endif /* ndef FEATURE_FORCE_LOAD */
+
+#ifdef FEATURE_DENY_GZIP
+ b = strsav(b, " <li><code>#define <b>FEATURE_DENY_GZIP</b></code> - Prevents requests from being compressed - required for PCRS on some sites.</li>\n");
+#else /* ifndef FEATURE_DENY_GZIP */
+ b = strsav(b, " <li><code>#undef <b>FEATURE_DENY_GZIP</b></code> - Allows requests to be compressed if the browser and server support it.</li>\n");
+#endif /* ndef FEATURE_DENY_GZIP */
+
+#ifdef FEATURE_STATISTICS
+ b = strsav(b, " <li><code>#define <b>FEATURE_STATISTICS</b></code> - Enables statistics function.</li>\n");
+#else /* ifndef FEATURE_STATISTICS */
+ b = strsav(b, " <li><code>#undef <b>FEATURE_STATISTICS</b></code> - Disables statistics function.</li>\n");
+#endif /* ndef FEATURE_STATISTICS */
+
+#ifdef FEATURE_KILL_POPUPS
+ b = strsav(b, " <li><code>#define <b>FEATURE_KILL_POPUPS</b></code> - Enables killing JavaScript popups.</li>\n");
+#else /* ifndef FEATURE_KILL_POPUPS */
+ b = strsav(b, " <li><code>#undef <b>FEATURE_KILL_POPUPS</b></code> - Disables killing JavaScript popups.</li>\n");
+#endif /* ndef FEATURE_KILL_POPUPS */
+
+#ifdef FEATURE_IMAGE_DETECT_MSIE
+ b = strsav(b, " <li><code>#define <b>FEATURE_IMAGE_DETECT_MSIE</b></code> - Enables detecting image requests automatically for MSIE.</li>\n");
+#else /* ifndef FEATURE_IMAGE_DETECT_MSIE */
+ b = strsav(b, " <li><code>#undef <b>FEATURE_IMAGE_DETECT_MSIE</b></code> - Disables detecting image requests automatically for MSIE.</li>\n");
+#endif /* ndef FEATURE_IMAGE_DETECT_MSIE */
+
+#ifdef FEATURE_IMAGE_BLOCKING
+ b = strsav(b, " <li><code>#define <b>FEATURE_IMAGE_BLOCKING</b></code> - Enables sending \"blocked\" images instead of HTML.</li>\n");
+#else /* ifndef FEATURE_IMAGE_BLOCKING */
+ b = strsav(b, " <li><code>#undef <b>FEATURE_IMAGE_BLOCKING</b></code> - Disables sending \"blocked\" images instead of HTML.</li>\n");
+#endif /* ndef FEATURE_IMAGE_BLOCKING */
+
+#ifdef FEATURE_ACL
+ b = strsav(b, " <li><code>#define <b>FEATURE_ACL</b></code> - Enables the use of ACL files to control access to the proxy by IP address.</li>\n");
+#else /* ifndef FEATURE_ACL */
+ b = strsav(b, " <li><code>#undef <b>FEATURE_ACL</b></code> - Disables the use of ACL files to control access to the proxy by IP address.</li>\n");
+#endif /* ndef FEATURE_ACL */
+
+#ifdef FEATURE_TRUST
+ b = strsav(b, " <li><code>#define <b>FEATURE_TRUST</b></code> - Enables the use of trust files.</li>\n");
+#else /* ifndef FEATURE_TRUST */
+ b = strsav(b, " <li><code>#undef <b>FEATURE_TRUST</b></code> - Disables the use of trust files.</li>\n");
+#endif /* ndef FEATURE_TRUST */
+
+#ifdef FEATURE_COOKIE_JAR
+ b = strsav(b, " <li><code>#define <b>FEATURE_COOKIE_JAR</b></code> - Enables the use of jar files to capture cookies.</li>\n");
+#else /* ifndef FEATURE_COOKIE_JAR */
+ b = strsav(b, " <li><code>#undef <b>FEATURE_COOKIE_JAR</b></code> - Disables the use of jar files to capture cookies.</li>\n");
+#endif /* ndef FEATURE_COOKIE_JAR */
+
+#ifdef FEATURE_FAST_REDIRECTS
+ b = strsav(b, " <li><code>#define <b>FEATURE_FAST_REDIRECTS</b></code> - Enables intercepting remote script redirects.</li>\n");
+#else /* ifndef FEATURE_FAST_REDIRECTS */
+ b = strsav(b, " <li><code>#undef <b>FEATURE_FAST_REDIRECTS</b></code> - Disables intercepting remote script redirects.</li>\n");
+#endif /* ndef FEATURE_FAST_REDIRECTS */
return b;
}
-const char w32log_rcs[] = "$Id: w32log.c,v 1.13 2001/07/19 19:15:14 haroon Exp $";
+const char w32log_rcs[] = "$Id: w32log.c,v 1.14 2001/07/29 18:47:05 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/w32log.c,v $
*
* Revisions :
* $Log: w32log.c,v $
+ * Revision 1.14 2001/07/29 18:47:05 jongfoster
+ * Adding missing #include "loadcfg.h"
+ *
* Revision 1.13 2001/07/19 19:15:14 haroon
* - Added a FIXME for EditFile but didn't fix :-)
*
#include "project.h"
#include "w32log.h"
#include "w32taskbar.h"
-#include "w32rulesdlg.h"
#include "win32.h"
#include "w32res.h"
#include "jcc.h"
const char * g_actions_file = NULL;
const char * g_re_filterfile = NULL;
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
const char * g_trustfile = NULL;
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
/* FIXME: end kludge */
if (hMenu != NULL)
{
HMENU hMenuPopup = GetSubMenu(hMenu, 0);
-#ifdef WIN_GUI_EDIT
- char *szURL;
-#endif /* def WIN_GUI_EDIT */
/* Check if there is a selection */
CHARRANGE range;
EnableMenuItem(hMenuPopup, ID_EDIT_COPY, MF_BYCOMMAND | MF_ENABLED);
}
-#ifdef WIN_GUI_EDIT
- /* Check if cursor is over a link */
- szURL = LogGetURLUnderCursor();
- if (szURL)
- {
- MENUITEMINFO item;
- TCHAR szMenuItemTemplate[1000];
- char *szMenuItem;
-
- memset(&item, 0, sizeof(item));
- item.cbSize = sizeof(item);
- item.fMask = MIIM_TYPE | MIIM_ID | MIIM_STATE;
- item.fType = MFT_STRING;
- item.fState = MFS_ENABLED;
- item.wID = ID_NEW_BLOCKER;
-
- /* Put the item into the menu */
- memset(szMenuItemTemplate, 0, sizeof(szMenuItemTemplate));
- LoadString(g_hInstance, IDS_NEW_BLOCKER, szMenuItemTemplate, sizeof(szMenuItemTemplate) / sizeof(szMenuItemTemplate[0]));
-
- szMenuItem = (char *)malloc(strlen(szMenuItemTemplate) + strlen(szURL) + 1);
- sprintf(szMenuItem, szMenuItemTemplate, szURL);
-
- item.dwTypeData = szMenuItem;
- item.cch = strlen(szMenuItem);
-
- InsertMenuItem(hMenuPopup, 1, TRUE, &item);
-
- SetDefaultRule(szURL);
-
- free(szURL);
- }
-#endif /* def WIN_GUI_EDIT */
-
/* Display the popup */
TrackPopupMenu(hMenuPopup, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RIGHTBUTTON, x, y, 0, g_hwndLogFrame, NULL);
DestroyMenu(hMenu);
/* SaveLogSettings(); */
break;
-#ifdef TOGGLE
+#ifdef FEATURE_TOGGLE
/* by haroon - change toggle to its opposite value */
case ID_TOGGLE_IJB:
g_bToggleIJB = !g_bToggleIJB;
log_error(LOG_LEVEL_INFO, "Now toggled OFF.");
}
break;
-#endif
+#endif /* def FEATURE_TOGGLE */
case ID_TOOLS_EDITJUNKBUSTER:
EditFile(configfile);
EditFile(g_re_filterfile);
break;
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
case ID_TOOLS_EDITTRUST:
EditFile(g_trustfile);
break;
-#endif /* def TRUST_FILES */
-
-#ifdef WIN_GUI_EDIT
- case ID_NEW_BLOCKER:
- ShowRulesDialog(g_hwndLogFrame);
- break;
-#endif /* def WIN_GUI_EDIT */
+#endif /* def FEATURE_TRUST */
case ID_HELP_GPL:
ShellExecute(g_hwndLogFrame, "open", "gpl.html", NULL, NULL, SW_SHOWNORMAL);
/* Only enable editors if there is a file to edit */
EnableMenuItem(hmenu, ID_TOOLS_EDITACTIONS, MF_BYCOMMAND | (g_actions_file ? MF_ENABLED : MF_GRAYED));
EnableMenuItem(hmenu, ID_TOOLS_EDITPERLRE, MF_BYCOMMAND | (g_re_filterfile ? MF_ENABLED : MF_GRAYED));
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
EnableMenuItem(hmenu, ID_TOOLS_EDITTRUST, MF_BYCOMMAND | (g_trustfile ? MF_ENABLED : MF_GRAYED));
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
/* Check/uncheck options */
CheckMenuItem(hmenu, ID_VIEW_LOGMESSAGES, MF_BYCOMMAND | (g_bLogMessages ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(hmenu, ID_VIEW_MESSAGEHIGHLIGHTING, MF_BYCOMMAND | (g_bHighlightMessages ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(hmenu, ID_VIEW_LIMITBUFFERSIZE, MF_BYCOMMAND | (g_bLimitBufferSize ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(hmenu, ID_VIEW_ACTIVITYANIMATION, MF_BYCOMMAND | (g_bShowActivityAnimation ? MF_CHECKED : MF_UNCHECKED));
-#ifdef TOGGLE
+#ifdef FEATURE_TOGGLE
/* by haroon - menu item for Enable toggle on/off */
CheckMenuItem(hmenu, ID_TOGGLE_IJB, MF_BYCOMMAND | (g_bToggleIJB ? MF_CHECKED : MF_UNCHECKED));
-#endif
+#endif /* def FEATURE_TOGGLE */
}
#ifndef W32LOG_H_INCLUDED
#define W32LOG_H_INCLUDED
-#define W32LOG_H_VERSION "$Id: w32log.h,v 1.6 2001/07/13 14:04:59 oes Exp $"
+#define W32LOG_H_VERSION "$Id: w32log.h,v 1.7 2001/07/29 18:43:08 jongfoster Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/w32log.h,v $
*
* Revisions :
* $Log: w32log.h,v $
+ * Revision 1.7 2001/07/29 18:43:08 jongfoster
+ * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to
+ * ANSI C rules.
+ *
* Revision 1.6 2001/07/13 14:04:59 oes
* Removed all #ifdef PCRS
*
extern const char * g_actions_file;
extern const char * g_re_filterfile;
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
extern const char * g_trustfile;
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
/* FIXME: end kludge */
#ifndef W32RES_H_INCLUDED
#define W32RES_H_INCLUDED
-#define W32RES_H_VERSION "$Id: w32res.h,v 1.8 2001/07/13 14:04:59 oes Exp $"
+#define W32RES_H_VERSION "$Id: w32res.h,v 1.9 2001/07/29 18:43:08 jongfoster Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/w32res.h,v $
*
* Revisions :
* $Log: w32res.h,v $
+ * Revision 1.9 2001/07/29 18:43:08 jongfoster
+ * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to
+ * ANSI C rules.
+ *
* Revision 1.8 2001/07/13 14:04:59 oes
* Removed all #ifdef PCRS
*
*
*********************************************************************/
-#ifdef WIN_GUI_EDIT
-#define IDS_NEW_BLOCKER 1
-
-#define ID_NEW_BLOCKER 100
-#endif /* def WIN_GUI_EDIT */
-
#define IDR_TRAYMENU 101
#define IDI_IDLE 102
#define IDR_LOGVIEW 103
#define IDR_ACCELERATOR 104
#define IDR_POPUP_SELECTION 105
-#ifdef WIN_GUI_EDIT
-#define IDD_RULES 106
-#endif /* def WIN_GUI_EDIT */
-
#define IDI_JUNKBUSTER 200
#define IDI_JUNKBUSTER1 201
#define IDI_JUNKBUSTER7 207
#define IDI_JUNKBUSTER8 208
-#ifdef WIN_GUI_EDIT
-#define IDI_DENYRULE 209
-#define IDI_ALLOWRULE 210
-
-#define IDC_NEW 300
-#define IDC_ACTION 301
-#define IDC_RULES 302
-#define IDC_CREATE 303
-#define IDC_MOVEUP 304
-#define IDC_MOVEDOWN 305
-#define IDC_DELETE 306
-#define IDC_SAVE 307
-#endif /* def WIN_GUI_EDIT */
-
#define ID_SHOWWINDOW 4000
#define ID_HELP_ABOUTJUNKBUSTER 4001
#define ID_FILE_EXIT 4002
#define ID_HELP_MANUAL 4009
#define ID_HELP_GPL 4010
#define ID_HELP_STATUS 4011
-#ifdef TOGGLE
+#ifdef FEATURE_TOGGLE
#define ID_TOGGLE_IJB 4012
-#endif
+#endif /* def FEATURE_TOGGLE */
/* Break these out so they are easier to extend, but keep consecutive */
#define ID_TOOLS_EDITJUNKBUSTER 5000
#define ID_TOOLS_EDITACTIONS 5001
#define ID_TOOLS_EDITPERLRE 5002
-#ifdef TRUST_FILES
+#ifdef FEATURE_TRUST
#define ID_TOOLS_EDITTRUST 5003
-#endif /* def TRUST_FILES */
+#endif /* def FEATURE_TRUST */
/*
* The following symbols are declared in <afxres.h> in VC++.
#ifndef WIN32_H_INCLUDED
#define WIN32_H_INCLUDED
-#define WIN32_H_VERSION "$Id: win32.h,v 1.1.1.1 2001/05/15 13:59:08 oes Exp $"
+#define WIN32_H_VERSION "$Id: win32.h,v 1.2 2001/07/29 18:43:08 jongfoster Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/win32.h,v $
*
* Revisions :
* $Log: win32.h,v $
+ * Revision 1.2 2001/07/29 18:43:08 jongfoster
+ * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to
+ * ANSI C rules.
+ *
* Revision 1.1.1.1 2001/05/15 13:59:08 oes
* Initial import of version 2.9.3 source tree
*
#endif
#endif /* ndef WIN32_H_INCLUDED */
-
+
/*
Local Variables:
tab-width: 3