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
try to add test #1
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
c: Copyright (C) Dorian Craps, <dorian.craps@student.vinci.be> | ||
SPDX-License-Identifier: curl | ||
Long: mptcp | ||
Added: 8.6.1 | ||
Help: Enable Multipath TCP (MPTCP) | ||
Category: connection | ||
Multi: boolean | ||
See-also: | ||
|
||
Example: | ||
- --mptcp $URL | ||
--- | ||
|
||
# `--mptcp` | ||
|
||
Enables the use of Multipath TCP (MPTCP) for connections. MPTCP is an extension to the standard TCP that allows multiple TCP streams over different network paths between the same source and destination. This can enhance bandwidth and improve reliability by using multiple paths simultaneously. | ||
|
||
MPTCP is beneficial in networks where multiple paths exist between clients and servers, such as mobile networks where a device may switch between Wi-Fi and cellular data or in wired networks with multiple ISPs. | ||
|
||
## Usage | ||
|
||
To use MPTCP for your connections, add the `--mptcp` option when using `curl`: | ||
|
||
## Requirements | ||
|
||
- Your operating system must support MPTCP, and it must be enabled. | ||
- The server you are connecting to must also support MPTCP. | ||
|
||
## Availability | ||
|
||
The `--mptcp` option is available starting from `curl` version 8.6.1. | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -423,6 +423,10 @@ Path to a Unix domain socket. See CURLOPT_UNIX_SOCKET_PATH(3) | |
Path to an abstract Unix domain socket. See CURLOPT_ABSTRACT_UNIX_SOCKET(3) | ||
## CURLOPT_MPTCP | ||
Enable Multipath TCP (MPTCP). See CURLOPT_MPTCP(3) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for the parent commit |
||
# NAMES and PASSWORDS OPTIONS (Authentication) | ||
## CURLOPT_NETRC | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for the parent commit |
||
c: Copyright (C) Dorian Craps, <dorian.craps@student.vinci.be> | ||
SPDX-License-Identifier: curl | ||
Title: CURLOPT_MPTCP | ||
Section: 3 | ||
Source: libcurl | ||
See-also: | ||
--- | ||
|
||
# NAME | ||
|
||
CURLOPT_MPTCP - enable Multipath TCP | ||
|
||
# SYNOPSIS | ||
|
||
~~~c | ||
|
||
#include <curl/curl.h> | ||
|
||
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MPTCP, long enable); | ||
~~~ | ||
|
||
# DESCRIPTION | ||
|
||
Pass a long as parameter set to 1L to enable or 0 to disable. | ||
|
||
Multipath TCP (MPTCP) is an extension of TCP that allows multiple paths | ||
to be used simultaneously by a single TCP connection, enhancing redundancy, | ||
bandwidth, and potentially reducing latency. | ||
It works by presenting a standard TCP interface to applications while | ||
managing multiple underlying TCP connections. | ||
|
||
Enabling MPTCP can improve the performance and reliability of network requests, | ||
particularly in environments where multiple network paths (e.g., WiFi and | ||
cellular) are available. | ||
|
||
Note: MPTCP support depends on the underlying operating system and network | ||
infrastructure. Not all networks support MPTCP, and its effectiveness will | ||
vary based on the network configuration and conditions. | ||
|
||
# DEFAULT | ||
|
||
0 | ||
|
||
# PROTOCOLS | ||
|
||
All | ||
|
||
# EXAMPLE | ||
|
||
~~~c | ||
|
||
int main(void) | ||
{ | ||
CURL *curl = curl_easy_init(); | ||
if(curl) { | ||
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); | ||
curl_easy_setopt(curl, CURLOPT_MPTCP, 1L); | ||
curl_easy_perform(curl); | ||
} | ||
} | ||
~~~ | ||
|
||
# AVAILABILITY | ||
|
||
Support for MPTCP in libcurl requires Linux 5.6 or later. The feature's availability in libcurl can also depend on the version of libcurl. Added in 8.6.1. | ||
|
||
# RETURN VALUE | ||
|
||
Returns CURLE_OK if MPTCP is successfully enabled for the connection, otherwise returns an error code specific to the reason it could not be enabled, which might include lack of operating system support or libcurl not being built with MPTCP support. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -708,6 +708,7 @@ CURLOPT_MAXREDIRS 7.5 | |
CURLOPT_MIME_OPTIONS 7.81.0 | ||
CURLOPT_MIMEPOST 7.56.0 | ||
CURLOPT_MUTE 7.1 7.8 7.15.5 | ||
CURLOPT_MPTCP 8.6.1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for the parent commit. Also, was it auto-generated? It is just that it might be added in 8.7.0 or another one for example There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I put it on myself, otherwise the test would not pass. I took my version of curl There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, it makes sense. If you put There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Try with |
||
CURLOPT_NETRC 7.1 | ||
CURLOPT_NETRC_FILE 7.11.0 | ||
CURLOPT_NEW_DIRECTORY_PERMS 7.16.4 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,6 +125,7 @@ | |
--max-redirs 7.5 | ||
--max-time (-m) 4.0 | ||
--metalink 7.27.0 | ||
--mptcp 8.6.1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for the parent commit. Also, was it auto-generated? It is just that it might be added in 8.7.0 or another one for example There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. put it on myself, otherwise the test would not pass. I took my version of curl There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here: either use |
||
--negotiate 7.10.6 | ||
--netrc (-n) 4.6 | ||
--netrc-file 7.21.5 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,6 +178,7 @@ struct curl_easyoption Curl_easyopts[] = { | |
{"MAX_SEND_SPEED_LARGE", CURLOPT_MAX_SEND_SPEED_LARGE, CURLOT_OFF_T, 0}, | ||
{"MIMEPOST", CURLOPT_MIMEPOST, CURLOT_OBJECT, 0}, | ||
{"MIME_OPTIONS", CURLOPT_MIME_OPTIONS, CURLOT_LONG, 0}, | ||
{"MPTCP", CURLOPT_MPTCP, CURLOT_LONG, 0}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for the parent commit. |
||
{"NETRC", CURLOPT_NETRC, CURLOT_VALUES, 0}, | ||
{"NETRC_FILE", CURLOPT_NETRC_FILE, CURLOT_STRING, 0}, | ||
{"NEW_DIRECTORY_PERMS", CURLOPT_NEW_DIRECTORY_PERMS, CURLOT_LONG, 0}, | ||
|
@@ -375,6 +376,6 @@ struct curl_easyoption Curl_easyopts[] = { | |
*/ | ||
int Curl_easyopts_check(void) | ||
{ | ||
return ((CURLOPT_LASTENTRY%10000) != (324 + 1)); | ||
return ((CURLOPT_LASTENTRY%10000) != (325 + 1)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for the parent commit. |
||
} | ||
#endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -378,6 +378,9 @@ const struct helptxt helptext[] = { | |
{" --metalink", | ||
"Process given URLs as metalink XML file", | ||
CURLHELP_MISC}, | ||
{" --mptcp", | ||
"Enable Multipath TCP (MPTCP)", | ||
CURLHELP_CONNECTION}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for the parent commit. |
||
{" --negotiate", | ||
"Use HTTP Negotiate (SPNEGO) authentication", | ||
CURLHELP_AUTH | CURLHELP_HTTP}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<testcase> | ||
<info> | ||
<keywords> | ||
MPTCP | ||
Multipath TCP | ||
mptcp | ||
</keywords> | ||
</info> | ||
|
||
<!-- Server-side configuration --> | ||
<reply> | ||
<data nocheck="yes"> | ||
HTTP/1.1 200 OK | ||
Server: swsclose | ||
Content-Type: text/plain | ||
|
||
Ceci est une réponse de test MPTCP. | ||
</data> | ||
</reply> | ||
|
||
<!-- Client-side commands --> | ||
<client> | ||
<server> | ||
mptcp | ||
</server> | ||
<precheck> | ||
sh -c '[ "$(cat /proc/sys/net/mptcp/enabled 2>/dev/null)" = "1" ]' | ||
</precheck> | ||
<name> | ||
MPTCP GET Request | ||
</name> | ||
<command> | ||
--mptcp http://%HOSTIP:%HTTPPORT/%TESTNUMBER | ||
</command> | ||
</client> | ||
|
||
<!-- Verification --> | ||
<verify> | ||
<protocol> | ||
GET /%TESTNUMBER HTTP/1.1 | ||
Host: %HOSTIP:%HTTPPORT | ||
User-Agent: curl/%VERSION | ||
Accept: */* | ||
</protocol> | ||
<errorcode> | ||
0 | ||
</errorcode> | ||
</verify> | ||
</testcase> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the parent commit