Mukund Sivaraman 
							
						 
					 
					
						
						
						
						
							
						
						
							7b9234f394 
							
						 
					 
					
						
						
							
							Indent code to Tinyproxy coding style  
						
						 
						
						... 
						
						
						
						The modified files were indented with GNU indent using the
following command:
indent -npro -kr -i8 -ts8 -sob -l80 -ss -cs -cp1 -bs -nlps -nprs -pcs \
    -saf -sai -saw -sc -cdw -ce -nut -il0
No other changes of any sort were made. 
						
					 
					
						2009-09-15 01:11:25 +05:30  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Mukund Sivaraman 
							
						 
					 
					
						
						
						
						
							
						
						
							a21cd7e3ed 
							
						 
					 
					
						
						
							
							Rename tinyproxy.[ch] to main.[ch]  
						
						 
						
						
						
					 
					
						2009-08-07 03:42:53 +05:30  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Mukund Sivaraman 
							
						 
					 
					
						
						
						
						
							
						
						
							024b317de0 
							
						 
					 
					
						
						
							
							Convert tabs to spaces  
						
						 
						
						
						
					 
					
						2008-12-08 13:39:44 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Mukund Sivaraman 
							
						 
					 
					
						
						
						
						
							
						
						
							a257703e59 
							
						 
					 
					
						
						
							
							Reformat code to GNU coding style  
						
						 
						
						... 
						
						
						
						This is a commit which simply ran all C source code files
through GNU indent. No other modifications were made. 
						
					 
					
						2008-12-01 15:01:11 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Mukund Sivaraman 
							
						 
					 
					
						
						
						
						
							
						
						
							249d4b7f33 
							
						 
					 
					
						
						
							
							Updated copyright, license notices in source code  
						
						 
						
						... 
						
						
						
						The notices have been changed to a more GNU look. Documentation
comments have been separated from the copyright header. I've tried to
keep all copyright notices intact. Some author contact details have
been updated. 
						
					 
					
						2008-05-24 13:35:49 +05:30  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Mukund Sivaraman 
							
						 
					 
					
						
						
						
						
							
						
						
							8848b647d7 
							
						 
					 
					
						
						
							
							Corrected datatype of salen to fix compiler warning  
						
						 
						
						
						
					 
					
						2008-03-13 15:09:21 -07:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							c0299e1868 
							
						 
					 
					
						
						
							
							* [Indent] Ran Source Through indent  
						
						 
						
						... 
						
						
						
						I re-indented the source code using indent with the following options:
indent -kr -bad -bap -nut -i8 -l80 -psl -sob -ss -ncs
There are now _no_ tabs in the source files, and all indentation is
eight spaces.  Lines are 80 characters long, and the procedure type is
on it's own line.  Read the indent manual for more information about
what each option means. 
						
					 
					
						2005-08-15 03:54:31 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							38f0b3a103 
							
						 
					 
					
						
						
							
							* Specified Correct typedef in getsock_ip()  
						
						 
						
						... 
						
						
						
						Changed the variable type for the namelen variable to the correct
socklen_t type.  The configure script already checked for it, but for
some reason I never got around to actually using it in this function. 
						
					 
					
						2005-07-12 20:34:26 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							18df4910a4 
							
						 
					 
					
						
						
							
							Added the "BindSame" configure directive from Oswald Buddenhagen.  
						
						 
						
						... 
						
						
						
						This allows tinyproxy to respond to a request bound to the same
interface that the request came in on.  As Oswald explains:
  "attached is a patch that adds the BindSame option. it causes
  binding an outgoing connection to the ip address of the respective
  incoming connection. that way one can simulate an entire proxy farm
  with a single instance of tinyproxy on a multi-homed machine."
Cool. 
						
					 
					
						2004-04-27 18:53:14 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							5ecd9157ce 
							
						 
					 
					
						
						
							
							Converted the various socket functions to work with both IPv4 and IPv6  
						
						 
						
						... 
						
						
						
						addresses. 
						
					 
					
						2004-02-18 20:18:53 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							745c40650b 
							
						 
					 
					
						
						
							
							#Style formatting change.  
						
						 
						
						
						
					 
					
						2002-10-03 20:50:59 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							f548ce72b2 
							
						 
					 
					
						
						
							
							(getpeer_information): Fixed a problem retrieving the FQDN of a host because I was passing in an incorrect parameter to gethostbyaddr().  D'oh.  
						
						 
						
						
						
					 
					
						2002-05-31 18:08:01 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							83a1a32f2a 
							
						 
					 
					
						
						
							
							(opensock): Changed a comment around to better state what the code is actually doing.  
						
						 
						
						
						
					 
					
						2002-05-27 01:57:48 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							523f2003fa 
							
						 
					 
					
						
						
							
							Removed the DNS API calls and replaced them with the standard  
						
						 
						
						... 
						
						
						
						gethostbyname() and gethostbyaddr() functions.  This is possible
because tinyproxy now uses a standard pre-forked() method. 
						
					 
					
						2002-05-26 18:51:17 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							a34db10d65 
							
						 
					 
					
						
						
							
							Fixed some spelling mistakes, and removed the getpeer_ip() and  
						
						 
						
						... 
						
						
						
						getpeer_string() functions as they've been replaced by the
getpeer_information() function. 
						
					 
					
						2002-05-24 04:44:36 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							478030c6ff 
							
						 
					 
					
						
						
							
							Changed the lookup_domain() function to use the new "dnsserver" API.  
						
						 
						
						... 
						
						
						
						Also moved safe_write(), safe_read(), readline(), and write_message()
functions into their own file. 
						
					 
					
						2002-05-23 18:25:55 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							d7c3f23610 
							
						 
					 
					
						
						
							
							bind_address has been moved inside the config structure.  Fixed up a  
						
						 
						
						... 
						
						
						
						problem where "data" was being freed even if it had not been allocated
(because of an error condition.) 
						
					 
					
						2002-04-24 16:48:34 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							08077cc9e1 
							
						 
					 
					
						
						
							
							The "Bind" directive sets a binding address which the outgoing connections  
						
						 
						
						... 
						
						
						
						will use. 
						
					 
					
						2002-04-22 19:35:24 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							aa68eb8540 
							
						 
					 
					
						
						
							
							Whoops.  The previous include only had the code conditionally removed.  
						
						 
						
						... 
						
						
						
						Remove for real this time. 
						
					 
					
						2002-04-18 21:54:50 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							1db154464e 
							
						 
					 
					
						
						
							
							Removed the call to inet_aton() since the gethostbyname() function handles  
						
						 
						
						... 
						
						
						
						the dotted-decimal case itself. 
						
					 
					
						2002-04-18 21:53:33 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							73a53daf38 
							
						 
					 
					
						
						
							
							Removed the call to hstrerror() in the getpeer_string() function.  It's  
						
						 
						
						... 
						
						
						
						not available on all machines. 
						
					 
					
						2002-04-18 18:48:22 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							3e60a5b819 
							
						 
					 
					
						
						
							
							Removed the LOOKUP_LOCK() and LOOKUP_UNLOCK() macros since I believe I  
						
						 
						
						... 
						
						
						
						need locking around both gethostbyname() and gethostbyaddr() at the same
time. 
						
					 
					
						2002-04-17 20:56:13 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							0e4436a070 
							
						 
					 
					
						
						
							
							Tightened the lookup_domain() function.  
						
						 
						
						
						
					 
					
						2002-04-16 03:21:46 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							4b7de22999 
							
						 
					 
					
						
						
							
							Added a test to make sure the "whole_buffer" could be allocated.  
						
						 
						
						
						
					 
					
						2002-04-15 04:16:01 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							c86d22226f 
							
						 
					 
					
						
						
							
							Added additional error handling for the bind() and listen() system calls  
						
						 
						
						... 
						
						
						
						when setting up the listening socket. 
						
					 
					
						2002-04-13 19:03:18 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							be47c1791d 
							
						 
					 
					
						
						
							
							Modified the opensock() function to respect the Listen directive.  If it's  
						
						 
						
						... 
						
						
						
						set, bind all outgoing addresses to this local address. 
						
					 
					
						2002-04-13 05:20:19 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							b10221fa07 
							
						 
					 
					
						
						
							
							Added the write_message() function (from reqs.c)  
						
						 
						
						
						
					 
					
						2001-12-24 00:01:32 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							7240af4333 
							
						 
					 
					
						
						
							
							Changed the calls to write() to send() so that we can use send(...,  
						
						 
						
						... 
						
						
						
						MSG_NOSIGNAL) and not get signals sent to the process. (easier for
debugging and the system doesn't need to worry about signals.) 
						
					 
					
						2001-12-19 20:41:28 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							fdb4952e5f 
							
						 
					 
					
						
						
							
							Added the assert() calls to safe_write() to make sure the arguments are  
						
						 
						
						... 
						
						
						
						sane. 
						
					 
					
						2001-12-17 00:00:24 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							b969ed4302 
							
						 
					 
					
						
						
							
							Changed safe_write() to fully send all the data in the buffer it was  
						
						 
						
						... 
						
						
						
						passed. Also safe_write() and safe_read() now use char pointer buffers
rather than the void pointer style. 
						
					 
					
						2001-12-15 20:04:04 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							a4934e2232 
							
						 
					 
					
						
						
							
							Added the host name lookup code (which use to be in the DNS caching  
						
						 
						
						... 
						
						
						
						system.) 
						
					 
					
						2001-12-15 05:58:30 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							8dc7035fbc 
							
						 
					 
					
						
						
							
							Add support to limit the maximum size of the input line (to 128KB which  
						
						 
						
						... 
						
						
						
						should be _more_ than enough for any header line. :) 
						
					 
					
						2001-11-25 02:21:46 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							fd3b313e9f 
							
						 
					 
					
						
						
							
							Style changes. Also replaces all mallocs with safemalloc, etc.  
						
						 
						
						
						
					 
					
						2001-11-23 01:18:43 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							d08d088d4a 
							
						 
					 
					
						
						
							
							Replaced the readline() function with a new version which has no  
						
						 
						
						... 
						
						
						
						restrictions on the length of a line (unless you fill memory of course.)
Reformated the source. 
						
					 
					
						2001-11-22 00:19:18 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							dde4e9adcc 
							
						 
					 
					
						
						
							
							Changed the read() call into a recv() call with a flag of NOSIGNAL since I  
						
						 
						
						... 
						
						
						
						don't want signals messing up my calling conventions. 
						
					 
					
						2001-11-12 21:10:51 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							5f8ee4fae3 
							
						 
					 
					
						
						
							
							Bit of source code clean up.  
						
						 
						
						
						
					 
					
						2001-10-25 05:10:32 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							b7b4d08758 
							
						 
					 
					
						
						
							
							Error message cleanup to make the information more informative.  
						
						 
						
						
						
					 
					
						2001-10-24 00:37:23 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							7d7958b0d7 
							
						 
					 
					
						
						
							
							Fixed a spelling problem in a log message.  
						
						 
						
						
						
					 
					
						2001-10-23 16:43:08 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							a746b9d0b2 
							
						 
					 
					
						
						
							
							Moved the zero-length string setting to outside the tests in getpeer_*()  
						
						 
						
						... 
						
						
						
						functions. Also added a more robust error reporting for DNS errors. 
						
					 
					
						2001-10-23 03:57:34 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							a6a026cb9e 
							
						 
					 
					
						
						
							
							Changed the getpeer_*() functions to return the reason why the name or IP  
						
						 
						
						... 
						
						
						
						address could not be looked up. 
						
					 
					
						2001-10-22 16:52:34 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							ad743c1e41 
							
						 
					 
					
						
						
							
							Fixed a problem where a user's variable would be uninitialized if a DNS  
						
						 
						
						... 
						
						
						
						lookup failed. 
						
					 
					
						2001-10-22 15:56:11 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							b9c4c480d2 
							
						 
					 
					
						
						
							
							Moved the safe_write() and safe_read() functions here.  
						
						 
						
						
						
					 
					
						2001-09-16 20:11:07 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							1a9dc4e7e8 
							
						 
					 
					
						
						
							
							Error message cleanup.  
						
						 
						
						
						
					 
					
						2001-09-07 04:21:07 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							fcff398f31 
							
						 
					 
					
						
						
							
							Cleaned up the locking code to make it more fine grained. Did this since  
						
						 
						
						... 
						
						
						
						dncache.c has locking itself now. 
						
					 
					
						2001-08-29 04:00:22 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							42b09e5441 
							
						 
					 
					
						
						
							
							Removed the SA define.  
						
						 
						
						... 
						
						
						
						Made the sock_mutex static since it's not referenced outside the file.
Changed the data types for some of the variables.
Cleaned up the readline function (changed data types and removed
variables.) 
						
					 
					
						2001-05-27 02:31:20 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							d32e0d1ccb 
							
						 
					 
					
						
						
							
							Added ASSERT statements.  
						
						 
						
						
						
					 
					
						2001-05-23 18:01:23 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							f6b7fe3f5c 
							
						 
					 
					
						
						
							
							Needed locking in getpeer_string().  
						
						 
						
						... 
						
						
						
						Added mutex locking around the dnscache() call.
Removed the global sockaddr and setup_fd variables.
Added the socket_blocking() and socket_nonblocking() functions.
Gutted the readling() function and replaced it with something similar to
the 1.0 version. :) 
						
					 
					
						2000-09-11 23:56:32 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Robert James Kaes 
							
						 
					 
					
						
						
						
						
							
						
						
							2562d28129 
							
						 
					 
					
						
						
							
							Completely rewrote the readline function.  
						
						 
						
						
						
					 
					
						2000-03-31 20:10:13 +00:00  
					
					
						 
						
							
							
							 
						
					 
				 
			
				
					
						
							
							
								 
								Steven Young 
							
						 
					 
					
						
						
						
						
							
						
						
							37e63909c0 
							
						 
					 
					
						
						
							
							This commit was generated by cvs2svn to compensate for changes in r2,  
						
						 
						
						... 
						
						
						
						which included commits to RCS files with non-trunk default branches. 
						
					 
					
						2000-02-16 17:32:49 +00:00