[465384] Fix crash on Windows when using bridges.

Thanks to Stefan Rosskopf.

Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=465384
pull/211/merge
Roger A. Light 11 years ago
parent e5010af4df
commit cc7beb62a5

@ -7,6 +7,7 @@ Broker:
- Fix incorrect bridge connection notifications on local broker.
- Fix persistent db writing on Windows. Closes #464779.
- ACLs are now checked before sending a will message.
- Fix possible crash when using bridges on Windows. Closes #465384.
Client library:
- Inflight message count wasn't being decreased for outgoing messages using

@ -453,11 +453,7 @@ static void loop_handle_errors(struct mosquitto_db *db, struct pollfd *pollfds)
static void loop_handle_reads_writes(struct mosquitto_db *db, struct pollfd *pollfds)
{
struct mosquitto *context, *ctxt_tmp;
#ifdef WIN32
char err;
#else
int err;
#endif
socklen_t len;
HASH_ITER(hh_sock, db->contexts_by_sock, context, ctxt_tmp){
@ -475,7 +471,7 @@ static void loop_handle_reads_writes(struct mosquitto_db *db, struct pollfd *pol
#endif
if(context->state == mosq_cs_connect_pending){
len = sizeof(int);
if(!getsockopt(context->sock, SOL_SOCKET, SO_ERROR, &err, &len)){
if(!getsockopt(context->sock, SOL_SOCKET, SO_ERROR, (char *)&err, &len)){
if(err == 0){
context->state = mosq_cs_new;
}

Loading…
Cancel
Save