Commit f4563e32 authored by Daniel Salzman's avatar Daniel Salzman

tcp: simplify process_query_param initialization

parent b0ec887d
/* Copyright (C) 2011 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz> /* Copyright (C) 2017 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -106,13 +106,14 @@ static int tcp_handle(tcp_context_t *tcp, int fd, ...@@ -106,13 +106,14 @@ static int tcp_handle(tcp_context_t *tcp, int fd,
struct iovec *rx, struct iovec *tx) struct iovec *rx, struct iovec *tx)
{ {
/* Create query processing parameter. */ /* Create query processing parameter. */
struct sockaddr_storage ss; struct sockaddr_storage ss = { 0 };
memset(&ss, 0, sizeof(struct sockaddr_storage)); struct process_query_param param = {
struct process_query_param param = {0}; .remote = &ss,
param.socket = fd; .socket = fd,
param.remote = &ss; .server = tcp->server,
param.server = tcp->server; .thread_id = tcp->thread_id
param.thread_id = tcp->thread_id; };
rx->iov_len = KNOT_WIRE_MAX_PKTSIZE; rx->iov_len = KNOT_WIRE_MAX_PKTSIZE;
tx->iov_len = KNOT_WIRE_MAX_PKTSIZE; tx->iov_len = KNOT_WIRE_MAX_PKTSIZE;
......
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