summaryrefslogtreecommitdiff
path: root/src/sock.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2005-07-12* Specified Correct typedef in getsock_ip()Robert James Kaes1-2/+2
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.
2004-04-27Added the "BindSame" configure directive from Oswald Buddenhagen.Robert James Kaes1-10/+38
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-02-18Converted the various socket functions to work with both IPv4 and IPv6Robert James Kaes1-86/+84
addresses.
2002-10-03#Style formatting change.Robert James Kaes1-2/+2
2002-05-31(getpeer_information): Fixed a problem retrieving the FQDN of a host because ↵Robert James Kaes1-3/+4
I was passing in an incorrect parameter to gethostbyaddr(). D'oh.
2002-05-27(opensock): Changed a comment around to better state what the code is ↵Robert James Kaes1-2/+2
actually doing.
2002-05-26Removed the DNS API calls and replaced them with the standardRobert James Kaes1-24/+15
gethostbyname() and gethostbyaddr() functions. This is possible because tinyproxy now uses a standard pre-forked() method.
2002-05-24Fixed some spelling mistakes, and removed the getpeer_ip() andRobert James Kaes1-67/+1
getpeer_string() functions as they've been replaced by the getpeer_information() function.
2002-05-23Changed the lookup_domain() function to use the new "dnsserver" API.Robert James Kaes1-255/+67
Also moved safe_write(), safe_read(), readline(), and write_message() functions into their own file.
2002-04-24bind_address has been moved inside the config structure. Fixed up aRobert James Kaes1-5/+6
problem where "data" was being freed even if it had not been allocated (because of an error condition.)
2002-04-22The "Bind" directive sets a binding address which the outgoing connectionsRobert James Kaes1-4/+4
will use.
2002-04-18Whoops. The previous include only had the code conditionally removed.Robert James Kaes1-9/+1
Remove for real this time.
2002-04-18Removed the call to inet_aton() since the gethostbyname() function handlesRobert James Kaes1-1/+3
the dotted-decimal case itself.
2002-04-18Removed the call to hstrerror() in the getpeer_string() function. It'sRobert James Kaes1-3/+2
not available on all machines.
2002-04-17Removed the LOOKUP_LOCK() and LOOKUP_UNLOCK() macros since I believe IRobert James Kaes1-12/+4
need locking around both gethostbyname() and gethostbyaddr() at the same time.
2002-04-16Tightened the lookup_domain() function.Robert James Kaes1-3/+2
2002-04-15Added a test to make sure the "whole_buffer" could be allocated.Robert James Kaes1-3/+5
2002-04-13Added additional error handling for the bind() and listen() system callsRobert James Kaes1-3/+11
when setting up the listening socket.
2002-04-13Modified the opensock() function to respect the Listen directive. If it'sRobert James Kaes1-1/+17
set, bind all outgoing addresses to this local address.
2001-12-24Added the write_message() function (from reqs.c)Robert James Kaes1-1/+53
2001-12-19Changed the calls to write() to send() so that we can use send(...,Robert James Kaes1-2/+2
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-17Added the assert() calls to safe_write() to make sure the arguments areRobert James Kaes1-1/+5
sane.
2001-12-15Changed safe_write() to fully send all the data in the buffer it wasRobert James Kaes1-8/+24
passed. Also safe_write() and safe_read() now use char pointer buffers rather than the void pointer style.
2001-12-15Added the host name lookup code (which use to be in the DNS cachingRobert James Kaes1-3/+46
system.)
2001-11-25Add support to limit the maximum size of the input line (to 128KB whichRobert James Kaes1-1/+11
should be _more_ than enough for any header line. :)
2001-11-23Style changes. Also replaces all mallocs with safemalloc, etc.Robert James Kaes1-12/+8
2001-11-22Replaced the readline() function with a new version which has noRobert James Kaes1-59/+134
restrictions on the length of a line (unless you fill memory of course.) Reformated the source.
2001-11-12Changed the read() call into a recv() call with a flag of NOSIGNAL since IRobert James Kaes1-5/+9
don't want signals messing up my calling conventions.
2001-10-25Bit of source code clean up.Robert James Kaes1-1/+2
2001-10-24Error message cleanup to make the information more informative.Robert James Kaes1-7/+7
2001-10-23Fixed a spelling problem in a log message.Robert James Kaes1-2/+2
2001-10-23Moved the zero-length string setting to outside the tests in getpeer_*()Robert James Kaes1-4/+15
functions. Also added a more robust error reporting for DNS errors.
2001-10-22Changed the getpeer_*() functions to return the reason why the name or IPRobert James Kaes1-3/+3
address could not be looked up.
2001-10-22Fixed a problem where a user's variable would be uninitialized if a DNSRobert James Kaes1-1/+3
lookup failed.
2001-09-16Moved the safe_write() and safe_read() functions here.Robert James Kaes1-1/+31
2001-09-07Error message cleanup.Robert James Kaes1-4/+4
2001-08-29Cleaned up the locking code to make it more fine grained. Did this sinceRobert James Kaes1-18/+10
dncache.c has locking itself now.
2001-05-27Removed the SA define.Robert James Kaes1-26/+31
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-23Added ASSERT statements.Robert James Kaes1-1/+20
2000-09-11Needed locking in getpeer_string().Robert James Kaes1-282/+102
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-03-31Completely rewrote the readline function.Robert James Kaes1-39/+79
2000-02-16This commit was generated by cvs2svn to compensate for changes in r2,Steven Young1-0/+362
which included commits to RCS files with non-trunk default branches.