Commit 380ab3b3 authored by Ondřej Surý's avatar Ondřej Surý
Browse files

Merge branch '710-fix-socket-test' into 'master'

Use proper casting in socket unit test

Closes #710

See merge request !1099
parents 5bc8feab 5f81aa10
Pipeline #6979 passed with stages
in 9 minutes and 18 seconds
......@@ -275,6 +275,15 @@ build:debian:sid:amd64:
<<: *debian_sid_amd64_image
<<: *build_job
build:asan:debian:sid:amd64:
variables:
CC: gcc
CFLAGS: "-Wall -Wextra -O2 -g -fsanitize=address,undefined -DISC_MEM_USE_INTERNAL_MALLOC=0"
LDFLAGS: "-fsanitize=address,undefined"
EXTRA_CONFIGURE: "--with-libidn2"
<<: *debian_sid_amd64_image
<<: *build_job
build:clang:debian:stretch:i386:
variables:
CC: clang
......@@ -320,6 +329,12 @@ unittest:debian:sid:amd64:
dependencies:
- build:debian:sid:amd64
unittest:asan:debian:sid:amd64:
<<: *debian_sid_amd64_image
<<: *unit_test_job
dependencies:
- build:asan:debian:sid:amd64
unittest:clang:debian:stretch:amd64:
<<: *debian_stretch_amd64_image
<<: *unit_test_job
......@@ -362,6 +377,12 @@ systemtest:debian:sid:amd64:
dependencies:
- build:debian:sid:amd64
systemtest:asan:debian:sid:amd64:
<<: *debian_sid_amd64_image
<<: *system_test_job
dependencies:
- build:asan:debian:sid:amd64
systemtest:debian:sid:i386:
<<: *debian_sid_i386_image
<<: *system_test_job
......
......@@ -93,21 +93,32 @@ accept_done(isc_task_t *task, isc_event_t *event) {
static void
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;
UNUSED(task);
dev = (isc_socketevent_t *) event;
completion->result = dev->result;
completion->done = true;
if ((dev->attributes & ISC_SOCKEVENTATTR_DSCP) != 0) {
recv_dscp = true;
recv_dscp_value = dev->dscp;;
} else {
recv_dscp = false;
switch (event->ev_type) {
case ISC_SOCKEVENT_RECVDONE:
case ISC_SOCKEVENT_SENDDONE:
sev = (isc_socketevent_t *) event;
completion->result = sev->result;
if ((sev->attributes & ISC_SOCKEVENTATTR_DSCP) != 0) {
recv_dscp = true;
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);
}
......
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