Skip to content

Commit

Permalink
Make sure no unsupported flags are passed to send and sendto
Browse files Browse the repository at this point in the history
  • Loading branch information
Arshia001 committed Jun 25, 2024
1 parent 1c76044 commit 805013b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/cf-socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ static ssize_t cf_socket_send(struct Curl_cfilter *cf, struct Curl_easy *data,
}
#endif

#if defined(MSG_FASTOPEN) && !defined(TCP_FASTOPEN_CONNECT) /* Linux */
#if defined(MSG_FASTOPEN) && !defined(TCP_FASTOPEN_CONNECT) && !defined(__wasi__) /* Linux */
if(cf->conn->bits.tcp_fastopen) {
nwritten = sendto(ctx->sock, buf, len, MSG_FASTOPEN,
&cf->conn->remote_addr->sa_addr,
Expand Down
2 changes: 1 addition & 1 deletion lib/curl_setup_once.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ struct timeval {
* it as the fourth argument of function send()
*/

#ifdef HAVE_MSG_NOSIGNAL
#if defined(HAVE_MSG_NOSIGNAL) && !defined(__wasi__)
#define SEND_4TH_ARG MSG_NOSIGNAL
#else
#define SEND_4TH_ARG 0
Expand Down
3 changes: 3 additions & 0 deletions lib/memdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ SEND_TYPE_RETV curl_dbg_send(SEND_TYPE_ARG1 sockfd,
SEND_TYPE_ARG3 len, SEND_TYPE_ARG4 flags, int line,
const char *source)
{
#ifdef __wasi__
flags = 0;
#endif
SEND_TYPE_RETV rc;
if(countcheck("send", line, source))
return -1;
Expand Down
3 changes: 3 additions & 0 deletions packages/OS400/os400sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,9 @@ int
Curl_os400_sendto(int sd, char *buffer, int buflen, int flags,
const struct sockaddr *dstaddr, int addrlen)
{
#ifdef __wasi__
flags = 0;
#endif
int i;
struct sockaddr_storage laddr;

Expand Down

0 comments on commit 805013b

Please sign in to comment.