1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-20 22:49:01 +00:00

Removed the global ProxyOps list.

Each proxy node now provides a pointer to its operations struct.
This commit is contained in:
henri
2013-04-22 19:30:49 +00:00
parent 3451220630
commit f1a04abd6b
4 changed files with 37 additions and 21 deletions

View File

@@ -77,7 +77,9 @@ static char *proxy_http_data_decode(const char *src, size_t len, size_t *dlen);
/* ---- PROXY DEFINITION ---- */
struct proxy_op proxy_http = {
const struct proxy_op proxy_http_ops = {
.prefix = "http://",
.type = PROXY_TYPE_HTTP,
.init = proxy_http_init,
.handler = proxy_http_handler,
.connect_tcp = proxy_http_connect_tcp,
@@ -90,6 +92,8 @@ void proxy_http_init(struct proxy_node *proxy, char *proxystr) {
struct sockaddr_in *sin;
char *strhost, *strport, *saveptr;
proxy->ops = &proxy_http_ops;
strhost = strtok_r(proxystr + 7, ":", &saveptr);
strport = strtok_r(NULL, ":", &saveptr);
if (strport == NULL)