Add reversepath_list parameter to reversepath_add.

Michael
This commit is contained in:
Michael Adam 2009-12-06 22:53:17 +01:00
parent 21aa3ecf60
commit 624d146cd6
3 changed files with 8 additions and 6 deletions

View File

@ -776,11 +776,11 @@ static HANDLE_FUNC (handle_reversepath)
safefree (arg1); safefree (arg1);
return -1; return -1;
} }
reversepath_add (arg1, arg2); reversepath_add (arg1, arg2, &conf->reversepath_list);
safefree (arg1); safefree (arg1);
safefree (arg2); safefree (arg2);
} else { } else {
reversepath_add (NULL, arg1); reversepath_add (NULL, arg1, &conf->reversepath_list);
safefree (arg1); safefree (arg1);
} }
return 0; return 0;

View File

@ -29,7 +29,8 @@
/* /*
* Add entry to the reversepath list * 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; struct reversepath *reverse;
@ -68,8 +69,8 @@ void reversepath_add (const char *path, const char *url)
reverse->url = safestrdup (url); reverse->url = safestrdup (url);
reverse->next = config.reversepath_list; reverse->next = *reversepath_list;
config.reversepath_list = reverse; *reversepath_list = reverse;
log_message (LOG_INFO, log_message (LOG_INFO,
"Added reverse proxy rule: %s -> %s", reverse->path, "Added reverse proxy rule: %s -> %s", reverse->path,

View File

@ -31,7 +31,8 @@ struct reversepath {
#define REVERSE_COOKIE "yummy_magical_cookie" #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 struct reversepath *reversepath_get (char *url);
extern char *reverse_rewrite_url (struct conn_s *connptr, extern char *reverse_rewrite_url (struct conn_s *connptr,
hashmap_t hashofheaders, char *url); hashmap_t hashofheaders, char *url);