Skip to content

Commit

Permalink
Set large send and receive buffers for passthrough clients
Browse files Browse the repository at this point in the history
  • Loading branch information
ckolivas committed Jan 18, 2016
1 parent acd866d commit 24a9e9e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/connector.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,14 +976,18 @@ static bool client_exists(cdata_t *cdata, const int64_t id)
return !!client;
}

static void passthrough_client(cdata_t *cdata, client_instance_t *client)
static void passthrough_client(ckpool_t *ckp, cdata_t *cdata, client_instance_t *client)
{
char *buf;

LOGINFO("Connector adding passthrough client %"PRId64, client->id);
client->passthrough = true;
ASPRINTF(&buf, "{\"result\": true}\n");
send_client(cdata, client->id, buf);
if (!ckp->rmem_warn)
set_recvbufsize(ckp, client->fd, 1048576);
if (!ckp->wmem_warn)
set_sendbufsize(ckp, client->fd, 1048576);
}

static void remote_server(ckpool_t *ckp, cdata_t *cdata, client_instance_t *client)
Expand Down Expand Up @@ -1308,7 +1312,7 @@ static int connector_loop(proc_instance_t *pi, cdata_t *cdata)
LOGINFO("Connector failed to find client id %"PRId64" to pass through", client_id);
goto retry;
}
passthrough_client(cdata, client);
passthrough_client(ckp, cdata, client);
dec_instance_ref(cdata, client);
} else if (cmdmatch(buf, "remote")) {
client_instance_t *client;
Expand Down

0 comments on commit 24a9e9e

Please sign in to comment.