summaryrefslogtreecommitdiff
path: root/lib/connect.c
diff options
context:
space:
mode:
authorAlessandro Ghedini <alessandro@ghedini.me>2016-04-03 13:08:28 +0100
committerDaniel Stenberg <daniel@haxx.se>2016-04-18 23:21:50 +0200
commit03de4e4b2192bec7de94d2d5abd2a25f86c17ac3 (patch)
tree689fd77d0022d451ed0d1a5947519ac493cedc49 /lib/connect.c
parentd49087f6bc95d159eeb1172173fc1e95411041fa (diff)
downloadcurl-03de4e4b2192bec7de94d2d5abd2a25f86c17ac3.tar.gz
connect: implement TCP Fast Open for Linux
Closes #660
Diffstat (limited to 'lib/connect.c')
-rw-r--r--lib/connect.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/connect.c b/lib/connect.c
index a4eb56d00..bfc22992c 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -668,7 +668,7 @@ void Curl_updateconninfo(struct connectdata *conn, curl_socket_t sockfd)
/* there's no connection! */
return;
- if(!conn->bits.reuse) {
+ if(!conn->bits.reuse && !conn->bits.tcp_fastopen) {
int error;
len = sizeof(struct Curl_sockaddr_storage);
@@ -776,7 +776,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
trynextip(conn, sockindex, 1);
}
}
- else if(rc == CURL_CSELECT_OUT) {
+ else if(rc == CURL_CSELECT_OUT || conn->bits.tcp_fastopen) {
if(verifyconnect(conn->tempsock[i], &error)) {
/* we are connected with TCP, awesome! */
@@ -1109,6 +1109,8 @@ static CURLcode singleipconnect(struct connectdata *conn,
rc = connectx(sockfd, &endpoints, SAE_ASSOCID_ANY,
CONNECT_RESUME_ON_READ_WRITE | CONNECT_DATA_IDEMPOTENT,
NULL, 0, NULL, NULL);
+#elif defined(MSG_FASTOPEN) /* Linux */
+ rc = 0; /* Do nothing */
#endif
}
else {