Commit Graph

160 Commits

Author SHA1 Message Date
Michael Adam
fd987e97f0 move handling of upstream list to new module upstream.{c,h}
Michael
2009-12-06 13:17:18 +01:00
Michael Adam
56ba3d45bd upstream: refactor assembly of upstream out of upstream_add
Michael
2009-12-06 13:17:18 +01:00
Mukund Sivaraman
0480185d07 Use capitalized name in error messages 2009-12-04 05:41:36 +05:30
Mukund Sivaraman
ec4b4d979f Use NULL for pointers 2009-11-17 02:40:03 +05:30
Michael Adam
7671ac1ae2 Don't add "Via:" header when DisableViaHeader == Yes. 2009-10-11 01:27:24 +02:00
Mukund Sivaraman
931b038b27 Use safer string functions 2009-10-02 15:21:42 +05:30
Michael Adam
2beaac96d3 handle_connection: make logic clearer when deciding whether to use connect/ssl
Michael
2009-09-28 11:24:33 +02:00
Mukund Sivaraman
630d44e67b [BB#10] Do not filter out transfer-encoding header 2009-09-27 16:27:51 +05:30
Michael Adam
eecf145dbb conf: turn XTinyproxy into a boolean option
This is what it actually is.

The string value was used in earlier versions to compare
against the uri->authority string. But not as a list of
sites to create an X-Tinyproxy header for, as the tinyproxy.conf
template states...

Michael
2009-09-27 12:32:31 +02:00
Mukund Sivaraman
1586b39138 Don't ignore retval of read() in reqs.c 2009-09-27 08:09:22 +05:30
Michael Adam
b95f7b9ffb Print a http error when the client headers could not be retrieved.
A ususal case here is that the headers were buggy, e.g. a line
without a ":" to separate the header field name from the value.
Previous behaviour was to silently return a blank page.

Michael
2009-09-20 22:24:18 +02:00
Michael Adam
fcb053a77c Revert "Remove unused parameter from process_request()"
This reverts commit f3312c22a0.

The "hashofheaders" argument to process_request() is needed
for building with reverse support or with transparent support.

Michael
2009-09-20 21:58:52 +02:00
Mukund Sivaraman
919eedc7f9 Remove inline keyword from static functions
The compiler inlines static functions as necessary anyway.
No more inline keywords exist in Tinyproxy source code. We want to
avoid using this keyword anyway.
2009-09-20 13:58:50 +05:30
Mukund Sivaraman
f3312c22a0 Remove unused parameter from process_request() 2009-09-15 04:11:58 +05:30
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
Michael Adam
735c9cb70f reqs.c: fix two implicit cast warnings.
Michael
2009-09-10 22:12:16 +02:00
Michael Adam
4092c70b06 Fix compiler warnings: make const strings const in process_server_headers().
Michael
2009-08-12 23:49:46 +02:00
Michael Adam
0d585dca8d Fix compiler warnings: make const strings const in process_client_headers().
Michael
2009-08-12 23:49:16 +02:00
Michael Adam
c59d012d11 Fix compiler warnings: Make const strings const in remove_connection_headers()
Michael
2009-08-12 23:47:45 +02:00
Michael Adam
1bfe8b6bea Fix implicit cast warning in get_all_headers().
And untangle assignment from check.

Michael
2009-08-09 23:30:04 +02:00
Michael Adam
3b6bc45c37 Fix two implicit cast warnings in pull_client_data().
Michael
2009-08-09 23:28:36 +02:00
Michael Adam
bfca4019b7 Fix three implicit cast warnings in process_request().
Michael
2009-08-09 23:08:54 +02:00
Michael Adam
43fcc9ea37 Fix implicit cast warning in upstream_add().
Michael
2009-08-09 23:06:31 +02:00
Michael Adam
00fd84586c Fix implicit cast warning in extract_ssl_url().
Michael
2009-08-09 23:05:28 +02:00
Michael Adam
ed23ceef64 Fix implicit cast warning in extract_http_url().
Michael
2009-08-09 23:04:27 +02:00
Michael Adam
bfa2c8ed77 Fix implicit cast warning in check_allowed_connect_ports().
Michael
2009-08-09 23:02:54 +02:00
Michael Adam
eb0deeb966 fix signed vs unsigned comparison warning in check_allowed_connect_ports().
Michael
2009-08-09 23:01:32 +02:00
Mukund Sivaraman
4518e4334d Wrap len in parantheses 2009-08-07 04:30:38 +05:30
Matthew Dempsky
59d273fdcc correctly handle folded header fields 2009-08-07 03:59:10 +05:30
Mukund Sivaraman
a21cd7e3ed Rename tinyproxy.[ch] to main.[ch] 2009-08-07 03:42:53 +05:30
Michael Adam
14a3e187ee check_acl(): remove the fd argument - it is not used.
Host name and IP address are provided instead.

Michael
2009-08-04 23:47:27 +02:00
Mukund Sivaraman
024b317de0 Convert tabs to spaces 2008-12-08 13:39:44 +00:00
Mukund Sivaraman
4c1ede779e Break at 80 columns 2008-12-08 12:26:08 +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
62ddbd5e74 pos can never be less than 0 as it's of type size_t
Also fix the type which is passed in from various places.
2008-08-24 10:58:16 +05:30
Robert James Kaes
5ea289d82e Moved transparent proxy code into its own file
Extracted the transparent proxy logic from reqs.c and placed it into a
separate file.

Signed-off-by: Robert James Kaes <rjk@wormbytes.ca>
2008-06-09 10:01:14 +05:30
Mukund Sivaraman
b0a3568de0 Renamed htmlerror.[ch] to html-error.[ch] 2008-05-24 13:47:14 +05:30
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
d5472ec0bd Renamed file to replace underscores in it with dashes 2008-03-13 15:07:37 -07:00
Robert James Kaes
4c58663041 * [Refactor] Moved Reverse Proxy Code
Moved the reverse proxy code from reqs.c into it's own files
(reverse_proxy.c).  The code in reqs.c is way too complicated, so I
want to move unrelated code into their own files to simplify the main
concepts in reqs.c.
2005-08-16 04:03:19 +00: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
a59117c7ca * Updated Copyright Email Addresses
Updated the copyright email addresses for Robert James Kaes.  The
users.sourceforge.net address should always exist.
2005-07-12 17:39:44 +00:00
Robert James Kaes
6042483a0e Removed the proxy-* headers from the list of headers to skip. Since
tinyproxy does not prompt for any proxy information from the client, it
should not be eating the proxy headers.  They are most likely needed by
an upstream proxy.
2005-07-06 21:44:08 +00:00
Robert James Kaes
c446e19003 Added code to handle HTTP/0.9 simple GET requests. 2004-08-24 16:35:27 +00:00
Robert James Kaes
b3943c21f2 (check_allowed_connect_ports): By default DENY any CONNECT requests
unless explicitly allowed by a configuration directive.
2004-08-12 20:15:04 +00:00
Robert James Kaes
28dd133623 (add_xtinyproxy_header): Removed the runtime error checking of the
connptr->server_fd variable and moved it into an assert since we
should never be called with invalid data.  Also made the function an
inline function since it's only called in one place.
2004-08-12 19:57:15 +00:00
Robert James Kaes
fd4b67bbb4 (strip_username_password): Removed one of the pointer variables since
it's no longer needed.  Reorganized the function to make it more
obvious what was actually being done.
2004-08-11 02:49:05 +00:00
Robert James Kaes
badc7673d0 Merged in changes from 1.6.3 2004-08-10 21:24:24 +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
aee5a63849 Removed unnecessary casts (mostly dealing with memory allocation.) I
should never have added them in the first place.  They don't really
buy anything, and they can hide bugs.
2004-02-13 21:27:42 +00:00