summaryrefslogtreecommitdiffhomepage
path: root/src/sock.h
AgeCommit message (Collapse)Author
2020-11-10WIP: BindIPv6MappedMikael Magnusson
2020-11-07WIP: BindIPv4MappedMikael Magnusson
2020-09-18transparent: workaround old glibc bug on RHEL7rofl0r
it's been reported[0] that RHEL7 fails to properly set the length parameter of the getsockname() call to the length of the required struct sockaddr type, and always returns the length passed if it is big enough. the SOCKADDR_UNION_* macros originate from my microsocks[1] project, and facilitate handling of the sockaddr mess without nasty casts. [0]: https://github.com/tinyproxy/tinyproxy/issues/45#issuecomment-694594990 [1]: https://github.com/rofl0r/microsocks
2020-09-16listen_fds: use sblistrofl0r
2019-12-21do hostname resolution only when it is absolutely necessary for ACL checkrofl0r
tinyproxy used to do a full hostname resolution whenever a new client connection happened, which could cause very long delays (as reported in #198). there's only a single place/scenario that actually requires a hostname, and that is when an Allow/Deny rule exists for a hostname or domain, rather than a raw IP address. since it is very likely this feature is not very widely used, it makes absolute sense to only do the costly resolution when it is unavoidable.
2019-12-21move sockaddr_union to sock.hrofl0r
2013-11-09child: use a list of listen_fds instead of one single listenfd.Michael Adam
This prepares listenting on multiple sockets, which will be ussed to fix listening on the wildcard (listen on both ipv6 and ipv4) and help add the support for multiple Listen statements in the config Signed-off-by: Michael Adam <obnox@samba.org>
2013-11-09sock: add addr argument to listen_sock()Michael Adam
instead of using config.ipAddr internally. This is in preparation to make it possible to call it for multiple addresses. Signed-off-by: Michael Adam <obnox@samba.org>
2013-11-09sock/child: remove global variable addrlen.Michael Adam
This changes listen_sock() to not return the addrlen of the used address from getaddrinfo call to the caller, stored in global addrlen in child.c. This was only used to be able to allocate enough space for the arguments to the later accept call depending on whether IPv4 or IPv6 is used. This removes the need to pass this info by always allocating sizeof(struct sockaddr_storage) instead, which is enough to carry both sockaddr_in and sockaddr_in6. Signed-off-by: Michael Adam <obnox@samba.org>
2008-12-01Reformat code to GNU coding styleMukund Sivaraman
This is a commit which simply ran all C source code files through GNU indent. No other modifications were made.
2008-05-24Updated copyright, license notices in source codeMukund Sivaraman
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.
2005-08-15* [Indent] Ran Source Through indentRobert James Kaes
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.
2004-04-27Added the "BindSame" configure directive from Oswald Buddenhagen.Robert James Kaes
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 Kaes
addresses.
2003-01-27# Style clean up.Robert James Kaes
2002-05-23Changed the lookup_domain() function to use the new "dnsserver" API.Robert James Kaes
Also moved safe_write(), safe_read(), readline(), and write_message() functions into their own file.
2001-12-24Added the write_message() function (from reqs.c)Robert James Kaes
2001-12-15Changed safe_write() to fully send all the data in the buffer it wasRobert James Kaes
passed. Also safe_write() and safe_read() now use char pointer buffers rather than the void pointer style.
2001-11-22Replaced the readline() function with a new version which has noRobert James Kaes
restrictions on the length of a line (unless you fill memory of course.) Reformated the source.
2001-10-25Changed the included headers to be only the "tinyproxy.h" since itRobert James Kaes
contains all the code for properly bringing in the system headers (in the correct order and with proper dependancies.)
2001-09-16Moved the safe_write() and safe_read() functions here.Robert James Kaes
2001-06-02Fixed up the names of the DEFINES.Robert James Kaes
2001-05-27Removed the SA define.Robert James Kaes
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.)
2000-09-11Needed locking in getpeer_string().Robert James Kaes
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-02-16This commit was generated by cvs2svn to compensate for changes in r2,Steven Young
which included commits to RCS files with non-trunk default branches.