-const char filters_rcs[] = "$Id: filters.c,v 1.116 2009/04/17 11:34:34 fabiankeil Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.118 2009/04/17 11:37:03 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/filters.c,v $
*
* Revisions :
* $Log: filters.c,v $
+ * Revision 1.118 2009/04/17 11:37:03 fabiankeil
+ * Allow IPv6 addresses in forward-override{}.
+ *
+ * Revision 1.117 2009/04/17 11:35:28 fabiankeil
+ * Fix compiler warning.
+ *
* Revision 1.116 2009/04/17 11:34:34 fabiankeil
* Style cosmetics for the IPv6 code.
*
if (NULL != socks_proxy)
{
/* Parse the SOCKS proxy host[:port] */
- fwd->gateway_host = strdup(socks_proxy);
-
- if (NULL != (socks_proxy = strchr(fwd->gateway_host, ':')))
- {
- *socks_proxy++ = '\0';
- fwd->gateway_port = (int)strtol(socks_proxy, NULL, 0);
- }
-
- if (fwd->gateway_port <= 0)
- {
- fwd->gateway_port = 1080;
- }
+ fwd->gateway_port = 1080;
+ parse_forwarder_address(socks_proxy,
+ &fwd->gateway_host, &fwd->gateway_port);
http_parent = vec[2];
}
/* Parse http forwarding settings */
if (strcmp(http_parent, ".") != 0)
{
- fwd->forward_host = strdup(http_parent);
-
- if (NULL != (http_parent = strchr(fwd->forward_host, ':')))
- {
- *http_parent++ = '\0';
- fwd->forward_port = (int)strtol(http_parent, NULL, 0);
- }
-
- if (fwd->forward_port <= 0)
- {
- fwd->forward_port = 8000;
- }
+ fwd->forward_port = 8000;
+ parse_forwarder_address(http_parent,
+ &fwd->forward_host, &fwd->forward_port);
}
assert (NULL != fwd);