obnox/tinyproxy.git
22 years agoMoved the safe_write() and safe_read() functions here.
Robert James Kaes [Sun, 16 Sep 2001 20:11:07 +0000 (20:11 +0000)]
Moved the safe_write() and safe_read() functions here.

22 years agoMoved the safe_read() and safe_write() functions into the sock.c file
Robert James Kaes [Sun, 16 Sep 2001 20:10:19 +0000 (20:10 +0000)]
Moved the safe_read() and safe_write() functions into the sock.c file
since they're now used in other places.

Added support for a true upstream proxy connection. This involved some
rewriting of the handle_connection() function and some of the support
functions so that they do perform the domain filtering and anonymous
filtering while still connecting to the upstream proxy. I think the code
should be cleaned up further.

22 years agoAdded the token for Upstream and the code the handle the upstream
Robert James Kaes [Sun, 16 Sep 2001 20:08:24 +0000 (20:08 +0000)]
Added the token for Upstream and the code the handle the upstream
directive in the configuration file.

22 years agoAdded the example for the upstream proxy directive.
Robert James Kaes [Sun, 16 Sep 2001 20:07:50 +0000 (20:07 +0000)]
Added the example for the upstream proxy directive.

22 years agoAdded a configure option for upstream proxy support.
Robert James Kaes [Sun, 16 Sep 2001 20:07:24 +0000 (20:07 +0000)]
Added a configure option for upstream proxy support.
Bumped the version number.

22 years agoAdded upstream proxy support.
Robert James Kaes [Sun, 16 Sep 2001 20:06:51 +0000 (20:06 +0000)]
Added upstream proxy support.

22 years agoFixed a problem where log messages could be missed during a rotate.
Robert James Kaes [Sun, 16 Sep 2001 05:38:27 +0000 (05:38 +0000)]
Fixed a problem where log messages could be missed during a rotate.

22 years agoMore changes.
Robert James Kaes [Sat, 15 Sep 2001 21:32:24 +0000 (21:32 +0000)]
More changes.

22 years agoAdded the send_http_message() function to handle sending messages back to
Robert James Kaes [Sat, 15 Sep 2001 21:29:59 +0000 (21:29 +0000)]
Added the send_http_message() function to handle sending messages back to
the client. It's used by httperr() and showstats().

22 years agoChanged to rotating the log file instead of truncating it. Also using the
Robert James Kaes [Sat, 15 Sep 2001 21:29:22 +0000 (21:29 +0000)]
Changed to rotating the log file instead of truncating it. Also using the
create_file_safely() function to eliminate potential security problems.

22 years agoRemoved the memory allocation log messages.
Robert James Kaes [Sat, 15 Sep 2001 21:28:25 +0000 (21:28 +0000)]
Removed the memory allocation log messages.

22 years agoChanged to using the send_http_message() function so that the HTTP headers
Robert James Kaes [Sat, 15 Sep 2001 21:27:58 +0000 (21:27 +0000)]
Changed to using the send_http_message() function so that the HTTP headers
are sent properly.

22 years agoRemoved the log messages related to memory allocation.
Robert James Kaes [Sat, 15 Sep 2001 21:26:14 +0000 (21:26 +0000)]
Removed the log messages related to memory allocation.
Move the SSL response header into into own function.
Added support for the status host.

22 years agoRemoved the log message when unable to allocate memory.
Robert James Kaes [Sat, 15 Sep 2001 21:24:18 +0000 (21:24 +0000)]
Removed the log message when unable to allocate memory.

22 years agoUpdated the authorization string.
Robert James Kaes [Sat, 15 Sep 2001 21:21:01 +0000 (21:21 +0000)]
Updated the authorization string.

22 years agoThe biggest change is the added support for SSL.
Robert James Kaes [Fri, 14 Sep 2001 23:45:15 +0000 (23:45 +0000)]
The biggest change is the added support for SSL.

22 years agoBumped up version number.
Robert James Kaes [Fri, 14 Sep 2001 23:44:47 +0000 (23:44 +0000)]
Bumped up version number.

22 years agoRemoved these files since their functionality has been replaced.
Robert James Kaes [Fri, 14 Sep 2001 23:43:59 +0000 (23:43 +0000)]
Removed these files since their functionality has been replaced.

22 years agoFinally got the SSL problem fixed. We can not send _any_ client headers
Robert James Kaes [Fri, 14 Sep 2001 21:16:56 +0000 (21:16 +0000)]
Finally got the SSL problem fixed. We can not send _any_ client headers
(including the new line) to the origin server when in tunnelling mode. SSL
now works correctly. Yeah.

22 years agoChanged the buffer pointer in safe_write() to be const void* since we're
Robert James Kaes [Fri, 14 Sep 2001 19:50:45 +0000 (19:50 +0000)]
Changed the buffer pointer in safe_write() to be const void* since we're
not changing the values.

Instead of building a new request and memory, simply send each part
separately. Actually uses less memory _and_ less code.

22 years agoWhen logging an error indicate the file descriptor and the error number.
Robert James Kaes [Fri, 14 Sep 2001 19:49:10 +0000 (19:49 +0000)]
When logging an error indicate the file descriptor and the error number.

22 years agoInclude the SSL field in the connection structure since we're going to
Robert James Kaes [Fri, 14 Sep 2001 04:56:58 +0000 (04:56 +0000)]
Include the SSL field in the connection structure since we're going to
handle SSL connections.

22 years agoMassive changes. Split process_method() into a bunch of smaller files and
Robert James Kaes [Fri, 14 Sep 2001 04:56:29 +0000 (04:56 +0000)]
Massive changes. Split process_method() into a bunch of smaller files and
changed the parsing code from REGEX and uri.c to a simplier sscanf()
method. Also, include code to handle SSL connections, but that's not quite
working yet.

22 years agoRemoved the reference to uri.c and uri.h since the new reqs.c doesn't use
Robert James Kaes [Fri, 14 Sep 2001 04:55:06 +0000 (04:55 +0000)]
Removed the reference to uri.c and uri.h since the new reqs.c doesn't use
them.

22 years agoFixed a memory leak in process_method().
Robert James Kaes [Wed, 12 Sep 2001 03:33:43 +0000 (03:33 +0000)]
Fixed a memory leak in process_method().

22 years agoFixed memory leak.
Robert James Kaes [Wed, 12 Sep 2001 03:33:15 +0000 (03:33 +0000)]
Fixed memory leak.

22 years agoChanged mallocs to callocs.
Robert James Kaes [Wed, 12 Sep 2001 03:32:54 +0000 (03:32 +0000)]
Changed mallocs to callocs.

22 years agoIncreased the number of "insertions" before the free memory.
Robert James Kaes [Wed, 12 Sep 2001 03:32:24 +0000 (03:32 +0000)]
Increased the number of "insertions" before the free memory.

22 years agoMore changes. These all relate to the switch from stack memory to heap
Robert James Kaes [Tue, 11 Sep 2001 19:28:00 +0000 (19:28 +0000)]
More changes. These all relate to the switch from stack memory to heap
memory.

22 years agoAdded the debugging realloc() function.
Robert James Kaes [Tue, 11 Sep 2001 19:27:27 +0000 (19:27 +0000)]
Added the debugging realloc() function.

22 years agoSet the stack size of threads to 32KB from 128KB.
Robert James Kaes [Tue, 11 Sep 2001 19:27:09 +0000 (19:27 +0000)]
Set the stack size of threads to 32KB from 128KB.

22 years agoSwitched the memory allocation for the large strings to heap based instead
Robert James Kaes [Tue, 11 Sep 2001 19:26:49 +0000 (19:26 +0000)]
Switched the memory allocation for the large strings to heap based instead
of stack based.

22 years agoBumped up the preversion number
Robert James Kaes [Tue, 11 Sep 2001 19:24:44 +0000 (19:24 +0000)]
Bumped up the preversion number

22 years agoStyle stuff.
Robert James Kaes [Tue, 11 Sep 2001 04:38:23 +0000 (04:38 +0000)]
Style stuff.

22 years agoUpdated version number.
Robert James Kaes [Tue, 11 Sep 2001 04:21:18 +0000 (04:21 +0000)]
Updated version number.

22 years agoFixed a memory leak.
Robert James Kaes [Tue, 11 Sep 2001 04:14:43 +0000 (04:14 +0000)]
Fixed a memory leak.

22 years agoUsed safecalloc() instead of malloc() and memset(). Fixed a potential
Robert James Kaes [Tue, 11 Sep 2001 04:13:58 +0000 (04:13 +0000)]
Used safecalloc() instead of malloc() and memset(). Fixed a potential
memory leak with the regular expression engine.

22 years agoComment cleanup.
Robert James Kaes [Tue, 11 Sep 2001 04:12:47 +0000 (04:12 +0000)]
Comment cleanup.

22 years agoMore changes.
Robert James Kaes [Sat, 8 Sep 2001 18:59:13 +0000 (18:59 +0000)]
More changes.

22 years agoNew pre version
Robert James Kaes [Sat, 8 Sep 2001 18:58:57 +0000 (18:58 +0000)]
New pre version

22 years agoChanged all the mallocs and callocs to use the new safemalloc and
Robert James Kaes [Sat, 8 Sep 2001 18:58:37 +0000 (18:58 +0000)]
Changed all the mallocs and callocs to use the new safemalloc and
safecalloc.

22 years agoLowered the number BUFARRAY and BUFSIZE constants to reduce the maximum
Robert James Kaes [Sat, 8 Sep 2001 18:58:02 +0000 (18:58 +0000)]
Lowered the number BUFARRAY and BUFSIZE constants to reduce the maximum
memory usage of a ternary tree. It now should not exceed 4MB of memory.

22 years agoLowered the number of insertions before the ternary tree is rebuilt.
Robert James Kaes [Sat, 8 Sep 2001 18:56:30 +0000 (18:56 +0000)]
Lowered the number of insertions before the ternary tree is rebuilt.

22 years agoAdded the debugging_(malloc|calloc|free) functions to help track memory
Robert James Kaes [Sat, 8 Sep 2001 18:55:58 +0000 (18:55 +0000)]
Added the debugging_(malloc|calloc|free) functions to help track memory
usage. There are also now defines for safe(malloc|calloc|free) which allow
for debugging code to be enabled or not.

22 years agoFixed a memory leak in thread_main().
Robert James Kaes [Sat, 8 Sep 2001 06:29:04 +0000 (06:29 +0000)]
Fixed a memory leak in thread_main().

22 years agoExplictly added the DETACHED creation method on threads.
Robert James Kaes [Fri, 7 Sep 2001 18:19:39 +0000 (18:19 +0000)]
Explictly added the DETACHED creation method on threads.

22 years agoUpdates.
Robert James Kaes [Fri, 7 Sep 2001 04:21:53 +0000 (04:21 +0000)]
Updates.

22 years agoError message cleanup.
Robert James Kaes [Fri, 7 Sep 2001 04:21:07 +0000 (04:21 +0000)]
Error message cleanup.

22 years agoFixed up return types.
Robert James Kaes [Fri, 7 Sep 2001 04:20:04 +0000 (04:20 +0000)]
Fixed up return types.

22 years agoError message cleanup.
Robert James Kaes [Fri, 7 Sep 2001 04:19:05 +0000 (04:19 +0000)]
Error message cleanup.
Include locking around access to the servers_waiting variable.

22 years agoUpdates
Robert James Kaes [Fri, 7 Sep 2001 00:45:32 +0000 (00:45 +0000)]
Updates

22 years agoAdded the ability to clear out the DNS cache after a certain number of
Robert James Kaes [Fri, 7 Sep 2001 00:40:34 +0000 (00:40 +0000)]
Added the ability to clear out the DNS cache after a certain number of
insertions.

22 years agoFixed the ternary_destroy() function which causes segfaults.
Robert James Kaes [Fri, 7 Sep 2001 00:38:03 +0000 (00:38 +0000)]
Fixed the ternary_destroy() function which causes segfaults.

22 years agoStill need to fix a problem with tinproxy segfaulting when we try to
Robert James Kaes [Thu, 6 Sep 2001 21:53:16 +0000 (21:53 +0000)]
Still need to fix a problem with tinproxy segfaulting when we try to
delete the ternary tree.

22 years agoMake sure that freeptr actually points to something before we try to
Robert James Kaes [Thu, 6 Sep 2001 21:52:31 +0000 (21:52 +0000)]
Make sure that freeptr actually points to something before we try to
invoke it.

22 years agoTry moving the kill thread code into the thread_main() function so it can
Robert James Kaes [Thu, 6 Sep 2001 21:16:35 +0000 (21:16 +0000)]
Try moving the kill thread code into the thread_main() function so it can
check if there are too many thread after it's finished with it's request.
Needs to be cleaned up further (if this is the right idea) because of the
locking around the servers_waiting variable.

22 years agoInitialzed the servers_waiting explictly. Added debugging code to find out
Robert James Kaes [Thu, 6 Sep 2001 19:00:47 +0000 (19:00 +0000)]
Initialzed the servers_waiting explictly. Added debugging code to find out
why the threads are not being closed.

22 years agoNew news. :)
Robert James Kaes [Tue, 4 Sep 2001 18:31:43 +0000 (18:31 +0000)]
New news. :)

22 years agoMore updates.
Robert James Kaes [Tue, 4 Sep 2001 18:22:12 +0000 (18:22 +0000)]
More updates.

22 years agoMoved the compare_header() test after the skip header test.
Robert James Kaes [Tue, 4 Sep 2001 18:22:00 +0000 (18:22 +0000)]
Moved the compare_header() test after the skip header test.

22 years agoSwitched to a case insensitive search method.
Robert James Kaes [Tue, 4 Sep 2001 17:53:41 +0000 (17:53 +0000)]
Switched to a case insensitive search method.

22 years agoBumped the version number.
Robert James Kaes [Tue, 4 Sep 2001 16:52:04 +0000 (16:52 +0000)]
Bumped the version number.

22 years agoUpdates.
Robert James Kaes [Tue, 4 Sep 2001 16:50:45 +0000 (16:50 +0000)]
Updates.

22 years agoFixed a format string bug with the syslog function.
Robert James Kaes [Tue, 4 Sep 2001 16:50:22 +0000 (16:50 +0000)]
Fixed a format string bug with the syslog function.

22 years agoHeaders MUST have quotes around them.
Robert James Kaes [Fri, 31 Aug 2001 15:20:56 +0000 (15:20 +0000)]
Headers MUST have quotes around them.

22 years agoSpelling and grammar fixes.
Robert James Kaes [Thu, 30 Aug 2001 22:00:36 +0000 (22:00 +0000)]
Spelling and grammar fixes.

22 years agoNew information for Thursday, August 30, 2001
Robert James Kaes [Thu, 30 Aug 2001 16:58:41 +0000 (16:58 +0000)]
New information for Thursday, August 30, 2001

22 years agoAnother new version.
Robert James Kaes [Thu, 30 Aug 2001 16:54:04 +0000 (16:54 +0000)]
Another new version.

22 years agoMore fixes.
Robert James Kaes [Thu, 30 Aug 2001 16:53:36 +0000 (16:53 +0000)]
More fixes.

22 years agoRemoved the xstrstr() function since it is no longer used. reqs.c was the
Robert James Kaes [Thu, 30 Aug 2001 16:52:56 +0000 (16:52 +0000)]
Removed the xstrstr() function since it is no longer used. reqs.c was the
only place it was called from, and strstr() will do the same work.

22 years agoRenamed ternary_insert() to ternary_insert_replace() and added the ability
Robert James Kaes [Thu, 30 Aug 2001 16:52:09 +0000 (16:52 +0000)]
Renamed ternary_insert() to ternary_insert_replace() and added the ability
to replace existing data (without a memory leak.) Added two DEFINES
ternary_insert() and ternary_replace() to aid in coding.

22 years agoReplaced the call to xstrstr() with strstr().
Robert James Kaes [Thu, 30 Aug 2001 16:51:10 +0000 (16:51 +0000)]
Replaced the call to xstrstr() with strstr().

22 years agoRemoved the insert_data() function and made the LOCKing go around the
Robert James Kaes [Thu, 30 Aug 2001 16:50:42 +0000 (16:50 +0000)]
Removed the insert_data() function and made the LOCKing go around the
entire dnscache() function. Replaced the "replace" code in dns_insert()
with a call to ternary_replace().

22 years agoNew style and new information.
Robert James Kaes [Wed, 29 Aug 2001 15:56:48 +0000 (15:56 +0000)]
New style and new information.

22 years agoNew minor version number.
Robert James Kaes [Wed, 29 Aug 2001 15:29:29 +0000 (15:29 +0000)]
New minor version number.

22 years agoMore change logs.
Robert James Kaes [Wed, 29 Aug 2001 04:06:00 +0000 (04:06 +0000)]
More change logs.

22 years agoFixed a problem where the REGEX library was included even if the system
Robert James Kaes [Wed, 29 Aug 2001 04:05:33 +0000 (04:05 +0000)]
Fixed a problem where the REGEX library was included even if the system
already had a working library.

22 years agoText clean up.
Robert James Kaes [Wed, 29 Aug 2001 04:04:01 +0000 (04:04 +0000)]
Text clean up.

22 years agoRemoved the new_dnscache() call.
Robert James Kaes [Wed, 29 Aug 2001 04:01:05 +0000 (04:01 +0000)]
Removed the new_dnscache() call.

22 years agoCleaned up the locking code to make it more fine grained. Did this since
Robert James Kaes [Wed, 29 Aug 2001 04:00:22 +0000 (04:00 +0000)]
Cleaned up the locking code to make it more fine grained. Did this since
dncache.c has locking itself now.

22 years agoChanged how we handle when compiled with debug code.
Robert James Kaes [Wed, 29 Aug 2001 03:59:12 +0000 (03:59 +0000)]
Changed how we handle when compiled with debug code.

22 years agoRemoved the new_dnscache() function and the ternary.h include.
Robert James Kaes [Wed, 29 Aug 2001 03:58:39 +0000 (03:58 +0000)]
Removed the new_dnscache() function and the ternary.h include.

22 years agoAdded a more fine grained locking system for multiple threads.
Robert James Kaes [Wed, 29 Aug 2001 03:57:51 +0000 (03:57 +0000)]
Added a more fine grained locking system for multiple threads.
Removed the new_dnscache() function and moved it into dnscache().
Fixed a memory leak in dns_insert().

22 years agoUpdate regarding the log level problems.
Robert James Kaes [Tue, 28 Aug 2001 15:54:52 +0000 (15:54 +0000)]
Update regarding the log level problems.

22 years agoNew version number.
Robert James Kaes [Tue, 28 Aug 2001 15:52:53 +0000 (15:52 +0000)]
New version number.

22 years agoFixed a problem in log.c
Robert James Kaes [Tue, 28 Aug 2001 15:52:40 +0000 (15:52 +0000)]
Fixed a problem in log.c

22 years agoThe logging levels _now_ output the correct information depending on where
Robert James Kaes [Tue, 28 Aug 2001 15:51:58 +0000 (15:51 +0000)]
The logging levels _now_ output the correct information depending on where
the config file sets it.

22 years agoMore changes.
Robert James Kaes [Tue, 28 Aug 2001 04:35:03 +0000 (04:35 +0000)]
More changes.

22 years agoAdded an extra CRNL to the end of the HTML body.
Robert James Kaes [Tue, 28 Aug 2001 04:33:54 +0000 (04:33 +0000)]
Added an extra CRNL to the end of the HTML body.

22 years agoChanged the default stack size to 128 KB.
Robert James Kaes [Tue, 28 Aug 2001 04:33:21 +0000 (04:33 +0000)]
Changed the default stack size to 128 KB.

22 years agoMoved the strip new line/carriage return from the end of a line into a
Robert James Kaes [Tue, 28 Aug 2001 04:32:14 +0000 (04:32 +0000)]
Moved the strip new line/carriage return from the end of a line into a
separate function.

22 years agoFixed a problem with the POSIX threading on FreeBSD systems.
Robert James Kaes [Mon, 27 Aug 2001 19:57:24 +0000 (19:57 +0000)]
Fixed a problem with the POSIX threading on FreeBSD systems.

22 years agoMore news of course.
Robert James Kaes [Mon, 27 Aug 2001 17:51:40 +0000 (17:51 +0000)]
More news of course.

22 years agoStop CVS from giving me an error.
Robert James Kaes [Mon, 27 Aug 2001 17:48:27 +0000 (17:48 +0000)]
Stop CVS from giving me an error.

22 years agoMore changes as per usual. :)
Robert James Kaes [Mon, 27 Aug 2001 17:47:40 +0000 (17:47 +0000)]
More changes as per usual. :)

22 years agoBumped up the version number.
Robert James Kaes [Mon, 27 Aug 2001 17:47:25 +0000 (17:47 +0000)]
Bumped up the version number.
Added a test for FreeBSD so that it can set GCC to compile with POSIX
threading.

22 years agoChanged the MIME type to text/html rather than the incorrect text/mime.
Robert James Kaes [Mon, 27 Aug 2001 17:46:50 +0000 (17:46 +0000)]
Changed the MIME type to text/html rather than the incorrect text/mime.

22 years agoMoved some of the includes around so that FreeBSD can compile correctly.
Robert James Kaes [Mon, 27 Aug 2001 17:46:20 +0000 (17:46 +0000)]
Moved some of the includes around so that FreeBSD can compile correctly.

22 years agoChanged the default stack size since some OS's have a stack size which is
Robert James Kaes [Mon, 27 Aug 2001 17:45:50 +0000 (17:45 +0000)]
Changed the default stack size since some OS's have a stack size which is
too small.

22 years agoFixed a problem where the connect messages were not getting logged if the
Robert James Kaes [Mon, 27 Aug 2001 17:44:55 +0000 (17:44 +0000)]
Fixed a problem where the connect messages were not getting logged if the
log level was set to INFO.