Commit 9bf46512 authored by Marek Vavrusa's avatar Marek Vavrusa

daemon/worker: set query source addr for tcp

parent 98446d04
......@@ -917,7 +917,12 @@ int worker_process_tcp(struct worker_ctx *worker, uv_stream_t *handle, const uin
* to buffer incoming message until it's complete. */
if (!session->outgoing) {
if (!task) {
task = qr_task_create(worker, (uv_handle_t *)handle, NULL);
/* Get TCP peer name, keep zeroed address if it fails. */
struct sockaddr_storage addr;
memset(&addr, 0, sizeof(addr));
int addr_len = sizeof(addr);
uv_tcp_getpeername((uv_tcp_t *)handle, (struct sockaddr *)&addr, &addr_len);
task = qr_task_create(worker, (uv_handle_t *)handle, (struct sockaddr *)&addr);
if (!task) {
return kr_error(ENOMEM);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment