unsigned int encryptout:1; /* 1 if we can encrypt outgoing traffic */
unsigned int decryptin:1; /* 1 if we have to decrypt incoming traffic */
unsigned int mst:1; /* 1 if this connection is part of a minimum spanning tree */
- unsigned int unused:23;
+ unsigned int proxy_passed:1; /* 1 if we are connecting via a proxy and we have finished talking with it */
+ unsigned int unused:22;
} connection_status_t;
#include "edge.h"
#include "xalloc.h"
bool send_id(connection_t *c) {
- if(proxytype && c->outgoing)
- if(!send_proxyrequest(c))
- return false;
+ if(proxytype && c->outgoing && !c->status.proxy_passed)
+ return send_proxyrequest(c);
return send_request(c, "%d %s %d", ID, myself->connection->name,
myself->connection->protocol_version);
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");
} else {
ifdebug(CONNECTIONS) logger(LOG_DEBUG, "Proxy request granted");
c->allow_request = ID;
+ c->status.proxy_passed = true;
+ send_id(c);
return replen;
}
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 {
p = memchr(c->buffer, '\n', c->buflen);