Skip to content

Commit

Permalink
Fix incorrect call to setsockopt() for TCP_NODELAY.
Browse files Browse the repository at this point in the history
Closes #941. Thanks to rfalke.

Signed-off-by: Roger A. Light <[email protected]>
  • Loading branch information
ralight committed Aug 30, 2018
1 parent 2221deb commit e6a0199
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Broker:
- Fix build when using WITH_ADNS=yes.
- Fix incorrect call to setsockopt() for TCP_NODELAY. Closes #941.


1.5.1 - 20180816
Expand Down
2 changes: 1 addition & 1 deletion src/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int net__socket_accept(struct mosquitto_db *db, mosq_sock_t listensock)

if(db->config->set_tcp_nodelay){
int flag = 1;
if(setsockopt(new_sock, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof(int) != 0)){
if(setsockopt(new_sock, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof(int)) != 0){
log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Unable to set TCP_NODELAY.");
}
}
Expand Down

0 comments on commit e6a0199

Please sign in to comment.