Skip to content

Commit

Permalink
Fix some winsock argument types.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Aug 11, 2020
1 parent bd27935 commit 3eb60e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ int net__socket_accept(struct mosquitto_db *db, mosq_sock_t listensock)

if(db->config->set_tcp_nodelay){
int flag = 1;
#ifdef WIN32
if (setsockopt(new_sock, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(int)) != 0) {
#else
if(setsockopt(new_sock, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof(int)) != 0){
#endif
log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Unable to set TCP_NODELAY.");
}
}
Expand Down Expand Up @@ -588,11 +592,7 @@ int net__socket_listen(struct mosquitto__listener *listener)
struct addrinfo *ainfo, *rp;
char service[10];
int rc;
#ifndef WIN32
int ss_opt = 1;
#else
char ss_opt = 1;
#endif
#ifdef SO_BINDTODEVICE
struct ifreq ifr;
#endif
Expand Down

0 comments on commit 3eb60e2

Please sign in to comment.