summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-12-06 22:53:17 +0100
committerMichael Adam <obnox@samba.org>2009-12-07 00:22:36 +0100
commit624d146cd6eefe1a6e6317f27a99f8c9521ab63d (patch)
tree837913dc52fe6aad2717a05ce05fcf6f42e1bcc2
parent21aa3ecf60e5e6e54a9775876ae9e0eb6224e9cd (diff)
downloadtinyproxy-624d146cd6eefe1a6e6317f27a99f8c9521ab63d.tar.gz
tinyproxy-624d146cd6eefe1a6e6317f27a99f8c9521ab63d.zip
Add reversepath_list parameter to reversepath_add.
Michael
Diffstat (limited to '')
-rw-r--r--src/conf.c4
-rw-r--r--src/reverse-proxy.c7
-rw-r--r--src/reverse-proxy.h3
3 files changed, 8 insertions, 6 deletions
diff --git a/src/conf.c b/src/conf.c
index abb6201..e4c2c35 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -776,11 +776,11 @@ static HANDLE_FUNC (handle_reversepath)
safefree (arg1);
return -1;
}
- reversepath_add (arg1, arg2);
+ reversepath_add (arg1, arg2, &conf->reversepath_list);
safefree (arg1);
safefree (arg2);
} else {
- reversepath_add (NULL, arg1);
+ reversepath_add (NULL, arg1, &conf->reversepath_list);
safefree (arg1);
}
return 0;
diff --git a/src/reverse-proxy.c b/src/reverse-proxy.c
index 7346fc4..126b957 100644
--- a/src/reverse-proxy.c
+++ b/src/reverse-proxy.c
@@ -29,7 +29,8 @@
/*
* Add entry to the reversepath list
*/
-void reversepath_add (const char *path, const char *url)
+void reversepath_add (const char *path, const char *url,
+ struct reversepath **reversepath_list)
{
struct reversepath *reverse;
@@ -68,8 +69,8 @@ void reversepath_add (const char *path, const char *url)
reverse->url = safestrdup (url);
- reverse->next = config.reversepath_list;
- config.reversepath_list = reverse;
+ reverse->next = *reversepath_list;
+ *reversepath_list = reverse;
log_message (LOG_INFO,
"Added reverse proxy rule: %s -> %s", reverse->path,
diff --git a/src/reverse-proxy.h b/src/reverse-proxy.h
index 22e0d08..6bd40d6 100644
--- a/src/reverse-proxy.h
+++ b/src/reverse-proxy.h
@@ -31,7 +31,8 @@ struct reversepath {
#define REVERSE_COOKIE "yummy_magical_cookie"
-extern void reversepath_add (const char *path, const char *url);
+extern void reversepath_add (const char *path, const char *url,
+ struct reversepath **reversepath_list);
extern struct reversepath *reversepath_get (char *url);
extern char *reverse_rewrite_url (struct conn_s *connptr,
hashmap_t hashofheaders, char *url);