Removed all the code supporting the TCP tunnelling feature of
tinyproxy. There is really no need for this code, since there are perfectly good programs out there (like rinetd) which are designed for TCP tunnelling. tinyproxy should be a good HTTP proxy, nothing more, and nothing less; therefore, the tunnelling code is gone.
This commit is contained in:
parent
69be2b84d7
commit
3b2be8ae88
12
configure.ac
12
configure.ac
@ -1,4 +1,4 @@
|
||||
dnl $Id: configure.ac,v 2.44 2002-08-09 20:28:16 rjkaes Exp $
|
||||
dnl $Id: configure.ac,v 2.45 2002-11-03 17:10:33 rjkaes Exp $
|
||||
|
||||
dnl Devlopers, please strive to achieve this order:
|
||||
dnl
|
||||
@ -116,16 +116,6 @@ if test x"$filter_enabled" = x"yes"; then
|
||||
AC_DEFINE(FILTER_ENABLE)
|
||||
fi
|
||||
|
||||
dnl Include support for TCP tunneling
|
||||
AH_TEMPLATE([TUNNEL_SUPPORT], [Include TCP tunnelling support])
|
||||
AC_ARG_ENABLE(tunnel,
|
||||
[AC_HELP_STRING([--enable-tunnel],
|
||||
[Enable support for TCP tunneling (default is YES)])],
|
||||
tunnel_enabled=$enableval, tunnel_enabled=yes)
|
||||
if test x"$tunnel_enabled" = x"yes"; then
|
||||
AC_DEFINE(TUNNEL_SUPPORT)
|
||||
fi
|
||||
|
||||
dnl Include support for upstream proxies?
|
||||
AH_TEMPLATE([UPSTREAM_SUPPORT],
|
||||
[Include support for connecting to an upstream proxy.])
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: grammar.y,v 1.15 2002-06-07 18:29:40 rjkaes Exp $
|
||||
/* $Id: grammar.y,v 1.16 2002-11-03 17:10:32 rjkaes Exp $
|
||||
*
|
||||
* This is the grammar for tinyproxy's configuration file. It needs to be
|
||||
* in sync with scanner.l. If you know more about yacc and lex than I do
|
||||
@ -48,7 +48,7 @@ int yylex(void);
|
||||
%token KW_USER KW_GROUP
|
||||
%token KW_ANONYMOUS KW_XTINYPROXY
|
||||
%token KW_FILTER KW_FILTERURLS KW_FILTEREXTENDED KW_FILTER_DEFAULT_DENY
|
||||
%token KW_TUNNEL KW_UPSTREAM
|
||||
%token KW_UPSTREAM
|
||||
%token KW_CONNECTPORT KW_BIND
|
||||
%token KW_ALLOW KW_DENY
|
||||
|
||||
@ -152,15 +152,6 @@ statement
|
||||
log_message(LOG_WARNING, "X-Tinyproxy header support was not compiled in.");
|
||||
#endif
|
||||
}
|
||||
| KW_TUNNEL unique_address ':' NUMBER
|
||||
{
|
||||
#ifdef TUNNEL_SUPPORT
|
||||
config.tunnel_name = $2;
|
||||
config.tunnel_port = $4;
|
||||
#else
|
||||
log_message(LOG_WARNING, "Tunnel support was not compiled in.");
|
||||
#endif
|
||||
}
|
||||
| KW_UPSTREAM unique_address ':' NUMBER
|
||||
{
|
||||
#ifdef UPSTREAM_SUPPORT
|
||||
|
82
src/reqs.c
82
src/reqs.c
@ -1,12 +1,9 @@
|
||||
/* $Id: reqs.c,v 1.83 2002-10-17 19:27:08 rjkaes Exp $
|
||||
/* $Id: reqs.c,v 1.84 2002-11-03 17:10:32 rjkaes Exp $
|
||||
*
|
||||
* This is where all the work in tinyproxy is actually done. Incoming
|
||||
* connections have a new child created for them. The child then
|
||||
* processes the headers from the client, the response from the server,
|
||||
* and then relays the bytes between the two.
|
||||
* If TUNNEL_SUPPORT is enabled, then tinyproxy will actually work
|
||||
* as a simple buffering TCP tunnel. Very cool! (Robert actually uses
|
||||
* this feature for a buffering NNTP tunnel.)
|
||||
*
|
||||
* Copyright (C) 1998 Steven Young
|
||||
* Copyright (C) 1999-2002 Robert James Kaes (rjkaes@flarenet.com)
|
||||
@ -62,15 +59,6 @@
|
||||
# define UPSTREAM_CONFIGURED() (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Macro to help test if tunnel support is compiled in, and is enabled.
|
||||
*/
|
||||
#ifdef TUNNEL_SUPPORT
|
||||
# define TUNNEL_CONFIGURED() (config.tunnel_name && config.tunnel_port != -1)
|
||||
#else
|
||||
# define TUNNEL_CONFIGURED() (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Codify the test for the carriage return and new line characters.
|
||||
*/
|
||||
@ -1185,65 +1173,6 @@ connect_to_upstream(struct conn_s *connptr, struct request_s *request)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef TUNNEL_SUPPORT
|
||||
/*
|
||||
* If tunnel has been configured then redirect any connections to it.
|
||||
*/
|
||||
static int
|
||||
connect_to_tunnel(struct conn_s *connptr)
|
||||
{
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* NOTE: This must be fixed
|
||||
*
|
||||
* Needed to remove this for right now since it breaks the semantics
|
||||
* of the "tunnel" concept since the information from the remote host
|
||||
* wasn't being sent until _after_ data was sent by the client. This
|
||||
* is not correct since we should be sending the data regardless of
|
||||
* who sent it first.
|
||||
*
|
||||
* I'll have to look into this for the next release.
|
||||
*/
|
||||
char *request_buf;
|
||||
ssize_t len;
|
||||
int pos;
|
||||
|
||||
request_buf = safemalloc(HTTP_LINE_LENGTH);
|
||||
if (request_buf) {
|
||||
len = recv(connptr->client_fd, request_buf, HTTP_LINE_LENGTH - 1, MSG_PEEK);
|
||||
for (pos = 0; pos < len && request_buf[pos] != '\n'; pos++)
|
||||
;
|
||||
request_buf[pos] = '\0';
|
||||
|
||||
log_message(LOG_CONN, "Request: %s", request_buf);
|
||||
|
||||
safefree(request_buf);
|
||||
}
|
||||
#endif
|
||||
|
||||
log_message(LOG_INFO, "Redirecting to %s:%d",
|
||||
config.tunnel_name, config.tunnel_port);
|
||||
|
||||
connptr->server_fd =
|
||||
opensock(config.tunnel_name, config.tunnel_port);
|
||||
|
||||
if (connptr->server_fd < 0) {
|
||||
log_message(LOG_WARNING,
|
||||
"Could not connect to tunnel.");
|
||||
indicate_http_error(connptr, 404, "Unable to connect to tunnel.");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
log_message(LOG_INFO,
|
||||
"Established a connection to the tunnel \"%s\" using file descriptor %d.",
|
||||
config.tunnel_name, connptr->server_fd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This is the main drive for each connection. As you can tell, for the
|
||||
* first few steps we are using a blocking socket. If you remember the
|
||||
@ -1283,14 +1212,6 @@ handle_connection(int fd)
|
||||
return;
|
||||
}
|
||||
|
||||
if (TUNNEL_CONFIGURED()) {
|
||||
if (connect_to_tunnel(connptr) < 0)
|
||||
goto internal_proxy;
|
||||
else
|
||||
goto relay_proxy;
|
||||
}
|
||||
|
||||
internal_proxy:
|
||||
if (read_request_line(connptr) < 0) {
|
||||
update_stats(STAT_BADCONN);
|
||||
indicate_http_error(connptr, 408,
|
||||
@ -1394,7 +1315,6 @@ handle_connection(int fd)
|
||||
}
|
||||
}
|
||||
|
||||
relay_proxy:
|
||||
relay_connection(connptr);
|
||||
|
||||
log_message(LOG_INFO, "Closed connection between local client (fd:%d) and remote client (fd:%d)",
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: scanner.l,v 1.14 2002-06-07 18:29:40 rjkaes Exp $
|
||||
/* $Id: scanner.l,v 1.15 2002-11-03 17:10:32 rjkaes Exp $
|
||||
*
|
||||
* This builds the scanner for the tinyproxy configuration file. This
|
||||
* file needs to stay in sync with grammar.y. If someone knows lex and yacc
|
||||
@ -48,7 +48,6 @@ static struct keyword keywords[] = {
|
||||
{ "filterextended", KW_FILTEREXTENDED },
|
||||
{ "filterdefaultdeny", KW_FILTER_DEFAULT_DENY },
|
||||
{ "xtinyproxy", KW_XTINYPROXY },
|
||||
{ "tunnel", KW_TUNNEL },
|
||||
{ "upstream", KW_UPSTREAM },
|
||||
{ "allow", KW_ALLOW },
|
||||
{ "deny", KW_DENY },
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: tinyproxy.c,v 1.39 2002-10-03 20:53:11 rjkaes Exp $
|
||||
/* $Id: tinyproxy.c,v 1.40 2002-11-03 17:10:32 rjkaes Exp $
|
||||
*
|
||||
* The initialize routine. Basically sets up all the initial stuff (logfile,
|
||||
* listening socket, config options, etc.) and then sits there and loops
|
||||
@ -141,9 +141,6 @@ Options:\n\
|
||||
#ifndef NDEBUG
|
||||
printf(" Debugging code\n");
|
||||
#endif /* NDEBUG */
|
||||
#ifdef TUNNEL_SUPPORT
|
||||
printf(" TCP Tunnelling\n");
|
||||
#endif /* TUNNEL_SUPPORT */
|
||||
#ifdef TRANSPARENT_PROXY
|
||||
printf(" Transparent Proxy Support\n");
|
||||
#endif /* TRANSPARENT_PROXY */
|
||||
@ -214,15 +211,6 @@ main(int argc, char **argv)
|
||||
}
|
||||
yyparse();
|
||||
|
||||
#if defined(TUNNEL_SUPPORT) && defined(UPSTREAM_SUPPORT)
|
||||
if (config.tunnel_name && config.upstream_name) {
|
||||
fprintf(stderr,
|
||||
"%s: \"Tunnel\" and \"Upstream\" directives can not be both set.\n",
|
||||
argv[0]);
|
||||
exit(EX_SOFTWARE);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Open the log file if not using syslog */
|
||||
if (config.syslog == FALSE) {
|
||||
if (!config.logf_name) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: tinyproxy.h,v 1.33 2002-06-15 17:29:59 rjkaes Exp $
|
||||
/* $Id: tinyproxy.h,v 1.34 2002-11-03 17:10:32 rjkaes Exp $
|
||||
*
|
||||
* See 'tinyproxy.c' for a detailed description.
|
||||
*
|
||||
@ -42,10 +42,6 @@ struct config_s {
|
||||
#ifdef XTINYPROXY_ENABLE
|
||||
char *my_domain;
|
||||
#endif
|
||||
#ifdef TUNNEL_SUPPORT
|
||||
char *tunnel_name;
|
||||
int tunnel_port;
|
||||
#endif /* TUNNEL_SUPPORT */
|
||||
#ifdef UPSTREAM_SUPPORT
|
||||
char *upstream_name;
|
||||
int upstream_port;
|
||||
|
Loading…
Reference in New Issue
Block a user