mirror of
https://github.com/curl/curl.git
synced 2026-08-04 20:16:15 +03:00
parent
d49087f6bc
commit
03de4e4b21
4 changed files with 20 additions and 6 deletions
15
lib/sendf.c
15
lib/sendf.c
|
|
@ -254,7 +254,17 @@ ssize_t Curl_send_plain(struct connectdata *conn, int num,
|
|||
const void *mem, size_t len, CURLcode *code)
|
||||
{
|
||||
curl_socket_t sockfd = conn->sock[num];
|
||||
ssize_t bytes_written = swrite(sockfd, mem, len);
|
||||
ssize_t bytes_written;
|
||||
|
||||
#ifdef MSG_FASTOPEN /* Linux */
|
||||
if(conn->bits.tcp_fastopen) {
|
||||
bytes_written = sendto(sockfd, mem, len, MSG_FASTOPEN,
|
||||
conn->ip_addr->ai_addr, conn->ip_addr->ai_addrlen);
|
||||
conn->bits.tcp_fastopen = FALSE;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
bytes_written = swrite(sockfd, mem, len);
|
||||
|
||||
*code = CURLE_OK;
|
||||
if(-1 == bytes_written) {
|
||||
|
|
@ -268,7 +278,8 @@ ssize_t Curl_send_plain(struct connectdata *conn, int num,
|
|||
/* errno may be EWOULDBLOCK or on some systems EAGAIN when it returned
|
||||
due to its inability to send off data without blocking. We therefor
|
||||
treat both error codes the same here */
|
||||
(EWOULDBLOCK == err) || (EAGAIN == err) || (EINTR == err)
|
||||
(EWOULDBLOCK == err) || (EAGAIN == err) || (EINTR == err) ||
|
||||
(EINPROGRESS == err)
|
||||
#endif
|
||||
) {
|
||||
/* this is just a case of EWOULDBLOCK */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue