static void direct_relay_relayreadcb(struct bufferevent *from, void *_client) { redsocks_client *client = _client; autoproxy_client * aclient = (void*)(client + 1) + client->instance->relay_ss->payload_len; redsocks_touch_client(client); if (!aclient->data_recv) aclient->data_recv = EVBUFFER_LENGTH(from->input); direct_relay_readcb_helper(client, client->relay, client->client); }
static void direct_relay_relayreadcb(struct bufferevent *from, void *_client) { redsocks_client *client = _client; socks5_client *socks5 = (void*)(client + 1); redsocks_touch_client(client); if (!socks5->got_data) socks5->got_data = EVBUFFER_LENGTH(from->input); direct_relay_readcb_helper(client, client->relay, client->client); }
static void direct_relay_clientreadcb(struct bufferevent *from, void *_client) { redsocks_client *client = _client; socks5_client *socks5 = (void*)(client + 1); redsocks_touch_client(client); if (client->state == socks5_direct) { if (socks5->data_sent && socks5->got_data) { /* No CONNECTION RESET error occur after sending data, good. */ client->state = socks5_direct_confirmed; if (evbuffer_get_length(from->input)) { evbuffer_drain(from->input, socks5->data_sent); socks5->data_sent = 0; } } } direct_relay_readcb_helper(client, client->client, client->relay); }
static void direct_relay_clientreadcb(struct bufferevent *from, void *_client) { redsocks_client *client = _client; autoproxy_client * aclient = (void*)(client + 1) + client->instance->relay_ss->payload_len; redsocks_touch_client(client); if (aclient->state == AUTOPROXY_CONNECTED) { if (aclient->data_sent && aclient->data_recv) { /* No CONNECTION RESET error occur after sending data, good. */ aclient->state = AUTOPROXY_CONFIRMED; on_connection_confirmed(client); if (evbuffer_get_length(from->input)) { evbuffer_drain(from->input, aclient->data_sent); aclient->data_sent = 0; } } } direct_relay_readcb_helper(client, client->client, client->relay); }