Skip to content

Commit

Permalink
Add back setsockopt path to curlx_nonblock
Browse files Browse the repository at this point in the history
The implementation using setsockopt was removed when BeOS support was purged. However this functionality wasn't BeOS specific and HAVE_SETSOCKOPT_SO_NONBLOCK is still present in the codebase.
  • Loading branch information
donny-dont committed Mar 8, 2022
1 parent 911714d commit 91ffe9f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/nonblock.c
Expand Up @@ -73,6 +73,11 @@ int curlx_nonblock(curl_socket_t sockfd, /* operate on this */
long flags = nonblock ? 1L : 0L;
return IoctlSocket(sockfd, FIONBIO, (char *)&flags);

#elif defined(HAVE_SETSOCKOPT_SO_NONBLOCK)

long b = nonblock ? 1L : 0L;
return setsockopt(sockfd, SOL_SOCKET, SO_NONBLOCK, &b, sizeof(b));

#else
# error "no non-blocking method was found/used/set"
#endif
Expand Down

0 comments on commit 91ffe9f

Please sign in to comment.