Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1142aeff25 |
No files matched your search
@@ -1,21 +1,5 @@
|
||||
2001-08-26 Robert James Kaes <rjkaes@flarenet.com>
|
||||
|
||||
* src/utils.c (httperr): Split the headers from the actual message
|
||||
and include more headers like Date, Server, Content-Length,
|
||||
etc. Also set the type for the error message to const char*.
|
||||
|
||||
* src/reqs.c (process_method): Fixed a SEGV problem if an invalid
|
||||
request was submitted.
|
||||
|
||||
* Makefile.am (EXTRA_DIST): Don't include ./reconf in the
|
||||
tarball.
|
||||
|
||||
* src/log.c (log_message): Fixed a problem with the new LOG_CONN
|
||||
log level.
|
||||
|
||||
* configure.in: The debugging code was being included even on
|
||||
non-debugging builds.
|
||||
|
||||
* src/anonymous.c (anonymous_insert): Moved the creation of the
|
||||
search tree into the anonymous_insert() function. Therefore, the
|
||||
search tree is _not_ created until the first insertion. This
|
||||
|
||||
+1
-1
@@ -1,2 +1,2 @@
|
||||
EXTRA_DIST = configure acconfig.h aclocal.m4 acinclude.m4
|
||||
EXTRA_DIST = configure acconfig.h aclocal.m4 acinclude.m4 reconf
|
||||
SUBDIRS = src doc
|
||||
@@ -3,23 +3,21 @@
|
||||
====
|
||||
|
||||
Well so much for the 1.4.0 version being the best tinyproxy---there
|
||||
were bugs. The most serious was a segmentation fault problem when an
|
||||
invalid request was received. Also, anonymous filtering was not
|
||||
actually working. Another bug fix is that on Debian systems (and maybe
|
||||
others) child threads would not be closed if they had been created
|
||||
after tinyproxy had been started. Finally, if MaxClientRequests was
|
||||
set to 0, the status of the thread was not going back to T_WAITING.
|
||||
were bugs. The most serious was that anonymous filtering was not
|
||||
actually working. Another bug fix is that on Debian systems (and
|
||||
maybe others) child threads would not be closed if they had been
|
||||
created after tinyproxy had been started. Finally, if
|
||||
MaxClientRequests was set to 0, the status of the thread was not going
|
||||
back to T_WAITING.
|
||||
|
||||
Okay, now on to the new features. There is a new Connect log
|
||||
level. This is basically "Info" without info's noise. Also, the error
|
||||
reporting function sends back more HTTP headers, which should lead to
|
||||
a more standards compliant proxy.
|
||||
Okay, now on to the new features. There is only one feature which is
|
||||
the new Connect log level. This is basically "Info" without info's
|
||||
noise.
|
||||
|
||||
There are a couple of features which I'm working on for the next
|
||||
release. There has been requests for logging on tunnelled
|
||||
connections. Also, some people would like HTTP filtering on tunnelled
|
||||
connections. Finally, I do have the information to include SSL
|
||||
connections, so I will be including it in the next release.
|
||||
connections.
|
||||
|
||||
So, the above bugs are fixed, hopefully there are no other ones. The
|
||||
new features will be worked into the next few releases.
|
||||
+2
-3
@@ -1,4 +1,4 @@
|
||||
dnl $Id: configure.in,v 1.18 2001-08-27 03:47:47 rjkaes Exp $
|
||||
dnl $Id: configure.in,v 1.16 2001-08-26 21:22:09 rjkaes Exp $
|
||||
|
||||
dnl Devlopers, please strive to achieve this order:
|
||||
dnl
|
||||
@@ -19,7 +19,7 @@ AC_INIT()
|
||||
AC_CANONICAL_SYSTEM
|
||||
AC_DEFINE_UNQUOTED(TARGET_SYSTEM, "$target")
|
||||
|
||||
AM_INIT_AUTOMAKE(tinyproxy,1.4.1.3)
|
||||
AM_INIT_AUTOMAKE(tinyproxy,1.4.1)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
dnl
|
||||
@@ -212,7 +212,6 @@ if test "$enable_debug" = "yes" ; then
|
||||
YFLAGS="-v -d"
|
||||
else
|
||||
dnl No debugging information, include the optimizations
|
||||
CFLAGS="-DNDEBUG $CFLAGS"
|
||||
YFLAGS="-d"
|
||||
fi
|
||||
|
||||
|
||||
@@ -15,11 +15,10 @@ against the current tree and I'll integrate it if possible.
|
||||
much of a problem. Just need to modify the process_method() code
|
||||
to look up the URL and rewrite it. If we want to go really fancy
|
||||
with RegEx mapping this could get ugly. :)
|
||||
- Have the ability to send the data from the connections through an
|
||||
external filtering program. I kind of like this idea, but I don't
|
||||
really have a good way of doing it yet.
|
||||
Suggested: Ed Avis
|
||||
- Ed Avis suggests having tinyproxy have the ability to send the data
|
||||
from the connections through an external filtering program. I kind of
|
||||
like this idea, but I don't really have a good way of doing it yet.
|
||||
- Handle Secure Socket Layer (SSL) connections (usually port 443).
|
||||
- Include the ability to rewrite both incoming and outgoing headers.
|
||||
- Log requests for tunnelled connections
|
||||
- Allow HTTP header filtering through tunnelled connections
|
||||
- Allow selective logging. For example a person may only want to log
|
||||
error messages.
|
||||
- Include the ability to rewrite both incoming and outgoing headers.
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $Id: log.c,v 1.10 2001-08-26 23:37:26 rjkaes Exp $
|
||||
/* $Id: log.c,v 1.9 2001-08-26 21:10:04 rjkaes Exp $
|
||||
*
|
||||
* Logs the various messages which tinyproxy produces to either a log file or
|
||||
* the syslog daemon. Not much to it...
|
||||
@@ -76,11 +76,13 @@ void log_message(short int level, char *fmt, ...)
|
||||
/*
|
||||
* Figure out if we should write the message or not.
|
||||
*/
|
||||
if (level == LOG_INFO && log_level == LOG_CONN)
|
||||
return;
|
||||
|
||||
if (level > log_level)
|
||||
return;
|
||||
if (log_level != LOG_CONN) {
|
||||
if (level > log_level && level != LOG_CONN)
|
||||
return;
|
||||
} else {
|
||||
if (level == LOG_INFO)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HAVE_SYSLOG_H
|
||||
if (config.syslog && level == LOG_CONN)
|
||||
|
||||
+8
-10
@@ -1,4 +1,4 @@
|
||||
/* $Id: reqs.c,v 1.16 2001-08-27 03:44:22 rjkaes Exp $
|
||||
/* $Id: reqs.c,v 1.15 2001-08-26 21:11:55 rjkaes Exp $
|
||||
*
|
||||
* This is where all the work in tinyproxy is actually done. Incoming
|
||||
* connections have a new thread created for them. The thread then
|
||||
@@ -122,14 +122,14 @@ static int process_method(struct conn_s *connptr)
|
||||
log_message(LOG_ERR, "clientreq: regcomp");
|
||||
httperr(connptr, 503, HTTP503ERROR);
|
||||
update_stats(STAT_BADCONN);
|
||||
goto EARLY_EXIT;
|
||||
goto COMMON_EXIT;
|
||||
}
|
||||
if (regexec(&preg, inbuf, NMATCH, pmatch, 0) != 0) {
|
||||
log_message(LOG_ERR, "clientreq: regexec");
|
||||
regfree(&preg);
|
||||
httperr(connptr, 503, HTTP503ERROR);
|
||||
update_stats(STAT_BADCONN);
|
||||
goto EARLY_EXIT;
|
||||
goto COMMON_EXIT;
|
||||
}
|
||||
regfree(&preg);
|
||||
|
||||
@@ -147,7 +147,7 @@ static int process_method(struct conn_s *connptr)
|
||||
peer_ipaddr, inbuf);
|
||||
httperr(connptr, 400, HTTP400ERROR);
|
||||
update_stats(STAT_BADCONN);
|
||||
goto EARLY_EXIT;
|
||||
goto COMMON_EXIT;
|
||||
}
|
||||
|
||||
len = pmatch[URI_IND].rm_eo - pmatch[URI_IND].rm_so;
|
||||
@@ -157,7 +157,7 @@ static int process_method(struct conn_s *connptr)
|
||||
peer_ipaddr);
|
||||
httperr(connptr, 503, HTTP503ERROR);
|
||||
update_stats(STAT_BADCONN);
|
||||
goto EARLY_EXIT;
|
||||
goto COMMON_EXIT;
|
||||
}
|
||||
memcpy(buffer, inbuf + pmatch[URI_IND].rm_so, len);
|
||||
buffer[len] = '\0';
|
||||
@@ -166,7 +166,7 @@ static int process_method(struct conn_s *connptr)
|
||||
log_message(LOG_ERR, "clientreq: Problem with explode_uri");
|
||||
httperr(connptr, 503, HTTP503ERROR);
|
||||
update_stats(STAT_BADCONN);
|
||||
goto EARLY_EXIT;
|
||||
goto COMMON_EXIT;
|
||||
}
|
||||
safefree(buffer);
|
||||
|
||||
@@ -287,11 +287,9 @@ static int process_method(struct conn_s *connptr)
|
||||
free_uri(uri);
|
||||
return 0;
|
||||
|
||||
COMMON_EXIT:
|
||||
free_uri(uri);
|
||||
|
||||
EARLY_EXIT:
|
||||
COMMON_EXIT:
|
||||
safefree(request);
|
||||
free_uri(uri);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
+7
-48
@@ -1,4 +1,4 @@
|
||||
/* $Id: utils.c,v 1.5 2001-08-27 03:45:34 rjkaes Exp $
|
||||
/* $Id: utils.c,v 1.4 2001-05-27 02:38:46 rjkaes Exp $
|
||||
*
|
||||
* Misc. routines which are used by the various functions to handle strings
|
||||
* and memory allocation and pretty much anything else we can think of. Also,
|
||||
@@ -61,66 +61,25 @@ char *xstrstr(char *haystack, char *needle, size_t length,
|
||||
/*
|
||||
* Display an error to the client.
|
||||
*/
|
||||
#define HEADER_SIZE (1024 * 8)
|
||||
int httperr(struct conn_s *connptr, int err, const char *msg)
|
||||
int httperr(struct conn_s *connptr, int err, char *msg)
|
||||
{
|
||||
static char *headers = \
|
||||
"HTTP/1.0 %d %s\r\n" \
|
||||
"Server: %s/%s\r\n" \
|
||||
"Date: %s\r\n" \
|
||||
"Content-Type: text/mime\r\n" \
|
||||
"Content-Length: %d\r\n" \
|
||||
"Connection: close\r\n" \
|
||||
"\r\n";
|
||||
|
||||
static char *message = \
|
||||
static char *premsg = "HTTP/1.0 %d %s\r\n" \
|
||||
"Content-type: text/html\r\n\r\n" \
|
||||
"<html><head><title>%s</title></head>\r\n" \
|
||||
"<body>\r\n" \
|
||||
"<font size=\"+2\">Cache Error!</font><br>\r\n" \
|
||||
"An error of type %d occurred: %s\r\n" \
|
||||
"<hr>\r\n" \
|
||||
"<font size=\"-1\"><em>Generated by %s/%s</em></font>\r\n" \
|
||||
"<font size=\"-1\"><em>Generated by %s</em></font>\r\n" \
|
||||
"</body></html>\r\n";
|
||||
|
||||
char *header_buffer;
|
||||
char *message_buffer;
|
||||
int output_size;
|
||||
char timebuf[30];
|
||||
time_t global_time;
|
||||
|
||||
header_buffer = malloc(HEADER_SIZE);
|
||||
if (!header_buffer) {
|
||||
log_message(LOG_CRIT, "Out of memory!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
message_buffer = malloc(MAXBUFFSIZE);
|
||||
if (!message_buffer) {
|
||||
log_message(LOG_CRIT, "Out of memory!");
|
||||
safefree(header_buffer);
|
||||
return -1;
|
||||
}
|
||||
|
||||
global_time = time(NULL);
|
||||
strftime(timebuf, sizeof(timebuf), "%a, %d %b %Y %H:%M:%S GMT", gmtime(&global_time));
|
||||
|
||||
snprintf(message_buffer, MAXBUFFSIZE - 1, message, msg, err, msg, PACKAGE, VERSION);
|
||||
snprintf(header_buffer, HEADER_SIZE - 1, headers, err, msg, PACKAGE, VERSION, timebuf, strlen(message_buffer));
|
||||
|
||||
output_size = strlen(message_buffer) + strlen(header_buffer);
|
||||
connptr->output_message = malloc(output_size + 1);
|
||||
connptr->output_message = malloc(MAXBUFFSIZE);
|
||||
if (!connptr->output_message) {
|
||||
log_message(LOG_CRIT, "Out of memory!");
|
||||
safefree(header_buffer);
|
||||
safefree(message_buffer);
|
||||
return -1;
|
||||
}
|
||||
|
||||
strlcpy(connptr->output_message, header_buffer, output_size);
|
||||
strlcat(connptr->output_message, message_buffer, output_size);
|
||||
|
||||
safefree(header_buffer);
|
||||
safefree(message_buffer);
|
||||
snprintf(connptr->output_message, MAXBUFFSIZE, premsg, err, msg, msg, err, msg, VERSION);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
/* $Id: utils.h,v 1.5 2001-08-27 03:45:34 rjkaes Exp $
|
||||
/* $Id: utils.h,v 1.4 2001-05-27 02:38:46 rjkaes Exp $
|
||||
*
|
||||
* See 'utils.h' for a detailed description.
|
||||
*
|
||||
@@ -24,7 +24,7 @@
|
||||
extern char *xstrstr(char *haystack, char *needle, size_t length,
|
||||
bool_t case_sensitive);
|
||||
|
||||
extern int httperr(struct conn_s *connptr, int err, const char *msg);
|
||||
extern int httperr(struct conn_s *connptr, int err, char *msg);
|
||||
|
||||
extern void makedaemon(void);
|
||||
extern void pidfile_create(const char *path);
|
||||
|
||||
Reference in new issue
Block a user