}
ssize_t consumed = session_wirebuf_consume(s, (const uint8_t *)buf->base,
nread);
- assert(consumed == nread);
+ assert(consumed == nread); (void)consumed;
session_wirebuf_process(s);
session_wirebuf_discard(s);
mp_flush(worker->pkt_pool.ctx);
}
struct worker_ctx *worker = (struct worker_ctx *)master->loop->data;
- uv_stream_t *client = malloc(sizeof(uv_tcp_t));
+ uv_tcp_t *client = malloc(sizeof(uv_tcp_t));
if (!client) {
return;
}
struct session *session = client->data;
assert(session_flags(session)->outgoing == false);
- if (uv_accept(master, client) != 0) {
+ if (uv_accept(master, (uv_stream_t *)client) != 0) {
/* close session, close underlying uv handles and
* deallocate (or return to memory pool) memory. */
session_close(session);
struct sockaddr *peer = session_get_peer(s);
int peer_len = sizeof(union inaddr);
- int ret = uv_tcp_getpeername((uv_tcp_t *)client, peer, &peer_len);
+ int ret = uv_tcp_getpeername(client, peer, &peer_len);
if (ret || peer->sa_family == AF_UNSPEC) {
session_close(s);
return;
static void on_session_close(uv_handle_t *handle)
{
struct session *session = handle->data;
- assert(session->handle == handle);
+ assert(session->handle == handle); (void)session;
io_free(handle);
}
static void on_send(uv_udp_send_t *req, int status)
{
- uv_handle_t *handle = (uv_handle_t *)(req->handle);
- uv_loop_t *loop = handle->loop;
struct qr_task *task = req->data;
- qr_task_on_send(task, handle, status);
+ qr_task_on_send(task, (uv_handle_t *)(req->handle), status);
qr_task_unref(task);
free(req);
}
-// TODO: unify these two
static void on_task_write(uv_write_t *req, int status)
{
- uv_handle_t *handle = (uv_handle_t *)(req->handle);
- uv_loop_t *loop = handle->loop;
struct qr_task *task = req->data;
- qr_task_on_send(task, handle, status);
+ qr_task_on_send(task, (uv_handle_t *)(req->handle), status);
qr_task_unref(task);
free(req);
}