Compare commits

..
7 Commits
Author SHA1 Message Date
cvs2svn fa3b9d2168 This commit was manufactured by cvs2svn to create tag
'rel_1_5_1pre2'.
2002-05-29 18:15:41 +00:00
Robert James Kaes de782144bd Bumped up the version number. 2002-05-29 18:15:40 +00:00
Robert James Kaes 0ef46467ad Updated ChangeLog for the 1.5.1pre2 release. 2002-05-29 18:15:08 +00:00
Robert James Kaes 9b13e9bda8 (add_header_to_connection): Removed the "double_cgi" boolean, since tinyproxy now ignores all the headers after a "double CGI" situation has occurred.
(get_all_headers): Instead of dropping duplicate headers when the "double CGI" situation occurs, tinyproxy will now drop _all_ the headers from the "inner" HTTP response.
2002-05-29 18:11:57 +00:00
Robert James Kaes 5fcb8553da (init_stats): Fixed a spelling mistake where the number of bytes being allocated was incorrect. 2002-05-29 17:31:01 +00:00
Robert James Kaes e7fcb5fc7d (add_header_to_connection): Added a boolean to indicate that a "Double CGI" situation is in affect. This is needed to solve a problem with some sites (like cgi.ebay.com) where they are sending two HTTP response lines (and associated headers) with a response.
(get_all_headers): Detect if a "Double CGI" situation has occured.
2002-05-28 20:40:01 +00:00
Robert James Kaes cf2bd809fb (get_all_headers): Added code to ignore a "response" line in a header. This was pointed out as being a problem with eBay (cgi.ebay.com)
(process_server_headers): Added code to make skip blank lines before a response line.
2002-05-28 04:53:33 +00:00
4 changed files with 77 additions and 7 deletions

No files matched your search

+32
View File
@@ -1,5 +1,37 @@
2002-05-29 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c (add_header_to_connection):
Removed the "double_cgi" boolean, since tinyproxy now ignores all
the headers after a "double CGI" situation has occurred.
(get_all_headers): Instead of dropping duplicate headers when the
"double CGI" situation occurs, tinyproxy will now drop _all_ the
headers from the "inner" HTTP response.
* src/stats.c (init_stats):
Fixed a spelling mistake where the number of bytes being allocated
was incorrect.
2002-05-28 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c (add_header_to_connection):
Added a boolean to indicate that a "Double CGI" situation is in
affect. This is needed to solve a problem with some sites (like
cgi.ebay.com) where they are sending two HTTP response lines (and
associated headers) with a response.
(get_all_headers): Detect if a "Double CGI" situation has occurred.
* src/reqs.c (get_all_headers):
Added code to ignore a "response" line in a header. This was
pointed out as being a problem with eBay (cgi.ebay.com)
(process_server_headers): Added code to make skip blank lines
before a response line.
2002-05-27 Robert James Kaes <rjkaes@flarenet.com>
* doc/Makefile.am:
Fixed up a problem where the tinyproxy manual page was not getting
included with the distribution.
* src/reqs.c (process_request):
Changed the filtering code around to handle both domains and URLs.
+2 -2
View File
@@ -1,4 +1,4 @@
dnl $Id: configure.ac,v 2.33 2002-05-27 00:49:06 rjkaes Exp $
dnl $Id: configure.ac,v 2.34 2002-05-29 18:15:40 rjkaes Exp $
dnl Devlopers, please strive to achieve this order:
dnl
@@ -14,7 +14,7 @@ dnl 8. System services
dnl
dnl Read the Autoconf manual for details.
AC_INIT([tinyproxy], [1.5.1pre1], [rjkaes@users.sourceforge.net])
AC_INIT([tinyproxy], [1.5.1pre2], [rjkaes@users.sourceforge.net])
AC_CONFIG_SRCDIR([src/tinyproxy.c])
AC_PREREQ(2.52)
+41 -3
View File
@@ -1,4 +1,4 @@
/* $Id: reqs.c,v 1.77 2002-05-27 02:00:22 rjkaes Exp $
/* $Id: reqs.c,v 1.80 2002-05-29 18:11:57 rjkaes Exp $
*
* This is where all the work in tinyproxy is actually done. Incoming
* connections have a new child created for them. The child then
@@ -559,6 +559,10 @@ get_all_headers(int fd, hashmap_t hashofheaders)
{
char *header;
ssize_t len;
bool_t double_cgi = FALSE;
assert(fd >= 0);
assert(hashofheaders != NULL);
for (;;) {
if ((len = readline(fd, &header)) <= 0) {
@@ -575,7 +579,26 @@ get_all_headers(int fd, hashmap_t hashofheaders)
return 0;
}
if (add_header_to_connection(hashofheaders, header, len) < 0) {
/*
* BUG FIX: The following code detects a "Double CGI"
* situation so that we can handle the nonconforming system.
* This problem was found when accessing cgi.ebay.com, and it
* turns out to be a wider spread problem as well.
*
* If "Double CGI" is in effect, duplicate headers are
* ignored.
*
* FIXME: Might need to change this to a more robust check.
*/
if (strncasecmp(header, "HTTP/", 5) == 0) {
double_cgi = TRUE;
safefree(header);
continue;
}
if (!double_cgi
&& add_header_to_connection(hashofheaders, header, len) < 0) {
safefree(header);
return -1;
}
@@ -857,9 +880,24 @@ process_server_headers(struct conn_s *connptr)
/* FIXME: Remember to handle a "simple_req" type */
/* Get the response line from the remote server. */
if ((len = readline(connptr->server_fd, &response_line)) <= 0)
retry:
len = readline(connptr->server_fd, &response_line);
if (len <= 0)
return -1;
/*
* Strip the new line and character return from the string.
*/
if (chomp(response_line, len) == len) {
/*
* If the number of characters removed is the same as the
* length then it was a blank line. Free the buffer and
* try again (since we're looking for a request line.)
*/
safefree(response_line);
goto retry;
}
hashofheaders = hashmap_create(HEADER_BUCKETS);
if (!hashofheaders) {
safefree(response_line);
+2 -2
View File
@@ -1,4 +1,4 @@
/* $Id: stats.c,v 1.10 2002-05-26 18:53:14 rjkaes Exp $
/* $Id: stats.c,v 1.11 2002-05-29 17:31:01 rjkaes Exp $
*
* This module handles the statistics for tinyproxy. There are only two
* public API functions. The reason for the functions, rather than just a
@@ -44,7 +44,7 @@ static struct stat_s *stats;
void
init_stats(void)
{
stats = malloc_shared_memory(sizeof(struct stat));
stats = malloc_shared_memory(sizeof(struct stat_s));
if (!stats)
return;