projects
/
oweals
/
tinc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Proxy = exec.
[oweals/tinc.git]
/
src
/
proxy.c
diff --git
a/src/proxy.c
b/src/proxy.c
index 2b8f87c13e36dcc5d32e47968ae8f33b2c14ae3c..f7c2560d6d519426cc49d28f8d1e3928bcf24ed1 100644
(file)
--- a/
src/proxy.c
+++ b/
src/proxy.c
@@
-1,6
+1,6
@@
/*
proxy.c -- Proxy handling functions.
/*
proxy.c -- Proxy handling functions.
- Copyright (C) 2015 Guus Sliepen <guus@tinc-vpn.org>
+ Copyright (C) 2015
-2016
Guus Sliepen <guus@tinc-vpn.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-174,6
+174,8
@@
bool send_proxyrequest(connection_t *c) {
}
case PROXY_EXEC:
}
case PROXY_EXEC:
+ c->status.proxy_passed = true;
+ send_id(c);
return true;
default:
return true;
default:
@@
-194,6
+196,8
@@
int receive_proxy_meta(connection_t *c, int start, int lenin) {
ifdebug(CONNECTIONS) logger(LOG_DEBUG, "Proxy request granted");
c->allow_request = ID;
ifdebug(CONNECTIONS) logger(LOG_DEBUG, "Proxy request granted");
c->allow_request = ID;
+ c->status.proxy_passed = true;
+ send_id(c);
return 8;
} else {
logger(LOG_ERR, "Proxy request rejected");
return 8;
} else {
logger(LOG_ERR, "Proxy request rejected");
@@
-249,6
+253,8
@@
int receive_proxy_meta(connection_t *c, int start, int lenin) {
} else {
ifdebug(CONNECTIONS) logger(LOG_DEBUG, "Proxy request granted");
c->allow_request = ID;
} else {
ifdebug(CONNECTIONS) logger(LOG_DEBUG, "Proxy request granted");
c->allow_request = ID;
+ c->status.proxy_passed = true;
+ send_id(c);
return replen;
}
return replen;
}
@@
-257,8
+263,8
@@
int receive_proxy_meta(connection_t *c, int start, int lenin) {
if(!p || p - c->buffer >= c->buflen)
return 0;
if(!p || p - c->buffer >= c->buflen)
return 0;
- while(
p = memchr(p + 1, '\n', c->buflen - (p + 1 - c->buffer
))) {
- if(p
[-1] == '\n'
)
+ while(
(p = memchr(p + 1, '\n', c->buflen - (p + 1 - c->buffer)
))) {
+ if(p
> c->buffer + 3 && !memcmp(p - 3, "\r\n\r\n", 4)
)
break;
}
break;
}
@@
-275,8
+281,12
@@
int receive_proxy_meta(connection_t *c, int start, int lenin) {
logger(LOG_DEBUG, "Proxy request granted");
replen = p + 1 - c->buffer;
c->allow_request = ID;
logger(LOG_DEBUG, "Proxy request granted");
replen = p + 1 - c->buffer;
c->allow_request = ID;
+ c->status.proxy_passed = true;
+ send_id(c);
return replen;
} else {
return replen;
} else {
+ p = memchr(c->buffer, '\n', c->buflen);
+ p[-1] = 0;
logger(LOG_ERR, "Proxy request rejected: %s", c->buffer + 9);
return false;
}
logger(LOG_ERR, "Proxy request rejected: %s", c->buffer + 9);
return false;
}