You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mosquitto/debian/patches/lws-fixes.patch

62 lines
1.5 KiB
Diff

--- a/src/mosquitto_broker_internal.h
+++ b/src/mosquitto_broker_internal.h
@@ -39,6 +39,8 @@
# define libwebsocket_callback_reasons lws_callback_reasons
# define libwebsocket lws
# endif
+
+#define lws_pollfd pollfd
#endif
#include "mosquitto_internal.h"
--- a/src/websockets.c
+++ b/src/websockets.c
@@ -490,7 +490,11 @@
struct stat filestat;
struct mosquitto_db *db = &int_db;
struct mosquitto *mosq;
+#ifdef LWS_LIBRARY_VERSION_NUMBER
struct lws_pollargs *pollargs = (struct lws_pollargs *)in;
+#else
+ int fd;
+#endif
/* FIXME - ssl cert verification is done here. */
@@ -627,11 +631,21 @@
case LWS_CALLBACK_ADD_POLL_FD:
case LWS_CALLBACK_DEL_POLL_FD:
+#ifdef LWS_LIBRARY_VERSION_NUMBER
case LWS_CALLBACK_CHANGE_MODE_POLL_FD:
HASH_FIND(hh_sock, db->contexts_by_sock, &pollargs->fd, sizeof(pollargs->fd), mosq);
if(mosq && (pollargs->events & POLLOUT)){
mosq->ws_want_write = true;
}
+#else
+ case LWS_CALLBACK_SET_MODE_POLL_FD:
+ fd = (int)(long)user;
+
+ HASH_FIND(hh_sock, db->contexts_by_sock, &fd, sizeof(fd), mosq);
+ if(mosq){
+ mosq->ws_want_write = true;
+ }
+#endif
break;
default:
--- a/src/loop.c
+++ b/src/loop.c
@@ -679,7 +679,11 @@
wspoll.events = pollfds[context->pollfd_index].events;
wspoll.revents = pollfds[context->pollfd_index].revents;
#endif
+#if defined(LWS_LIBRARY_VERSION_NUMBER)
lws_service_fd(lws_get_context(context->wsi), &wspoll);
+#else
+ libwebsocket_service_fd(context->ws_context, &wspoll);
+#endif
continue;
}
#endif