Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ngtcp2 fix sendmsg build issue #8981

Closed
wants to merge 2 commits into from
Closed

Conversation

tatsuhiro-t
Copy link
Contributor

@tatsuhiro-t tatsuhiro-t commented Jun 8, 2022

Fixes #8978

@tatsuhiro-t tatsuhiro-t marked this pull request as draft Jun 8, 2022
@tatsuhiro-t tatsuhiro-t force-pushed the ngtcp2-fix-sendmsg-build-issue branch from 3362026 to 9bbaa28 Compare Jun 8, 2022
@tatsuhiro-t tatsuhiro-t marked this pull request as ready for review Jun 8, 2022
@bagder bagder closed this in 927ede7 Jun 10, 2022
@bagder bagder deleted the ngtcp2-fix-sendmsg-build-issue branch Jun 10, 2022
@@ -944,7 +944,7 @@ CURLcode Curl_quic_connect(struct Curl_easy *data,

ngtcp2_connection_close_error_default(&qs->last_error);

#if defined(__linux__) && defined(UDP_SEGMENT)
#if defined(__linux__) && defined(UDP_SEGMENT) & defined(HAVE_SENDMSG)
Copy link
Contributor

@emilengler emilengler Jun 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this really be only one ampersand?

struct iovec msg_iov = {(void *)pkt, pktlen};
struct msghdr msg = {0};
uint8_t msg_ctrl[CMSG_SPACE(sizeof(uint16_t))] = {0};
uint8_t msg_ctrl[32];
Copy link
Contributor

@emilengler emilengler Jun 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the 32 a random choice and if not, would you mind making it a constant?


*psent = 0;

while((sent = send(sockfd, (const char *)pkt, pktlen, 0)) == -1 &&
Copy link
Contributor

@emilengler emilengler Jun 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the cast necessary? Usually passing any pointer to a void * works just fine.

Copy link
Member

@vszakats vszakats Jun 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly it's necessary, because on Windows, it is a const char *.

See also: #8978 (comment)

vszakats added a commit to vszakats/curl that referenced this issue Jun 10, 2022
Ref: curl#8981 (comment)

Reported-By: Emil Engler
Closes #xxxx
vszakats added a commit to vszakats/curl that referenced this issue Jun 10, 2022
Ref: curl#8981 (comment)
Ref: 927ede7

Reported-By: Emil Engler
Closes #xxxx
vszakats added a commit that referenced this issue Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants