mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
tinyproxy: import from packages, add myself as maintainer
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -6815,59 +6815,8 @@ fi
|
||||
|
||||
|
||||
|
||||
-# Check for asciidoc
|
||||
-# Extract the first word of "a2x", so it can be a program name with args.
|
||||
-set dummy a2x; ac_word=$2
|
||||
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
|
||||
-$as_echo_n "checking for $ac_word... " >&6; }
|
||||
-if test "${ac_cv_path_A2X+set}" = set; then :
|
||||
- $as_echo_n "(cached) " >&6
|
||||
-else
|
||||
- case $A2X in
|
||||
- [\\/]* | ?:[\\/]*)
|
||||
- ac_cv_path_A2X="$A2X" # Let the user override the test with a path.
|
||||
- ;;
|
||||
- *)
|
||||
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
|
||||
-for as_dir in $PATH
|
||||
-do
|
||||
- IFS=$as_save_IFS
|
||||
- test -z "$as_dir" && as_dir=.
|
||||
- for ac_exec_ext in '' $ac_executable_extensions; do
|
||||
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
|
||||
- ac_cv_path_A2X="$as_dir/$ac_word$ac_exec_ext"
|
||||
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||
- break 2
|
||||
- fi
|
||||
-done
|
||||
- done
|
||||
-IFS=$as_save_IFS
|
||||
-
|
||||
- test -z "$ac_cv_path_A2X" && ac_cv_path_A2X="no"
|
||||
- ;;
|
||||
-esac
|
||||
-fi
|
||||
-A2X=$ac_cv_path_A2X
|
||||
-if test -n "$A2X"; then
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $A2X" >&5
|
||||
-$as_echo "$A2X" >&6; }
|
||||
-else
|
||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
-$as_echo "no" >&6; }
|
||||
-fi
|
||||
-
|
||||
-
|
||||
- if test "x$A2X" != "xno"; then
|
||||
- HAVE_A2X_TRUE=
|
||||
- HAVE_A2X_FALSE='#'
|
||||
-else
|
||||
HAVE_A2X_TRUE='#'
|
||||
HAVE_A2X_FALSE=
|
||||
-fi
|
||||
-
|
||||
-if test x"$A2X" = x"no"; then
|
||||
- as_fn_error $? "Test for asciidoc failed. See the file 'INSTALL' for help." "$LINENO" 5
|
||||
-fi
|
||||
|
||||
ac_config_files="$ac_config_files Makefile src/Makefile data/Makefile data/templates/Makefile etc/Makefile docs/Makefile docs/man5/Makefile docs/man5/tinyproxy.conf.txt docs/man8/Makefile docs/man8/tinyproxy.txt m4macros/Makefile tests/Makefile tests/scripts/Makefile"
|
||||
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -2,9 +2,7 @@ SUBDIRS = \
|
||||
src \
|
||||
data \
|
||||
etc \
|
||||
- docs \
|
||||
m4macros \
|
||||
- tests
|
||||
|
||||
# tools want this on a single line
|
||||
ACLOCAL_AMFLAGS = -I m4macros
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -222,9 +222,7 @@ SUBDIRS = \
|
||||
src \
|
||||
data \
|
||||
etc \
|
||||
- docs \
|
||||
m4macros \
|
||||
- tests
|
||||
|
||||
|
||||
# tools want this on a single line
|
||||
@@ -0,0 +1,13 @@
|
||||
--- a/src/main.c
|
||||
+++ b/src/main.c
|
||||
@@ -326,8 +326,8 @@ static void initialize_config_defaults (
|
||||
conf->errorpages = NULL;
|
||||
conf->stathost = safestrdup (TINYPROXY_STATHOST);
|
||||
conf->idletimeout = MAX_IDLE_TIME;
|
||||
- conf->logf_name = safestrdup (LOCALSTATEDIR "/log/tinyproxy/tinyproxy.log");
|
||||
- conf->pidpath = safestrdup (LOCALSTATEDIR "/run/tinyproxy/tinyproxy.pid");
|
||||
+ conf->logf_name = safestrdup (LOCALSTATEDIR "/log/tinyproxy.log");
|
||||
+ conf->pidpath = safestrdup (LOCALSTATEDIR "/tinyproxy.pid");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -0,0 +1,22 @@
|
||||
--- a/src/conf.c
|
||||
+++ b/src/conf.c
|
||||
@@ -865,7 +865,6 @@ static HANDLE_FUNC (handle_deny)
|
||||
|
||||
static HANDLE_FUNC (handle_bind)
|
||||
{
|
||||
-#ifndef TRANSPARENT_PROXY
|
||||
int r = set_string_arg (&conf->bind_address, line, &match[2]);
|
||||
|
||||
if (r)
|
||||
@@ -873,11 +872,6 @@ static HANDLE_FUNC (handle_bind)
|
||||
log_message (LOG_INFO,
|
||||
"Outgoing connections bound to IP %s", conf->bind_address);
|
||||
return 0;
|
||||
-#else
|
||||
- fprintf (stderr,
|
||||
- "\"Bind\" cannot be used with transparent support enabled.\n");
|
||||
- return 1;
|
||||
-#endif
|
||||
}
|
||||
|
||||
static HANDLE_FUNC (handle_listen)
|
||||
@@ -0,0 +1,38 @@
|
||||
--- a/src/sock.c
|
||||
+++ b/src/sock.c
|
||||
@@ -39,8 +39,7 @@
|
||||
* returned if the bind succeeded. Otherwise, -1 is returned
|
||||
* to indicate an error.
|
||||
*/
|
||||
-static int
|
||||
-bind_socket (int sockfd, const char *addr, int family)
|
||||
+static int bind_socket (int sockfd, const char *addr)
|
||||
{
|
||||
struct addrinfo hints, *res, *ressave;
|
||||
|
||||
@@ -48,7 +47,7 @@ bind_socket (int sockfd, const char *add
|
||||
assert (addr != NULL && strlen (addr) != 0);
|
||||
|
||||
memset (&hints, 0, sizeof (struct addrinfo));
|
||||
- hints.ai_family = family;
|
||||
+ hints.ai_family = AF_UNSPEC;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
|
||||
/* The local port it not important */
|
||||
@@ -106,14 +105,12 @@ int opensock (const char *host, int port
|
||||
|
||||
/* Bind to the specified address */
|
||||
if (bind_to) {
|
||||
- if (bind_socket (sockfd, bind_to,
|
||||
- res->ai_family) < 0) {
|
||||
+ if (bind_socket (sockfd, bind_to) < 0) {
|
||||
close (sockfd);
|
||||
continue; /* can't bind, so try again */
|
||||
}
|
||||
} else if (config.bind_address) {
|
||||
- if (bind_socket (sockfd, config.bind_address,
|
||||
- res->ai_family) < 0) {
|
||||
+ if (bind_socket (sockfd, config.bind_address) < 0) {
|
||||
close (sockfd);
|
||||
continue; /* can't bind, so try again */
|
||||
}
|
||||
Reference in New Issue
Block a user