Commit 8ba35fb4 authored by Jan Včelák's avatar Jan Včelák 🚀

packet review: some reformatting and white space fixes

parent e2703de8
......@@ -323,7 +323,7 @@ static int server_bind_sockets(server_t *s)
return bound;
}
server_t *server_create()
server_t *server_create(void)
{
// Create server structure
server_t *server = malloc(sizeof(server_t));
......@@ -336,8 +336,7 @@ server_t *server_create()
// Create event scheduler
dbg_server("server: creating event scheduler\n");
server->sched = evsched_new();
server->iosched = dt_create(1, evsched_run, evsched_destruct,
server->sched);
server->iosched = dt_create(1, evsched_run, evsched_destruct, server->sched);
// Create name server
dbg_server("server: creating Name Server structure\n");
......@@ -372,13 +371,12 @@ static int server_init_handler(server_t *server, int index, int thread_count,
return KNOT_ENOMEM;
}
h->thread_state = malloc(thread_count * sizeof(unsigned));
h->thread_state = calloc(thread_count, sizeof(unsigned));
if (h->thread_state == NULL) {
dt_delete(&h->unit);
return KNOT_ENOMEM;
}
memset(h->thread_state, 0, thread_count * sizeof(unsigned));
return KNOT_EOK;
}
......
......@@ -134,7 +134,7 @@ typedef struct server_t {
* \retval New instance if successful.
* \retval NULL If an error occured.
*/
server_t *server_create();
server_t *server_create(void);
/*!
* \brief Starts the server.
......
......@@ -131,10 +131,10 @@ static int tcp_handle(ns_proc_context_t *query_ctx, int fd,
} else {
rx->iov_len = ret;
}
/* Create query processing context. */
ns_proc_begin(query_ctx, &param, NS_PROC_QUERY);
/* Input packet. */
int state = ns_proc_in(rx->iov_base, rx->iov_len, query_ctx);
......
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