Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

websockets on Freebsd 13.1 connects then immediately disconnects #2755

Open
rodneygmorgan opened this issue Feb 17, 2023 · 6 comments
Open

Comments

@rodneygmorgan
Copy link

Mosquitto built from ports after tweaks to the libwebsockets port (added LWS_WITH_EXTERNAL_POLL LWS_CALLBACK_ADD_POLL_FD) to Makefile. Both ports build without errors. Issue confirmed with several clients. Once the client connects it immediately disconnects. It appears to happen in websockets.c in the callback_mqtt() function case statement for LWS_CALLBACK_CLOSED. I added a log_printf statement make this assumption. Here is the log file output:

1676606750: New client connected from 10.0.0.193:53052 as mqttjs_a375c484 (p2, c1, k60).
1676606750: Client gonna be disconnected because 'LWS_CALLBACK_CLOSED'.
1676606750: Client mqttjs_a375c484 closed its connection.

mosquitto works perfectly with MQTT protocol. I suspect this is caused by the libwebsockets port (which has no maintainer).

Any help/suggestion to diagnose the root cause is welcome.

@ralight
Copy link
Contributor

ralight commented Apr 1, 2023

Would you care to try out the develop branch? That removes the need for libwebsockets, which simplifies things greatly and improves websockets performance as well. It would be good to have some feedback on it from the freebsd perspective.

@rodneygmorgan
Copy link
Author

rodneygmorgan commented Apr 1, 2023 via email

@h31p
Copy link

h31p commented May 5, 2023

Would you care to try out the develop branch? That removes the need for libwebsockets, which simplifies things greatly and improves websockets performance as well. It would be good to have some feedback on it from the freebsd perspective.

develop branch doesn't compile on the latest FreeBSD-13.2 :

[  4%] Building C object lib/CMakeFiles/libmosquitto.dir/options.c.o
/usr/local/src/mosquitto/mosquitto/lib/options.c:353:8: error: use of undeclared identifier 'MOSQ_OPT_HTTP_PATH'
                case MOSQ_OPT_HTTP_PATH:
                     ^
/usr/local/src/mosquitto/mosquitto/lib/options.c:439:8: error: use of undeclared identifier 'MOSQ_OPT_DISABLE_SOCKETPAIR'
                case MOSQ_OPT_DISABLE_SOCKETPAIR:
                     ^
/usr/local/src/mosquitto/mosquitto/lib/options.c:513:8: error: use of undeclared identifier 'MOSQ_OPT_TRANSPORT'
                case MOSQ_OPT_TRANSPORT:
                     ^
/usr/local/src/mosquitto/mosquitto/lib/options.c:525:8: error: use of undeclared identifier 'MOSQ_OPT_HTTP_HEADER_SIZE'
                case MOSQ_OPT_HTTP_HEADER_SIZE:
                     ^
4 errors generated.
*** Error code 1

Stop.

env:

 # cmake .. -DDOCUMENTATION=no
-- The C compiler identification is Clang 14.0.5
-- The CXX compiler identification is Clang 14.0.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenSSL: /usr/lib/libcrypto.so (found version "1.1.1t")
-- Found SQLite3: /usr/local/include (found version "3.41.2")
-- WITH_DLT = OFF
-- Found cJSON: /usr/local/include
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Looking for include file sys/event.h
-- Looking for include file sys/event.h - found
-- Looking for getaddrinfo_a in anl
-- Looking for getaddrinfo_a in anl - not found
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "1.8.1")
-- Found CUnit: /usr/local/lib/libcunit.so
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/mosquitto/mosquitto/build

@rodneygmorgan
Copy link
Author

rodneygmorgan commented Aug 6, 2023 via email

@diizzyy
Copy link

diizzyy commented Dec 16, 2023

@diizzyy
Copy link

diizzyy commented Dec 18, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants