|
|
|
|
@ -88,7 +88,7 @@ static int tcp_proxy_client_send_connect(struct tcp_proxy_client_conn* pc) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static int tcp_proxy_client_send_data(struct tcp_proxy_client_conn* pc, const uint8_t* data, uint16_t len) { |
|
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_TRAFFIC, "PROXY SEND sid=%08x len=%u", pc->stream_id, len); |
|
|
|
|
DEBUG_TRACE(DEBUG_CATEGORY_TRAFFIC, "PROXY SEND sid=%08x len=%u", pc->stream_id, len); |
|
|
|
|
return tcp_proxy_client_send_msg(pc->proxy->inst, pc->proxy->via_node_id, |
|
|
|
|
TCP_PROXY_SUBCMD_DATA, pc->stream_id, data, len, 0); |
|
|
|
|
} |
|
|
|
|
@ -279,7 +279,7 @@ static err_t tcp_proxy_client_recv_cb(void *arg, struct tcp_pcb *pcb, struct pbu
|
|
|
|
|
uint8_t *data = u_malloc(len); |
|
|
|
|
if (data) { |
|
|
|
|
pbuf_copy_partial(p, data, len, 0); |
|
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_TRAFFIC, "PROXY RECV client->exit sid=%08x len=%u", pc->stream_id, len); |
|
|
|
|
DEBUG_TRACE(DEBUG_CATEGORY_TRAFFIC, "PROXY RECV client->exit sid=%08x len=%u", pc->stream_id, len); |
|
|
|
|
int ret = tcp_proxy_client_send_data(pc, data, len); |
|
|
|
|
if (ret == 0) { tcp_recved(pcb, len); u_free(data); } |
|
|
|
|
else { |
|
|
|
|
@ -431,7 +431,7 @@ static void tcp_proxy_client_handle_data(struct tcp_proxy_client* p, struct ETCP
|
|
|
|
|
queue_dgram_free(entry); queue_entry_free(entry); return; |
|
|
|
|
} |
|
|
|
|
size_t data_len = entry->len - TCP_PROXY_HDR_SIZE; |
|
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_TRAFFIC, "PROXY DATA <- sid=%08x len=%zu", stream_id, data_len); |
|
|
|
|
DEBUG_TRACE(DEBUG_CATEGORY_TRAFFIC, "PROXY DATA <- sid=%08x len=%zu", stream_id, data_len); |
|
|
|
|
if (data_len > 0) { |
|
|
|
|
struct ll_entry* e = tcp_proxy_client_entry_from_data(pc->proxy->entry_pool, entry->dgram + TCP_PROXY_HDR_SIZE, (uint16_t)data_len); |
|
|
|
|
if (e) queue_data_put(pc->to_lwip, e); |
|
|
|
|
|