void finish_connecting(connection_t *c) {
logger(DEBUG_CONNECTIONS, LOG_INFO, "Connected to %s (%s)", c->name, c->hostname);
- if(proxytype != PROXY_EXEC)
- configure_tcp(c);
-
c->last_ping_time = time(NULL);
c->status.connecting = false;
}
static void handle_meta_write(connection_t *c) {
+ if(c->outbuf.len <= c->outbuf.offset)
+ return;
+
ssize_t outlen = send(c->socket, c->outbuf.data + c->outbuf.offset, c->outbuf.len - c->outbuf.offset, 0);
if(outlen <= 0) {
if(!errno || errno == EPIPE) {
int result;
socklen_t len = sizeof result;
- getsockopt(c->socket, SOL_SOCKET, SO_ERROR, &result, &len);
+ getsockopt(c->socket, SOL_SOCKET, SO_ERROR, (void *)&result, &len);
if(!result)
finish_connecting(c);
}
logger(DEBUG_CONNECTIONS, LOG_INFO, "Using proxy at %s port %s", proxyhost, proxyport);
c->socket = socket(proxyai->ai_family, SOCK_STREAM, IPPROTO_TCP);
+ configure_tcp(c);
}
if(c->socket == -1) {