-const char actions_rcs[] = "$Id: actions.c,v 1.5 2001/06/03 19:11:48 oes Exp $";
+const char actions_rcs[] = "$Id: actions.c,v 1.6 2001/06/07 23:04:34 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/actions.c,v $
*
* Revisions :
* $Log: actions.c,v $
+ * Revision 1.6 2001/06/07 23:04:34 jongfoster
+ * Made get_actions() static.
+ *
* Revision 1.5 2001/06/03 19:11:48 oes
* adapted to new enlist_unique arg format
*
struct url_actions *last_perm;
struct url_actions *perm;
- char buf[BUFSIZ];
+ char buf[BUFFER_SIZE];
struct file_list *fs;
#define MODE_START_OF_FILE 1
#define MODE_ACTIONS 2
{
/* It's an actions block */
- char actions_buf[BUFSIZ];
+ char actions_buf[BUFFER_SIZE];
char * end;
/* set mode */
else if (mode == MODE_ALIAS)
{
/* define an alias */
- char actions_buf[BUFSIZ];
+ char actions_buf[BUFFER_SIZE];
struct action_alias * new_alias;
int more = 1;
-const char errlog_rcs[] = "$Id: errlog.c,v 1.10 2001/05/29 11:52:21 oes Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 1.11 2001/06/01 18:14:49 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/errlog.c,v $
*
* Revisions :
* $Log: errlog.c,v $
+ * Revision 1.11 2001/06/01 18:14:49 jongfoster
+ * Changing the calls to strerr() to check HAVE_STRERR (which is defined
+ * in config.h if appropriate) rather than the NO_STRERR macro.
+ *
* Revision 1.10 2001/05/29 11:52:21 oes
* Conditional compilation of w32_socket_error
*
void log_error(int loglevel, char *fmt, ...)
{
va_list ap;
- char outbuf[BUFSIZ];
+ char outbuf[BUFFER_SIZE];
char * src = fmt;
int outc = 0;
long this_thread = 1; /* was: pthread_t this_thread;*/
va_start( ap, fmt );
/* build formatted message from fmt and var-args */
- while ((*src) && (outc < BUFSIZ-2))
+ while ((*src) && (outc < BUFFER_SIZE-2))
{
- char tempbuf[BUFSIZ];
+ char tempbuf[BUFFER_SIZE];
char *sval;
int ival;
unsigned uval;
ival = va_arg( ap, int );
oldoutc = outc;
outc += sprintf(tempbuf, "%d", ival);
- if (outc < BUFSIZ-1)
+ if (outc < BUFFER_SIZE-1)
{
strcpy(outbuf + oldoutc, tempbuf);
}
uval = va_arg( ap, unsigned );
oldoutc = outc;
outc += sprintf(tempbuf, "%u", uval);
- if (outc < BUFSIZ-1)
+ if (outc < BUFFER_SIZE-1)
{
strcpy(outbuf + oldoutc, tempbuf);
}
/* Never get here */
break;
}
- if (outc < BUFSIZ-1)
+ if (outc < BUFFER_SIZE-1)
{
strcpy(outbuf + oldoutc, tempbuf);
}
sval = va_arg( ap, char * );
oldoutc = outc;
outc += strlen(sval);
- if (outc < BUFSIZ-1)
+ if (outc < BUFFER_SIZE-1)
{
strcpy(outbuf + oldoutc, sval);
}
}
oldoutc = outc;
outc += ival;
- if (outc < BUFSIZ-1)
+ if (outc < BUFFER_SIZE-1)
{
memcpy(outbuf + oldoutc, sval, ival);
}
#endif /* ndef _WIN32 */
oldoutc = outc;
outc += strlen(sval);
- if (outc < BUFSIZ-1)
+ if (outc < BUFFER_SIZE-1)
{
strcpy(outbuf + oldoutc, sval);
}
days = tm_now->tm_yday - gmt.tm_yday;
hrs = ((days < -1 ? 24 : 1 < days ? -24 : days * 24) + tm_now->tm_hour - gmt.tm_hour);
mins = hrs * 60 + tm_now->tm_min - gmt.tm_min;
- strftime (tempbuf, BUFSIZ-6, "%d/%b/%Y:%H:%M:%S ", tm_now);
+ strftime (tempbuf, BUFFER_SIZE-6, "%d/%b/%Y:%H:%M:%S ", tm_now);
sprintf (tempbuf + strlen(tempbuf), "%+03d%02d", mins / 60, abs(mins) % 60);
}
oldoutc = outc;
outc += strlen(tempbuf);
- if (outc < BUFSIZ-1)
+ if (outc < BUFFER_SIZE-1)
{
strcpy(outbuf + oldoutc, tempbuf);
}
/* done with var. args */
va_end( ap );
- if (outc >= BUFSIZ-2)
+ if (outc >= BUFFER_SIZE-2)
{
/* insufficient room for newline and trailing null. */
static const char warning[] = "... [too long, truncated]\n";
- if (outc < BUFSIZ)
+ if (outc < BUFFER_SIZE)
{
/* Need to add terminating null in this case. */
outbuf[outc] = '\0';
}
/* Truncate output */
- outbuf[BUFSIZ - sizeof(warning)] = '\0';
+ outbuf[BUFFER_SIZE - sizeof(warning)] = '\0';
/* Append warning */
strcat(outbuf, warning);
-const char filters_rcs[] = "$Id: filters.c,v 1.15 2001/06/03 19:12:00 oes Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.16 2001/06/07 23:10:26 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/filters.c,v $
*
* Revisions :
* $Log: filters.c,v $
+ * Revision 1.16 2001/06/07 23:10:26 jongfoster
+ * Allowing unanchored domain patterns to back off and retry
+ * if they partially match. Optimized right-anchored patterns.
+ * Moving ACL and forward files into config file.
+ * Replacing struct gateway with struct forward_spec
+ *
* Revision 1.15 2001/06/03 19:12:00 oes
* extracted-CGI relevant stuff
*
struct url_spec dsplit(char *domain)
{
struct url_spec ret[1];
- char *v[BUFSIZ];
+ char *v[BUFFER_SIZE];
int size;
char *p;
-const char gateway_rcs[] = "$Id: gateway.c,v 1.1.1.1 2001/05/15 13:58:54 oes Exp $";
+const char gateway_rcs[] = "$Id: gateway.c,v 1.2 2001/06/07 23:11:38 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/gateway.c,v $
*
* Revisions :
* $Log: gateway.c,v $
+ * Revision 1.2 2001/06/07 23:11:38 jongfoster
+ * Removing gateways[] list - no longer used.
+ * Replacing function pointer in struct gateway with a directly
+ * called function forwarded_connect(), which can do the common
+ * task of deciding whether to connect to the web server or HTTP
+ * proxy.
+ * Replacing struct gateway with struct forward_spec
+ * Fixing bug with SOCKS4A and HTTP proxy server in combination.
+ * It was a bug which led to the connection being made to the web
+ * server rather than the HTTP proxy, and also a buffer overrun.
+ *
* Revision 1.1.1.1 2001/05/15 13:58:54 oes
* Initial import of version 2.9.3 source tree
*
struct client_state *csp)
{
int web_server_addr;
- unsigned char cbuf[BUFSIZ];
- unsigned char sbuf[BUFSIZ];
+ unsigned char cbuf[BUFFER_SIZE];
+ unsigned char sbuf[BUFFER_SIZE];
struct socks_op *c = (struct socks_op *)cbuf;
struct socks_reply *s = (struct socks_reply *)sbuf;
int n;
-const char jcc_rcs[] = "$Id: jcc.c,v 1.18 2001/06/03 19:12:16 oes Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.19 2001/06/07 23:12:52 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
*
* Revisions :
* $Log: jcc.c,v $
+ * Revision 1.19 2001/06/07 23:12:52 jongfoster
+ * Replacing function pointer in struct gateway with a directly
+ * called function forwarded_connect().
+ * Replacing struct gateway with struct forward_spec
+ *
* Revision 1.18 2001/06/03 19:12:16 oes
* introduced new cgi handling
*
#define IS_ENABLED_AND IS_TOGGLED_ON_AND IS_NOT_FORCED_AND
- char buf[BUFSIZ], *hdr, *p, *req;
+ char buf[BUFFER_SIZE];\r
+ char *hdr, *p, *req;
char *err = NULL;
char *eno;
fd_set rfds;
if (child_id < 0) /* failed */
{
- char buf[BUFSIZ];
+ char buf[BUFFER_SIZE];
log_error(LOG_LEVEL_ERROR, "can't fork: %E");
/* vim:ts=3: */
-const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.14 2001/06/07 14:46:25 joergs Exp $";
+const char loadcfg_rcs[] = "$Id: loadcfg.c,v 1.15 2001/06/07 23:13:40 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loadcfg.c,v $
*
* Revisions :
* $Log: loadcfg.c,v $
+ * Revision 1.15 2001/06/07 23:13:40 jongfoster
+ * Merging ACL and forward files into config file.
+ * Cosmetic: Sorting config file options alphabetically.
+ * Cosmetic: Adding brief syntax comments to config file options.
+ *
* Revision 1.14 2001/06/07 14:46:25 joergs
* Missing make_path() added for re_filterfile.
*
*********************************************************************/
struct configuration_spec * load_config(void)
{
- char buf[BUFSIZ];
+ char buf[BUFFER_SIZE];
char *p, *q;
FILE *configfp = NULL;
struct configuration_spec * config = NULL;
while (read_config_line(buf, sizeof(buf), configfp, fs) != NULL)
{
- char cmd[BUFSIZ];
- char arg[BUFSIZ];
- char tmp[BUFSIZ];
+ char cmd[BUFFER_SIZE];
+ char arg[BUFFER_SIZE];
+ char tmp[BUFFER_SIZE];
#ifdef ACL_FILES
struct access_control_list *cur_acl;
#endif /* def ACL_FILES */
-const char loaders_rcs[] = "$Id: loaders.c,v 1.14 2001/06/01 03:27:04 oes Exp $";
+const char loaders_rcs[] = "$Id: loaders.c,v 1.15 2001/06/07 23:14:14 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loaders.c,v $
*
* Revisions :
* $Log: loaders.c,v $
+ * Revision 1.15 2001/06/07 23:14:14 jongfoster
+ * Removing ACL and forward file loaders - these
+ * files have been merged into the config file.
+ * Cosmetic: Moving unloader funcs next to their
+ * respective loader funcs
+ *
* Revision 1.14 2001/06/01 03:27:04 oes
* Fixed line continuation problem
*
if (url->path)
{
int errcode;
- char rebuf[BUFSIZ];
+ char rebuf[BUFFER_SIZE];
if (NULL == (url->preg = zalloc(sizeof(*url->preg))))
{
char *read_config_line(char *buf, int buflen, FILE *fp, struct file_list *fs)
{
char *p, *q;
- char linebuf[BUFSIZ];
+ char linebuf[BUFFER_SIZE];
int contflag = 0;
*buf = '\0';
struct block_spec *b, *bl;
struct url_spec **tl;
- char buf[BUFSIZ], *p, *q;
+ char buf[BUFFER_SIZE], *p, *q;
int reject, trusted;
struct file_list *fs;
struct re_filterfile_spec *bl;
struct file_list *fs;
- char buf[BUFSIZ];
+ char buf[BUFFER_SIZE];
int error;
pcrs_job *dummy;
/* vim:ts=3: */
-const char miscutil_rcs[] = "$Id: miscutil.c,v 1.10 2001/06/07 14:51:38 joergs Exp $";
+const char miscutil_rcs[] = "$Id: miscutil.c,v 1.11 2001/06/07 23:09:19 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/miscutil.c,v $
*
* Revisions :
* $Log: miscutil.c,v $
+ * Revision 1.11 2001/06/07 23:09:19 jongfoster
+ * Cosmetic indentation changes.
+ *
* Revision 1.10 2001/06/07 14:51:38 joergs
* make_path() no longer adds '/' if the dir already ends in '/'.
*
#include <malloc.h>
#include <ctype.h>
-#include "miscutil.h"
+/*\r
+ * FIXME: Only need project.h for BUFFER_SIZE. It would be nice\r
+ * to remove this dependency.\r
+ */\r
+#include "project.h"\r
+#include "miscutil.h"\r
#include "errlog.h"
const char miscutil_h_rcs[] = MISCUTIL_H_VERSION;
char *safe_strerror(int err)
{
char *s = NULL;
- char buf[BUFSIZ];
+ char buf[BUFFER_SIZE];
#ifdef HAVE_STRERROR
-const char showargs_rcs[] = "$Id: showargs.c,v 1.13 2001/06/06 09:37:59 sarantis Exp $";
+const char showargs_rcs[] = "$Id: showargs.c,v 1.14 2001/06/07 23:15:40 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/showargs.c,v $
*
* Revisions :
* $Log: showargs.c,v $
+ * Revision 1.14 2001/06/07 23:15:40 jongfoster
+ * Removing config->proxy_args_gateways
+ * Missing return statement added to end_proxy_args().
+ *
* Revision 1.13 2001/06/06 09:37:59 sarantis
* Fix misplaced comment start.
*
*********************************************************************/
void savearg(char *c, char *o, struct configuration_spec * config)
{
- char buf[BUFSIZ];
+ char buf[BUFFER_SIZE];
*buf = '\0';
char *end_proxy_args(struct configuration_spec * config)
{
char *b = NULL;
- char buf[BUFSIZ];
+ char buf[BUFFER_SIZE];
/* Instead of including *all* dot h's in the project (thus creating a
* tremendous amount of dependencies), I will concede to declaring them