Commit 7eb17b96 authored by Witold Krecicki's avatar Witold Krecicki Committed by Mark Andrews
Browse files

Use proper casting in socket unit test

(cherry picked from commit 5f81aa10)
parent 01d31429
...@@ -93,21 +93,32 @@ accept_done(isc_task_t *task, isc_event_t *event) { ...@@ -93,21 +93,32 @@ accept_done(isc_task_t *task, isc_event_t *event) {
static void static void
event_done(isc_task_t *task, isc_event_t *event) { event_done(isc_task_t *task, isc_event_t *event) {
isc_socketevent_t *dev; isc_socketevent_t *sev = NULL;
isc_socket_connev_t *connev = NULL;
completion_t *completion = event->ev_arg; completion_t *completion = event->ev_arg;
UNUSED(task); UNUSED(task);
dev = (isc_socketevent_t *) event; switch (event->ev_type) {
completion->result = dev->result; case ISC_SOCKEVENT_RECVDONE:
completion->done = true; case ISC_SOCKEVENT_SENDDONE:
if ((dev->attributes & ISC_SOCKEVENTATTR_DSCP) != 0) { sev = (isc_socketevent_t *) event;
recv_dscp = true; completion->result = sev->result;
recv_dscp_value = dev->dscp;; if ((sev->attributes & ISC_SOCKEVENTATTR_DSCP) != 0) {
} else { recv_dscp = true;
recv_dscp = false; recv_dscp_value = sev->dscp;;
} else {
recv_dscp = false;
}
recv_trunc = ((sev->attributes & ISC_SOCKEVENTATTR_TRUNC) != 0);
break;
case ISC_SOCKEVENT_CONNECT:
connev = (isc_socket_connev_t *) event;
completion->result = connev->result;
break;
default:
assert_false(true);
} }
recv_trunc = ((dev->attributes & ISC_SOCKEVENTATTR_TRUNC) != 0); completion->done = true;
isc_event_free(&event); isc_event_free(&event);
} }
......
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