Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion mqtt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ option(WITH_STATIC_LIBRARIES "Build static versions of the libmosquitto/pp libra

if( STATIC_BUILD )
set(WITH_STATIC_LIBRARIES ON)
set(WITH_PIC ON)
set(OPENSSL_USE_STATIC_LIBS ON)
endif()

Expand All @@ -18,7 +19,7 @@ endif()
add_library(driver SHARED driver.c)

if( DEFINED STATIC_BUILD )
unset(CMAKE_C_FLAGS)
set(CMAKE_C_FLAGS "-ldl -lpthread")
add_subdirectory(../third_party/mosquitto ../third_party/mosquitto/build)
include_directories(../third_party/mosquitto/lib)
if( STATIC_BUILD )
Expand Down
3 changes: 2 additions & 1 deletion mqtt/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,8 @@ mosq_subscribe_f(struct mosquitto *mosq __attribute__((unused)),
return;
lua_rawgeti(ctx->L, LUA_REGISTRYINDEX, ctx->subscribe_ref);
lua_pushinteger(ctx->L, mid);
for (int i = 0; i < qos_count; i++)
int i = 0;
for (i = 0; i < qos_count; i++)
lua_pushinteger(ctx->L, granted_qos[i]);
if (lua_pcall(ctx->L, qos_count + 1, 0, 0) != LUA_OK)
say_error("Subscribe callback failed: ref:%d, message: \"%s\"",
Expand Down