Skip to content

Commit

Permalink
Build fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Sep 25, 2019
1 parent b7d8eb1 commit 6a01453
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ int mosquitto_loop(struct mosquitto *mosq, int timeout, int max_packets)
char pairbuf;
int maxfd = 0;
time_t now;
#ifdef WITH_SRV
int state;
#endif

if(!mosq || max_packets < 1) return MOSQ_ERR_INVAL;
#ifndef WIN32
Expand Down
2 changes: 1 addition & 1 deletion lib/net_mosq.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ int net__socket_close(struct mosquitto *mosq)
if(mosq->wsi)
{
if(mosq->state != mosq_cs_disconnecting){
context__set_state(mosq, mosq_cs_disconnect_ws);
mosquitto__set_state(mosq, mosq_cs_disconnect_ws);
}
libwebsocket_callback_on_writable(mosq->ws_context, mosq->wsi);
}else
Expand Down
1 change: 1 addition & 0 deletions lib/socks_mosq.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ and the Eclipse Distribution License is available at
#include "net_mosq.h"
#include "packet_mosq.h"
#include "send_mosq.h"
#include "util_mosq.h"

#define SOCKS_AUTH_NONE 0x00
#define SOCKS_AUTH_GSS 0x01
Expand Down
3 changes: 2 additions & 1 deletion lib/srv_mosq.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and the Eclipse Distribution License is available at
#include "memory_mosq.h"
#include "mosquitto_internal.h"
#include "mosquitto.h"
#include "util_mosq.h"

#ifdef WITH_SRV
static void srv_callback(void *arg, int status, int timeouts, unsigned char *abuf, int alen)
Expand Down Expand Up @@ -91,7 +92,7 @@ int mosquitto_connect_srv(struct mosquitto *mosq, const char *host, int keepaliv
mosquitto__free(h);
}

mosquitto__set_state(mosq_cs_connect_srv);
mosquitto__set_state(mosq, mosq_cs_connect_srv);

mosq->keepalive = keepalive;

Expand Down
1 change: 1 addition & 0 deletions src/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and the Eclipse Distribution License is available at
#include "packet_mosq.h"
#include "property_mosq.h"
#include "time_mosq.h"
#include "util_mosq.h"
#include "will_mosq.h"

#include "uthash.h"
Expand Down
1 change: 1 addition & 0 deletions src/handle_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and the Eclipse Distribution License is available at
#include "packet_mosq.h"
#include "property_mosq.h"
#include "send_mosq.h"
#include "util_mosq.h"
#include "will_mosq.h"


Expand Down
3 changes: 2 additions & 1 deletion src/websockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "memory_mosq.h"
#include "packet_mosq.h"
#include "sys_tree.h"
#include "util_mosq.h"

#include <stdlib.h>
#include <errno.h>
Expand Down Expand Up @@ -424,7 +425,7 @@ static int callback_mqtt(struct libwebsocket_context *context,

if(rc && (mosq->out_packet || mosq->current_out_packet)) {
if(mosq->state != mosq_cs_disconnecting){
context__set_state(mosq, mosq_cs_disconnect_ws);
mosquitto__set_state(mosq, mosq_cs_disconnect_ws);
}
libwebsocket_callback_on_writable(mosq->ws_context, mosq->wsi);
} else if (rc) {
Expand Down

0 comments on commit 6a01453

Please sign in to comment.