Skip to content

Commit e9a3878

Browse files
committed
Refactored server and renamed mqtt module
1 parent 3dd0391 commit e9a3878

File tree

14 files changed

+426
-578
lines changed

14 files changed

+426
-578
lines changed

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ else (APPLE)
4444
TARGET_LINK_LIBRARIES(sol pthread ssl crypto crypt)
4545
TARGET_LINK_LIBRARIES(sol_test pthread ssl crypto crypt)
4646
endif (APPLE)
47-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wunused -Werror -pedantic \
48-
-Wno-unused-result -std=c11 -O3")
47+
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wunused -Werror -pedantic \
48+
# -Wno-unused-result -std=c11 -O3")
49+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wunused -Werror -pedantic \
50+
-Wno-unused-result -std=c11 -ggdb -fsanitize=address \
51+
-fsanitize=undefined -fno-omit-frame-pointer -pg")
4952

5053
endif (DEBUG)
5154

conf/sol.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ stats_publish_interval 10s
3737
# allow_anonymous false
3838
# password_file passwd_file
3939

40-
tls_protocols tlsv1,tlsv1_1,tlsv1_2,tlsv1_3
40+
# tls_protocols tlsv1,tlsv1_1,tlsv1_2,tlsv1_3

src/ev.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,12 +589,13 @@ static int ev_api_fire_event(struct ev_ctx *ctx, int fd, int mask)
589589
{
590590
struct kqueue_api *k_api = ctx->api;
591591
struct kevent ke;
592-
int op = 0;
592+
int flags = EV_ADD | EV_ONESHOT;
593+
int op = 0;
593594
if (mask & (EV_READ | EV_EVENTFD))
594-
op |= EVFILT_READ;
595+
return EV_OK;
595596
if (mask & EV_WRITE)
596597
op |= EVFILT_WRITE;
597-
EV_SET(&ke, fd, op, EV_ADD | EV_ENABLE, 0, 0, NULL);
598+
EV_SET(&ke, fd, op, flags, 0, 0, NULL);
598599
if (kevent(k_api->fd, &ke, 1, NULL, 0, NULL) == -1)
599600
return -EV_ERR;
600601
return EV_OK;

0 commit comments

Comments
 (0)