Merge branch 'fixes'

pull/828/head
Roger A. Light 8 years ago
commit e9d03c8ffd

@ -784,6 +784,9 @@ ssize_t _mosquitto_net_read(struct mosquitto *mosq, void *buf, size_t count)
}
errno = EPROTO;
}
#ifdef WIN32
WSASetLastError(errno);
#endif
}
return (ssize_t )ret;
}else{

@ -565,7 +565,6 @@ int mqtt3_db_message_store(struct mosquitto_db *db, const char *source, uint16_t
if(!temp->payload){
if(temp->source_id) _mosquitto_free(temp->source_id);
if(temp->topic) _mosquitto_free(temp->topic);
if(temp->payload) _mosquitto_free(temp->payload);
_mosquitto_free(temp);
return MOSQ_ERR_NOMEM;
}

@ -217,7 +217,8 @@ int main(int argc, char *argv[])
int listensock_count = 0;
int listensock_index = 0;
struct mqtt3_config config;
#ifdef WITH_SYS_TREE
#ifdef WITH_SYS_TREE
char buf[1024];
#endif
int i, j;
@ -226,6 +227,7 @@ int main(int argc, char *argv[])
int rc;
#ifdef WIN32
SYSTEMTIME st;
_setmaxstdio(2048);
#else
struct timeval tv;
#endif

@ -201,12 +201,14 @@ static int callback_mqtt(struct libwebsocket_context *context,
mosq->ws_context = context;
#endif
mosq->wsi = wsi;
#ifdef WITH_TLS
if(in){
mosq->ssl = (SSL *)in;
if(!mosq->listener->ssl_ctx){
mosq->listener->ssl_ctx = SSL_get_SSL_CTX(mosq->ssl);
}
}
#endif
u->mosq = mosq;
}else{
return -1;
@ -240,7 +242,9 @@ static int callback_mqtt(struct libwebsocket_context *context,
mosq->pollfd_index = -1;
}
mosq->wsi = NULL;
#ifdef WITH_TLS
mosq->ssl = NULL;
#endif
do_disconnect(db, mosq);
}
break;

Loading…
Cancel
Save