CINXE.COM
Structs - everything curl
<!DOCTYPE HTML> <html lang="en" class="light" dir="ltr"> <head> <!-- Book generated using mdBook --> <meta charset="UTF-8"> <title>Structs - everything curl</title> <!-- Custom HTML head --> <meta name="description" content="everything there is to know about curl, libcurl and the cURL project"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="theme-color" content="#ffffff"> <link rel="icon" href="../favicon.svg"> <link rel="shortcut icon" href="../favicon.png"> <link rel="stylesheet" href="../css/variables.css"> <link rel="stylesheet" href="../css/general.css"> <link rel="stylesheet" href="../css/chrome.css"> <link rel="stylesheet" href="../css/print.css" media="print"> <!-- Fonts --> <link rel="stylesheet" href="../FontAwesome/css/font-awesome.css"> <link rel="stylesheet" href="../fonts/fonts.css"> <!-- Highlight.js Stylesheets --> <link rel="stylesheet" href="../highlight.css"> <link rel="stylesheet" href="../tomorrow-night.css"> <link rel="stylesheet" href="../ayu-highlight.css"> <!-- Custom theme stylesheets --> </head> <body class="sidebar-visible no-js"> <div id="body-container"> <!-- Provide site root to javascript --> <script> var path_to_root = "../"; var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "navy" : "light"; </script> <!-- Work around some values being stored in localStorage wrapped in quotes --> <script> try { var theme = localStorage.getItem('mdbook-theme'); var sidebar = localStorage.getItem('mdbook-sidebar'); if (theme.startsWith('"') && theme.endsWith('"')) { localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1)); } if (sidebar.startsWith('"') && sidebar.endsWith('"')) { localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1)); } } catch (e) { } </script> <!-- Set the theme before any content is loaded, prevents flash --> <script> var theme; try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { } if (theme === null || theme === undefined) { theme = default_theme; } var html = document.querySelector('html'); html.classList.remove('light') html.classList.add(theme); var body = document.querySelector('body'); body.classList.remove('no-js') body.classList.add('js'); </script> <input type="checkbox" id="sidebar-toggle-anchor" class="hidden"> <!-- Hide / unhide sidebar before it is displayed --> <script> var body = document.querySelector('body'); var sidebar = null; var sidebar_toggle = document.getElementById("sidebar-toggle-anchor"); if (document.body.clientWidth >= 1080) { try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { } sidebar = sidebar || 'visible'; } else { sidebar = 'hidden'; } sidebar_toggle.checked = sidebar === 'visible'; body.classList.remove('sidebar-visible'); body.classList.add("sidebar-" + sidebar); </script> <nav id="sidebar" class="sidebar" aria-label="Table of contents"> <div class="sidebar-scrollbox"> <ol class="chapter"><li class="chapter-item "><a href="../index.html"><strong aria-hidden="true">1.</strong> Introduction</a></li><li class="chapter-item "><a href="../how-to-read.html"><strong aria-hidden="true">2.</strong> How to read</a></li><li class="chapter-item "><a href="../project/index.html"><strong aria-hidden="true">3.</strong> The cURL project</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../project/started.html"><strong aria-hidden="true">3.1.</strong> How it started</a></li><li class="chapter-item "><a href="../project/name.html"><strong aria-hidden="true">3.2.</strong> The name</a></li><li class="chapter-item "><a href="../project/does.html"><strong aria-hidden="true">3.3.</strong> What does curl do?</a></li><li class="chapter-item "><a href="../project/comm.html"><strong aria-hidden="true">3.4.</strong> Project communication</a></li><li class="chapter-item "><a href="../project/etiquette.html"><strong aria-hidden="true">3.5.</strong> Mailing list etiquette</a></li><li class="chapter-item "><a href="../project/maillists.html"><strong aria-hidden="true">3.6.</strong> Mailing lists</a></li><li class="chapter-item "><a href="../project/bugs.html"><strong aria-hidden="true">3.7.</strong> Reporting bugs</a></li><li class="chapter-item "><a href="../project/support.html"><strong aria-hidden="true">3.8.</strong> Commercial support</a></li><li class="chapter-item "><a href="../project/releases.html"><strong aria-hidden="true">3.9.</strong> Releases</a></li><li class="chapter-item "><a href="../project/security.html"><strong aria-hidden="true">3.10.</strong> Security</a></li><li class="chapter-item "><a href="../project/trust.html"><strong aria-hidden="true">3.11.</strong> Trust</a></li><li class="chapter-item "><a href="../project/coc.html"><strong aria-hidden="true">3.12.</strong> Code of Conduct</a></li><li class="chapter-item "><a href="../project/devel.html"><strong aria-hidden="true">3.13.</strong> Development</a></li><li class="chapter-item "><a href="../project/devteam.html"><strong aria-hidden="true">3.14.</strong> The development team</a></li><li class="chapter-item "><a href="../project/users.html"><strong aria-hidden="true">3.15.</strong> Users of curl</a></li><li class="chapter-item "><a href="../project/future.html"><strong aria-hidden="true">3.16.</strong> Future</a></li></ol></li><li class="chapter-item "><a href="../protocols/index.html"><strong aria-hidden="true">4.</strong> Network and protocols</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../protocols/network.html"><strong aria-hidden="true">4.1.</strong> Networking simplified</a></li><li class="chapter-item "><a href="../protocols/protocols.html"><strong aria-hidden="true">4.2.</strong> Protocols</a></li><li class="chapter-item "><a href="../protocols/curl.html"><strong aria-hidden="true">4.3.</strong> curl protocols</a></li><li class="chapter-item "><a href="../protocols/http.html"><strong aria-hidden="true">4.4.</strong> HTTP basics</a></li></ol></li><li class="chapter-item "><a href="../install/index.html"><strong aria-hidden="true">5.</strong> Install curl and libcurl</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../install/linux.html"><strong aria-hidden="true">5.1.</strong> Linux</a></li><li class="chapter-item "><a href="../install/windows/index.html"><strong aria-hidden="true">5.2.</strong> Windows</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../install/windows/win-msys2.html"><strong aria-hidden="true">5.2.1.</strong> MSYS2</a></li><li class="chapter-item "><a href="../install/windows/win-vcpkg.html"><strong aria-hidden="true">5.2.2.</strong> vcpkg</a></li></ol></li><li class="chapter-item "><a href="../install/macos.html"><strong aria-hidden="true">5.3.</strong> macOS</a></li><li class="chapter-item "><a href="../install/container.html"><strong aria-hidden="true">5.4.</strong> Container</a></li></ol></li><li class="chapter-item "><a href="../source/index.html"><strong aria-hidden="true">6.</strong> Source code</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../source/opensource/index.html"><strong aria-hidden="true">6.1.</strong> Open Source</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../source/opensource/license.html"><strong aria-hidden="true">6.1.1.</strong> License</a></li><li class="chapter-item "><a href="../source/opensource/copyright.html"><strong aria-hidden="true">6.1.2.</strong> Copyright</a></li></ol></li><li class="chapter-item "><a href="../source/layout.html"><strong aria-hidden="true">6.2.</strong> Code layout</a></li><li class="chapter-item "><a href="../source/options.html"><strong aria-hidden="true">6.3.</strong> Handling build options</a></li><li class="chapter-item "><a href="../source/style.html"><strong aria-hidden="true">6.4.</strong> Code style</a></li><li class="chapter-item "><a href="../source/contributing.html"><strong aria-hidden="true">6.5.</strong> Contributing</a></li><li class="chapter-item "><a href="../source/reportvuln.html"><strong aria-hidden="true">6.6.</strong> Reporting vulnerabilities</a></li><li class="chapter-item "><a href="../source/web.html"><strong aria-hidden="true">6.7.</strong> Website</a></li></ol></li><li class="chapter-item "><a href="../build/index.html"><strong aria-hidden="true">7.</strong> Build curl and libcurl</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../build/autotools.html"><strong aria-hidden="true">7.1.</strong> Autotools</a></li><li class="chapter-item "><a href="../build/cmake.html"><strong aria-hidden="true">7.2.</strong> CMake</a></li><li class="chapter-item "><a href="../build/separate.html"><strong aria-hidden="true">7.3.</strong> Separate install</a></li><li class="chapter-item "><a href="../build/windows.html"><strong aria-hidden="true">7.4.</strong> Windows</a></li><li class="chapter-item "><a href="../build/deps.html"><strong aria-hidden="true">7.5.</strong> Dependencies</a></li><li class="chapter-item "><a href="../build/tls.html"><strong aria-hidden="true">7.6.</strong> TLS libraries</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../build/boringssl.html"><strong aria-hidden="true">7.6.1.</strong> BoringSSL</a></li></ol></li></ol></li><li class="chapter-item "><a href="../cmdline/index.html"><strong aria-hidden="true">8.</strong> Command line concepts</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../cmdline/differences.html"><strong aria-hidden="true">8.1.</strong> Differences</a></li><li class="chapter-item "><a href="../cmdline/options/index.html"><strong aria-hidden="true">8.2.</strong> Command line options</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../cmdline/options/short.html"><strong aria-hidden="true">8.2.1.</strong> Short options</a></li><li class="chapter-item "><a href="../cmdline/options/long.html"><strong aria-hidden="true">8.2.2.</strong> Long options</a></li><li class="chapter-item "><a href="../cmdline/options/args.html"><strong aria-hidden="true">8.2.3.</strong> Arguments to options</a></li><li class="chapter-item "><a href="../cmdline/options/negative.html"><strong aria-hidden="true">8.2.4.</strong> Negative options</a></li></ol></li><li class="chapter-item "><a href="../cmdline/versions.html"><strong aria-hidden="true">8.3.</strong> Options depend on version</a></li><li class="chapter-item "><a href="../cmdline/urls/index.html"><strong aria-hidden="true">8.4.</strong> URLs</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../cmdline/urls/scheme.html"><strong aria-hidden="true">8.4.1.</strong> Scheme</a></li><li class="chapter-item "><a href="../cmdline/urls/auth.html"><strong aria-hidden="true">8.4.2.</strong> Name and password</a></li><li class="chapter-item "><a href="../cmdline/urls/host.html"><strong aria-hidden="true">8.4.3.</strong> Host</a></li><li class="chapter-item "><a href="../cmdline/urls/port.html"><strong aria-hidden="true">8.4.4.</strong> Port number</a></li><li class="chapter-item "><a href="../cmdline/urls/path.html"><strong aria-hidden="true">8.4.5.</strong> Path</a></li><li class="chapter-item "><a href="../cmdline/urls/query.html"><strong aria-hidden="true">8.4.6.</strong> Query</a></li><li class="chapter-item "><a href="../cmdline/urls/ftptype.html"><strong aria-hidden="true">8.4.7.</strong> FTP type</a></li><li class="chapter-item "><a href="../cmdline/urls/fragment.html"><strong aria-hidden="true">8.4.8.</strong> Fragment</a></li><li class="chapter-item "><a href="../cmdline/urls/browsers.html"><strong aria-hidden="true">8.4.9.</strong> Browsers</a></li><li class="chapter-item "><a href="../cmdline/urls/options.html"><strong aria-hidden="true">8.4.10.</strong> Many options and URLs</a></li><li class="chapter-item "><a href="../cmdline/urls/globbing.html"><strong aria-hidden="true">8.4.11.</strong> URL globbing</a></li><li class="chapter-item "><a href="../cmdline/urls/connreuse.html"><strong aria-hidden="true">8.4.12.</strong> Connection reuse</a></li><li class="chapter-item "><a href="../cmdline/urls/parallel.html"><strong aria-hidden="true">8.4.13.</strong> Parallel transfers</a></li><li class="chapter-item "><a href="../cmdline/urls/trurl.html"><strong aria-hidden="true">8.4.14.</strong> trurl</a></li></ol></li><li class="chapter-item "><a href="../cmdline/listopts.html"><strong aria-hidden="true">8.5.</strong> List options</a></li><li class="chapter-item "><a href="../cmdline/configfile.html"><strong aria-hidden="true">8.6.</strong> Config file</a></li><li class="chapter-item "><a href="../cmdline/variables.html"><strong aria-hidden="true">8.7.</strong> Variables</a></li><li class="chapter-item "><a href="../cmdline/passwords.html"><strong aria-hidden="true">8.8.</strong> Passwords</a></li><li class="chapter-item "><a href="../cmdline/progressmeter.html"><strong aria-hidden="true">8.9.</strong> Progress meter</a></li><li class="chapter-item "><a href="../cmdline/curlver.html"><strong aria-hidden="true">8.10.</strong> Version</a></li><li class="chapter-item "><a href="../cmdline/exitcode.html"><strong aria-hidden="true">8.11.</strong> Exit code</a></li><li class="chapter-item "><a href="../cmdline/copyas.html"><strong aria-hidden="true">8.12.</strong> Copy as curl</a></li></ol></li><li class="chapter-item "><a href="../usingcurl/index.html"><strong aria-hidden="true">9.</strong> Command line transfers</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../usingcurl/verbose/index.html"><strong aria-hidden="true">9.1.</strong> Verbose</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../usingcurl/verbose/trace.html"><strong aria-hidden="true">9.1.1.</strong> Trace options</a></li><li class="chapter-item "><a href="../usingcurl/verbose/writeout.html"><strong aria-hidden="true">9.1.2.</strong> Write out</a></li></ol></li><li class="chapter-item "><a href="../usingcurl/downloads/index.html"><strong aria-hidden="true">9.2.</strong> Downloads</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../usingcurl/downloads/whatis.html"><strong aria-hidden="true">9.2.1.</strong> What is downloading?</a></li><li class="chapter-item "><a href="../usingcurl/downloads/storing.html"><strong aria-hidden="true">9.2.2.</strong> Storing downloads</a></li><li class="chapter-item "><a href="../usingcurl/downloads/url-named.html"><strong aria-hidden="true">9.2.3.</strong> Download to a file named by the URL</a></li><li class="chapter-item "><a href="../usingcurl/downloads/content-disp.html"><strong aria-hidden="true">9.2.4.</strong> Use the target filename from the server</a></li><li class="chapter-item "><a href="../usingcurl/downloads/charsets.html"><strong aria-hidden="true">9.2.5.</strong> HTML and charsets</a></li><li class="chapter-item "><a href="../usingcurl/downloads/redirects.html"><strong aria-hidden="true">9.2.6.</strong> Shell redirects</a></li><li class="chapter-item "><a href="../usingcurl/downloads/multiple.html"><strong aria-hidden="true">9.2.7.</strong> Multiple downloads</a></li><li class="chapter-item "><a href="../usingcurl/downloads/browsers.html"><strong aria-hidden="true">9.2.8.</strong> My browser shows something else</a></li><li class="chapter-item "><a href="../usingcurl/downloads/max-filesize.html"><strong aria-hidden="true">9.2.9.</strong> Maximum filesize</a></li><li class="chapter-item "><a href="../usingcurl/downloads/metadata-fs.html"><strong aria-hidden="true">9.2.10.</strong> Storing metadata in file system</a></li><li class="chapter-item "><a href="../usingcurl/downloads/raw.html"><strong aria-hidden="true">9.2.11.</strong> Raw</a></li><li class="chapter-item "><a href="../usingcurl/downloads/retry.html"><strong aria-hidden="true">9.2.12.</strong> Retry</a></li><li class="chapter-item "><a href="../usingcurl/downloads/resume.html"><strong aria-hidden="true">9.2.13.</strong> Resuming and ranges</a></li></ol></li><li class="chapter-item "><a href="../usingcurl/uploads.html"><strong aria-hidden="true">9.3.</strong> Uploads</a></li><li class="chapter-item "><a href="../usingcurl/transfers/index.html"><strong aria-hidden="true">9.4.</strong> Transfer controls</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../usingcurl/transfers/tooslow.html"><strong aria-hidden="true">9.4.1.</strong> Stop slow transfers</a></li><li class="chapter-item "><a href="../usingcurl/transfers/rate-limiting.html"><strong aria-hidden="true">9.4.2.</strong> Rate limiting</a></li><li class="chapter-item "><a href="../usingcurl/transfers/request-rate.html"><strong aria-hidden="true">9.4.3.</strong> Request rate limiting</a></li><li class="chapter-item "><a href="../usingcurl/transfers/compression.html"><strong aria-hidden="true">9.4.4.</strong> Compression</a></li></ol></li><li class="chapter-item "><a href="../usingcurl/connections/index.html"><strong aria-hidden="true">9.5.</strong> Connections</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../usingcurl/connections/name.html"><strong aria-hidden="true">9.5.1.</strong> Name resolve tricks</a></li><li class="chapter-item "><a href="../usingcurl/connections/timeout.html"><strong aria-hidden="true">9.5.2.</strong> Connection timeout</a></li><li class="chapter-item "><a href="../usingcurl/connections/happy.html"><strong aria-hidden="true">9.5.3.</strong> Happy Eyeballs</a></li><li class="chapter-item "><a href="../usingcurl/connections/interface.html"><strong aria-hidden="true">9.5.4.</strong> Network interface</a></li><li class="chapter-item "><a href="../usingcurl/connections/local-port.html"><strong aria-hidden="true">9.5.5.</strong> Local port number</a></li><li class="chapter-item "><a href="../usingcurl/connections/keepalive.html"><strong aria-hidden="true">9.5.6.</strong> Keep alive</a></li></ol></li><li class="chapter-item "><a href="../usingcurl/timeouts.html"><strong aria-hidden="true">9.6.</strong> Timeouts</a></li><li class="chapter-item "><a href="../usingcurl/netrc.html"><strong aria-hidden="true">9.7.</strong> .netrc</a></li><li class="chapter-item "><a href="../usingcurl/proxies/index.html"><strong aria-hidden="true">9.8.</strong> Proxies</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../usingcurl/proxies/discover.html"><strong aria-hidden="true">9.8.1.</strong> Discover your proxy</a></li><li class="chapter-item "><a href="../usingcurl/proxies/pac.html"><strong aria-hidden="true">9.8.2.</strong> PAC</a></li><li class="chapter-item "><a href="../usingcurl/proxies/captive.html"><strong aria-hidden="true">9.8.3.</strong> Captive portals</a></li><li class="chapter-item "><a href="../usingcurl/proxies/type.html"><strong aria-hidden="true">9.8.4.</strong> Proxy type</a></li><li class="chapter-item "><a href="../usingcurl/proxies/http.html"><strong aria-hidden="true">9.8.5.</strong> HTTP proxy</a></li><li class="chapter-item "><a href="../usingcurl/proxies/socks.html"><strong aria-hidden="true">9.8.6.</strong> SOCKS proxy</a></li><li class="chapter-item "><a href="../usingcurl/proxies/mitm.html"><strong aria-hidden="true">9.8.7.</strong> MITM proxy</a></li><li class="chapter-item "><a href="../usingcurl/proxies/auth.html"><strong aria-hidden="true">9.8.8.</strong> Proxy authentication</a></li><li class="chapter-item "><a href="../usingcurl/proxies/https.html"><strong aria-hidden="true">9.8.9.</strong> HTTPS proxy</a></li><li class="chapter-item "><a href="../usingcurl/proxies/env.html"><strong aria-hidden="true">9.8.10.</strong> Proxy environment variables</a></li><li class="chapter-item "><a href="../usingcurl/proxies/headers.html"><strong aria-hidden="true">9.8.11.</strong> Proxy headers</a></li><li class="chapter-item "><a href="../usingcurl/proxies/haproxy.html"><strong aria-hidden="true">9.8.12.</strong> haproxy</a></li></ol></li><li class="chapter-item "><a href="../usingcurl/tls.html"><strong aria-hidden="true">9.9.</strong> TLS</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../usingcurl/tls/ciphers.html"><strong aria-hidden="true">9.9.1.</strong> Ciphers</a></li><li class="chapter-item "><a href="../usingcurl/tls/enable.html"><strong aria-hidden="true">9.9.2.</strong> Enable TLS</a></li><li class="chapter-item "><a href="../usingcurl/tls/versions.html"><strong aria-hidden="true">9.9.3.</strong> TLS versions</a></li><li class="chapter-item "><a href="../usingcurl/tls/verify.html"><strong aria-hidden="true">9.9.4.</strong> Verifying server certificates</a></li><li class="chapter-item "><a href="../usingcurl/tls/pinning.html"><strong aria-hidden="true">9.9.5.</strong> Certificate pinning</a></li><li class="chapter-item "><a href="../usingcurl/tls/stapling.html"><strong aria-hidden="true">9.9.6.</strong> OCSP stapling</a></li><li class="chapter-item "><a href="../usingcurl/tls/clientcert.html"><strong aria-hidden="true">9.9.7.</strong> Client certificates</a></li><li class="chapter-item "><a href="../usingcurl/tls/auth.html"><strong aria-hidden="true">9.9.8.</strong> TLS auth</a></li><li class="chapter-item "><a href="../usingcurl/tls/backends.html"><strong aria-hidden="true">9.9.9.</strong> TLS backends</a></li><li class="chapter-item "><a href="../usingcurl/tls/sslkeylogfile.html"><strong aria-hidden="true">9.9.10.</strong> SSLKEYLOGFILE</a></li></ol></li><li class="chapter-item "><a href="../usingcurl/ssh/index.html"><strong aria-hidden="true">9.10.</strong> SCP and SFTP</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../usingcurl/ssh/url.html"><strong aria-hidden="true">9.10.1.</strong> URLs</a></li><li class="chapter-item "><a href="../usingcurl/ssh/auth.html"><strong aria-hidden="true">9.10.2.</strong> Authentication</a></li><li class="chapter-item "><a href="../usingcurl/ssh/knownhosts.html"><strong aria-hidden="true">9.10.3.</strong> Known hosts</a></li></ol></li><li class="chapter-item "><a href="../usingcurl/reademail.html"><strong aria-hidden="true">9.11.</strong> Reading email</a></li><li class="chapter-item "><a href="../usingcurl/smtp.html"><strong aria-hidden="true">9.12.</strong> Sending email</a></li><li class="chapter-item "><a href="../usingcurl/dict.html"><strong aria-hidden="true">9.13.</strong> DICT</a></li><li class="chapter-item "><a href="../usingcurl/ipfs.html"><strong aria-hidden="true">9.14.</strong> IPFS</a></li><li class="chapter-item "><a href="../usingcurl/mqtt.html"><strong aria-hidden="true">9.15.</strong> MQTT</a></li><li class="chapter-item "><a href="../usingcurl/telnet.html"><strong aria-hidden="true">9.16.</strong> TELNET</a></li><li class="chapter-item "><a href="../usingcurl/tftp.html"><strong aria-hidden="true">9.17.</strong> TFTP</a></li></ol></li><li class="chapter-item "><a href="../http/index.html"><strong aria-hidden="true">10.</strong> Command line HTTP</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../http/method.html"><strong aria-hidden="true">10.1.</strong> Method</a></li><li class="chapter-item "><a href="../http/response.html"><strong aria-hidden="true">10.2.</strong> Responses</a></li><li class="chapter-item "><a href="../http/auth.html"><strong aria-hidden="true">10.3.</strong> Authentication</a></li><li class="chapter-item "><a href="../http/versions/index.html"><strong aria-hidden="true">10.4.</strong> HTTP versions</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../http/versions/http09.html"><strong aria-hidden="true">10.4.1.</strong> HTTP/0.9</a></li><li class="chapter-item "><a href="../http/versions/http2.html"><strong aria-hidden="true">10.4.2.</strong> HTTP/2</a></li><li class="chapter-item "><a href="../http/versions/http3.html"><strong aria-hidden="true">10.4.3.</strong> HTTP/3</a></li></ol></li><li class="chapter-item "><a href="../http/post/index.html"><strong aria-hidden="true">10.5.</strong> HTTP POST</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../http/post/simple.html"><strong aria-hidden="true">10.5.1.</strong> Simple POST</a></li><li class="chapter-item "><a href="../http/post/content-type.html"><strong aria-hidden="true">10.5.2.</strong> Content-Type</a></li><li class="chapter-item "><a href="../http/post/binary.html"><strong aria-hidden="true">10.5.3.</strong> Posting binary</a></li><li class="chapter-item "><a href="../http/post/json.html"><strong aria-hidden="true">10.5.4.</strong> JSON</a></li><li class="chapter-item "><a href="../http/post/url-encode.html"><strong aria-hidden="true">10.5.5.</strong> URL encode data</a></li><li class="chapter-item "><a href="../http/post/convert-to-get.html"><strong aria-hidden="true">10.5.6.</strong> Convert to GET</a></li><li class="chapter-item "><a href="../http/post/expect100.html"><strong aria-hidden="true">10.5.7.</strong> Expect 100-continue</a></li><li class="chapter-item "><a href="../http/post/chunked.html"><strong aria-hidden="true">10.5.8.</strong> Chunked encoded POSTs</a></li><li class="chapter-item "><a href="../http/post/hiddenfields.html"><strong aria-hidden="true">10.5.9.</strong> Hidden form fields</a></li><li class="chapter-item "><a href="../http/post/browsersends.html"><strong aria-hidden="true">10.5.10.</strong> Figure out what a browser sends</a></li><li class="chapter-item "><a href="../http/post/javascript.html"><strong aria-hidden="true">10.5.11.</strong> JavaScript and forms</a></li><li class="chapter-item "><a href="../http/post/multipart.html"><strong aria-hidden="true">10.5.12.</strong> Multipart formposts</a></li><li class="chapter-item "><a href="../http/post/postvspost.html"><strong aria-hidden="true">10.5.13.</strong> -d vs -F</a></li></ol></li><li class="chapter-item "><a href="../http/put.html"><strong aria-hidden="true">10.6.</strong> HTTP PUT</a></li><li class="chapter-item "><a href="../http/redirects.html"><strong aria-hidden="true">10.7.</strong> Redirects</a></li><li class="chapter-item "><a href="../http/modify/index.html"><strong aria-hidden="true">10.8.</strong> Customize your HTTP</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../http/modify/method.html"><strong aria-hidden="true">10.8.1.</strong> Request method</a></li><li class="chapter-item "><a href="../http/modify/target.html"><strong aria-hidden="true">10.8.2.</strong> Request target</a></li><li class="chapter-item "><a href="../http/modify/fragment.html"><strong aria-hidden="true">10.8.3.</strong> Fragment</a></li><li class="chapter-item "><a href="../http/modify/headers.html"><strong aria-hidden="true">10.8.4.</strong> Customize headers</a></li><li class="chapter-item "><a href="../http/modify/referer.html"><strong aria-hidden="true">10.8.5.</strong> Referer</a></li><li class="chapter-item "><a href="../http/modify/user-agent.html"><strong aria-hidden="true">10.8.6.</strong> User-agent</a></li><li class="chapter-item "><a href="../http/modify/ranges.html"><strong aria-hidden="true">10.8.7.</strong> Ranges</a></li><li class="chapter-item "><a href="../http/modify/conditionals.html"><strong aria-hidden="true">10.8.8.</strong> Conditionals</a></li><li class="chapter-item "><a href="../http/modify/compression.html"><strong aria-hidden="true">10.8.9.</strong> Compression</a></li></ol></li><li class="chapter-item "><a href="../http/cookies/index.html"><strong aria-hidden="true">10.9.</strong> Cookies</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../http/cookies/engine.html"><strong aria-hidden="true">10.9.1.</strong> Cookie engine</a></li><li class="chapter-item "><a href="../http/cookies/reading.html"><strong aria-hidden="true">10.9.2.</strong> Reading cookies from file</a></li><li class="chapter-item "><a href="../http/cookies/writing.html"><strong aria-hidden="true">10.9.3.</strong> Writing cookies to file</a></li><li class="chapter-item "><a href="../http/cookies/newsession.html"><strong aria-hidden="true">10.9.4.</strong> New cookie session</a></li><li class="chapter-item "><a href="../http/cookies/fileformat.html"><strong aria-hidden="true">10.9.5.</strong> Cookie file format</a></li></ol></li><li class="chapter-item "><a href="../http/https.html"><strong aria-hidden="true">10.10.</strong> HTTPS</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../http/https/hsts.html"><strong aria-hidden="true">10.10.1.</strong> HSTS</a></li><li class="chapter-item "><a href="../http/https/altsvc.html"><strong aria-hidden="true">10.10.2.</strong> Alternative Services</a></li></ol></li><li class="chapter-item "><a href="../http/browserlike.html"><strong aria-hidden="true">10.11.</strong> Scripting browser-like tasks</a></li></ol></li><li class="chapter-item "><a href="../ftp/index.html"><strong aria-hidden="true">11.</strong> Command line FTP</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../ftp/dirlist.html"><strong aria-hidden="true">11.1.</strong> FTP Directory listing</a></li><li class="chapter-item "><a href="../ftp/upload.html"><strong aria-hidden="true">11.2.</strong> Uploading with FTP</a></li><li class="chapter-item "><a href="../ftp/cmds.html"><strong aria-hidden="true">11.3.</strong> Custom FTP commands</a></li><li class="chapter-item "><a href="../ftp/twoconnections.html"><strong aria-hidden="true">11.4.</strong> Two connections</a></li><li class="chapter-item "><a href="../ftp/traversedir.html"><strong aria-hidden="true">11.5.</strong> Directory traversing</a></li><li class="chapter-item "><a href="../ftp/ftps.html"><strong aria-hidden="true">11.6.</strong> FTPS</a></li></ol></li><li class="chapter-item "><a href="../libcurl/index.html"><strong aria-hidden="true">12.</strong> libcurl</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../libcurl/headers.html"><strong aria-hidden="true">12.1.</strong> Header files</a></li><li class="chapter-item "><a href="../libcurl/globalinit.html"><strong aria-hidden="true">12.2.</strong> Global initialization</a></li><li class="chapter-item "><a href="../libcurl/api.html"><strong aria-hidden="true">12.3.</strong> API compatibility</a></li><li class="chapter-item "><a href="../libcurl/--libcurl.html"><strong aria-hidden="true">12.4.</strong> --libcurl</a></li><li class="chapter-item "><a href="../libcurl/threading.html"><strong aria-hidden="true">12.5.</strong> multi-threading</a></li><li class="chapter-item "><a href="../libcurl/curlcode.html"><strong aria-hidden="true">12.6.</strong> CURLcode return codes</a></li><li class="chapter-item "><a href="../libcurl/verbose.html"><strong aria-hidden="true">12.7.</strong> Verbose operations</a></li><li class="chapter-item "><a href="../libcurl/caches.html"><strong aria-hidden="true">12.8.</strong> Caches</a></li><li class="chapter-item "><a href="../libcurl/performance.html"><strong aria-hidden="true">12.9.</strong> Performance</a></li><li class="chapter-item "><a href="../libcurl/cplusplus.html"><strong aria-hidden="true">12.10.</strong> for C++ programmers</a></li></ol></li><li class="chapter-item "><a href="../transfers/index.html"><strong aria-hidden="true">13.</strong> libcurl transfers</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../transfers/easyhandle.html"><strong aria-hidden="true">13.1.</strong> Easy handle</a></li><li class="chapter-item "><a href="../transfers/options/index.html"><strong aria-hidden="true">13.2.</strong> curl easy options</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../transfers/options/num.html"><strong aria-hidden="true">13.2.1.</strong> Set numerical options</a></li><li class="chapter-item "><a href="../transfers/options/strings.html"><strong aria-hidden="true">13.2.2.</strong> Set string options</a></li><li class="chapter-item "><a href="../transfers/options/tls.html"><strong aria-hidden="true">13.2.3.</strong> TLS options</a></li><li class="chapter-item "><a href="../transfers/options/all.html"><strong aria-hidden="true">13.2.4.</strong> All options</a></li><li class="chapter-item "><a href="../transfers/options/info.html"><strong aria-hidden="true">13.2.5.</strong> Get option information</a></li></ol></li><li class="chapter-item "><a href="../transfers/drive/index.html"><strong aria-hidden="true">13.3.</strong> Drive transfers</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../transfers/drive/easy.html"><strong aria-hidden="true">13.3.1.</strong> Drive with easy</a></li><li class="chapter-item "><a href="../transfers/drive/multi.html"><strong aria-hidden="true">13.3.2.</strong> Drive with multi</a></li><li class="chapter-item "><a href="../transfers/drive/multi-socket.html"><strong aria-hidden="true">13.3.3.</strong> Drive with multi_socket</a></li></ol></li><li class="chapter-item "><a href="../transfers/callbacks/index.html"><strong aria-hidden="true">13.4.</strong> Callbacks</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../transfers/callbacks/write.html"><strong aria-hidden="true">13.4.1.</strong> Write data</a></li><li class="chapter-item "><a href="../transfers/callbacks/read.html"><strong aria-hidden="true">13.4.2.</strong> Read data</a></li><li class="chapter-item "><a href="../transfers/callbacks/progress.html"><strong aria-hidden="true">13.4.3.</strong> Progress information</a></li><li class="chapter-item "><a href="../transfers/callbacks/header.html"><strong aria-hidden="true">13.4.4.</strong> Header data</a></li><li class="chapter-item "><a href="../transfers/callbacks/debug.html"><strong aria-hidden="true">13.4.5.</strong> Debug</a></li><li class="chapter-item "><a href="../transfers/callbacks/sockopt.html"><strong aria-hidden="true">13.4.6.</strong> sockopt</a></li><li class="chapter-item "><a href="../transfers/callbacks/sslcontext.html"><strong aria-hidden="true">13.4.7.</strong> SSL context</a></li><li class="chapter-item "><a href="../transfers/callbacks/seek.html"><strong aria-hidden="true">13.4.8.</strong> Seek and ioctl</a></li><li class="chapter-item "><a href="../transfers/callbacks/conversions.html"><strong aria-hidden="true">13.4.9.</strong> Network data conversion</a></li><li class="chapter-item "><a href="../transfers/callbacks/openclosesocket.html"><strong aria-hidden="true">13.4.10.</strong> Opensocket and closesocket</a></li><li class="chapter-item "><a href="../transfers/callbacks/sshkey.html"><strong aria-hidden="true">13.4.11.</strong> SSH key</a></li><li class="chapter-item "><a href="../transfers/callbacks/rtsp.html"><strong aria-hidden="true">13.4.12.</strong> RTSP interleaved data</a></li><li class="chapter-item "><a href="../transfers/callbacks/ftpmatch.html"><strong aria-hidden="true">13.4.13.</strong> FTP wildcard matching</a></li><li class="chapter-item "><a href="../transfers/callbacks/resolver.html"><strong aria-hidden="true">13.4.14.</strong> Resolver start</a></li><li class="chapter-item "><a href="../transfers/callbacks/trailers.html"><strong aria-hidden="true">13.4.15.</strong> Sending trailers</a></li><li class="chapter-item "><a href="../transfers/callbacks/hsts.html"><strong aria-hidden="true">13.4.16.</strong> HSTS</a></li><li class="chapter-item "><a href="../transfers/callbacks/prereq.html"><strong aria-hidden="true">13.4.17.</strong> Prereq</a></li></ol></li><li class="chapter-item "><a href="../transfers/conn/index.html"><strong aria-hidden="true">13.5.</strong> Connection control</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../transfers/conn/how.html"><strong aria-hidden="true">13.5.1.</strong> How libcurl connects</a></li><li class="chapter-item "><a href="../transfers/conn/local.html"><strong aria-hidden="true">13.5.2.</strong> Local address and port number</a></li><li class="chapter-item "><a href="../transfers/conn/reuse.html"><strong aria-hidden="true">13.5.3.</strong> Connection reuse</a></li><li class="chapter-item "><a href="../transfers/conn/keepalive.html"><strong aria-hidden="true">13.5.4.</strong> Keep alive</a></li><li class="chapter-item "><a href="../transfers/conn/names.html"><strong aria-hidden="true">13.5.5.</strong> Name resolving</a></li><li class="chapter-item "><a href="../transfers/conn/proxies.html"><strong aria-hidden="true">13.5.6.</strong> Proxies</a></li></ol></li><li class="chapter-item "><a href="../transfers/control/index.html"><strong aria-hidden="true">13.6.</strong> Transfer control</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../transfers/control/stop.html"><strong aria-hidden="true">13.6.1.</strong> Stop</a></li><li class="chapter-item "><a href="../transfers/control/stopslow.html"><strong aria-hidden="true">13.6.2.</strong> Stop slow transfers</a></li><li class="chapter-item "><a href="../transfers/control/ratelimit.html"><strong aria-hidden="true">13.6.3.</strong> Rate limit</a></li><li class="chapter-item "><a href="../transfers/control/meter.html"><strong aria-hidden="true">13.6.4.</strong> Progress meter</a></li><li class="chapter-item "><a href="../transfers/control/progress-callback.html"><strong aria-hidden="true">13.6.5.</strong> Progress callback</a></li></ol></li><li class="chapter-item "><a href="../transfers/auth.html"><strong aria-hidden="true">13.7.</strong> Authentication</a></li><li class="chapter-item "><a href="../transfers/cleanup.html"><strong aria-hidden="true">13.8.</strong> Cleanup</a></li><li class="chapter-item "><a href="../transfers/getinfo.html"><strong aria-hidden="true">13.9.</strong> Post transfer info</a></li></ol></li><li class="chapter-item "><a href="../libcurl-http/index.html"><strong aria-hidden="true">14.</strong> libcurl HTTP</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../libcurl-http/responses.html"><strong aria-hidden="true">14.1.</strong> Responses</a></li><li class="chapter-item "><a href="../libcurl-http/requests.html"><strong aria-hidden="true">14.2.</strong> Requests</a></li><li class="chapter-item "><a href="../libcurl-http/versions.html"><strong aria-hidden="true">14.3.</strong> Versions</a></li><li class="chapter-item "><a href="../libcurl-http/ranges.html"><strong aria-hidden="true">14.4.</strong> Ranges</a></li><li class="chapter-item "><a href="../libcurl-http/auth.html"><strong aria-hidden="true">14.5.</strong> Authentication</a></li><li class="chapter-item "><a href="../libcurl-http/cookies.html"><strong aria-hidden="true">14.6.</strong> Cookies</a></li><li class="chapter-item "><a href="../libcurl-http/download.html"><strong aria-hidden="true">14.7.</strong> Download</a></li><li class="chapter-item "><a href="../libcurl-http/upload.html"><strong aria-hidden="true">14.8.</strong> Upload</a></li><li class="chapter-item "><a href="../libcurl-http/multiplexing.html"><strong aria-hidden="true">14.9.</strong> Multiplexing</a></li><li class="chapter-item "><a href="../libcurl-http/hsts.html"><strong aria-hidden="true">14.10.</strong> HSTS</a></li><li class="chapter-item "><a href="../libcurl-http/alt-svc.html"><strong aria-hidden="true">14.11.</strong> alt-svc</a></li></ol></li><li class="chapter-item "><a href="../helpers/index.html"><strong aria-hidden="true">15.</strong> libcurl helpers</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../helpers/sharing.html"><strong aria-hidden="true">15.1.</strong> Share data between handles</a></li><li class="chapter-item "><a href="../helpers/url/index.html"><strong aria-hidden="true">15.2.</strong> URL API</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../helpers/url/include.html"><strong aria-hidden="true">15.2.1.</strong> Include files</a></li><li class="chapter-item "><a href="../helpers/url/init.html"><strong aria-hidden="true">15.2.2.</strong> Create, cleanup, duplicate</a></li><li class="chapter-item "><a href="../helpers/url/parse.html"><strong aria-hidden="true">15.2.3.</strong> Parse a URL</a></li><li class="chapter-item "><a href="../helpers/url/redirect.html"><strong aria-hidden="true">15.2.4.</strong> Redirect to URL</a></li><li class="chapter-item "><a href="../helpers/url/get.html"><strong aria-hidden="true">15.2.5.</strong> Get a URL</a></li><li class="chapter-item "><a href="../helpers/url/get-part.html"><strong aria-hidden="true">15.2.6.</strong> Get URL parts</a></li><li class="chapter-item "><a href="../helpers/url/set-part.html"><strong aria-hidden="true">15.2.7.</strong> Set URL parts</a></li><li class="chapter-item "><a href="../helpers/url/append-query.html"><strong aria-hidden="true">15.2.8.</strong> Append to the query</a></li><li class="chapter-item "><a href="../helpers/url/setopt.html"><strong aria-hidden="true">15.2.9.</strong> CURLOPT_CURLU</a></li></ol></li><li class="chapter-item "><a href="../helpers/ws/index.html"><strong aria-hidden="true">15.3.</strong> WebSocket</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../helpers/ws/support.html"><strong aria-hidden="true">15.3.1.</strong> Support</a></li><li class="chapter-item "><a href="../helpers/ws/urls.html"><strong aria-hidden="true">15.3.2.</strong> URLs</a></li><li class="chapter-item "><a href="../helpers/ws/concept.html"><strong aria-hidden="true">15.3.3.</strong> Concept</a></li><li class="chapter-item "><a href="../helpers/ws/options.html"><strong aria-hidden="true">15.3.4.</strong> Options</a></li><li class="chapter-item "><a href="../helpers/ws/read.html"><strong aria-hidden="true">15.3.5.</strong> Read</a></li><li class="chapter-item "><a href="../helpers/ws/meta.html"><strong aria-hidden="true">15.3.6.</strong> Meta</a></li><li class="chapter-item "><a href="../helpers/ws/write.html"><strong aria-hidden="true">15.3.7.</strong> Write</a></li></ol></li><li class="chapter-item "><a href="../helpers/headerapi/index.html"><strong aria-hidden="true">15.4.</strong> Headers API</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../helpers/headerapi/struct.html"><strong aria-hidden="true">15.4.1.</strong> Header struct</a></li><li class="chapter-item "><a href="../helpers/headerapi/get.html"><strong aria-hidden="true">15.4.2.</strong> Get a header</a></li><li class="chapter-item "><a href="../helpers/headerapi/iterate.html"><strong aria-hidden="true">15.4.3.</strong> Iterate over headers</a></li></ol></li></ol></li><li class="chapter-item "><a href="../examples/index.html"><strong aria-hidden="true">16.</strong> libcurl examples</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../examples/get.html"><strong aria-hidden="true">16.1.</strong> Get a simple HTTP page</a></li><li class="chapter-item "><a href="../examples/getinmem.html"><strong aria-hidden="true">16.2.</strong> Get a response into memory</a></li><li class="chapter-item "><a href="../examples/login.html"><strong aria-hidden="true">16.3.</strong> Submit a login form over HTTP</a></li><li class="chapter-item "><a href="../examples/ftplist.html"><strong aria-hidden="true">16.4.</strong> Get an FTP directory listing</a></li><li class="chapter-item "><a href="../examples/http-ul-nonblock.html"><strong aria-hidden="true">16.5.</strong> Non-blocking HTTP form-post</a></li></ol></li><li class="chapter-item "><a href="../bindings/index.html"><strong aria-hidden="true">17.</strong> libcurl bindings</a></li><li class="chapter-item expanded "><a href="../internals/index.html"><strong aria-hidden="true">18.</strong> libcurl internals</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../internals/easy.html"><strong aria-hidden="true">18.1.</strong> Easy handles and connections</a></li><li class="chapter-item "><a href="../internals/multi.html"><strong aria-hidden="true">18.2.</strong> Everything is multi</a></li><li class="chapter-item "><a href="../internals/statemachines.html"><strong aria-hidden="true">18.3.</strong> State machines</a></li><li class="chapter-item "><a href="../internals/handler.html"><strong aria-hidden="true">18.4.</strong> Protocol handler</a></li><li class="chapter-item "><a href="../internals/backends.html"><strong aria-hidden="true">18.5.</strong> Backends</a></li><li class="chapter-item "><a href="../internals/caches.html"><strong aria-hidden="true">18.6.</strong> Caches and state</a></li><li class="chapter-item "><a href="../internals/timeouts.html"><strong aria-hidden="true">18.7.</strong> Timeouts</a></li><li class="chapter-item "><a href="../internals/windows-vs-unix.html"><strong aria-hidden="true">18.8.</strong> Windows vs Unix</a></li><li class="chapter-item "><a href="../internals/memory-debugging.html"><strong aria-hidden="true">18.9.</strong> Memory debugging</a></li><li class="chapter-item "><a href="../internals/content-encoding.html"><strong aria-hidden="true">18.10.</strong> Content Encoding</a></li><li class="chapter-item expanded "><a href="../internals/structs.html" class="active"><strong aria-hidden="true">18.11.</strong> Structs</a></li><li class="chapter-item "><a href="../internals/resolving.html"><strong aria-hidden="true">18.12.</strong> Resolving hostnames</a></li><li class="chapter-item "><a href="../internals/tests/index.html"><strong aria-hidden="true">18.13.</strong> Tests</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../internals/tests/file-format.html"><strong aria-hidden="true">18.13.1.</strong> Test file format</a></li><li class="chapter-item "><a href="../internals/tests/build.html"><strong aria-hidden="true">18.13.2.</strong> Build tests</a></li><li class="chapter-item "><a href="../internals/tests/run.html"><strong aria-hidden="true">18.13.3.</strong> Run tests</a></li><li class="chapter-item "><a href="../internals/tests/debug.html"><strong aria-hidden="true">18.13.4.</strong> Debug builds</a></li><li class="chapter-item "><a href="../internals/tests/servers.html"><strong aria-hidden="true">18.13.5.</strong> Test servers</a></li><li class="chapter-item "><a href="../internals/tests/curl.html"><strong aria-hidden="true">18.13.6.</strong> curl tests</a></li><li class="chapter-item "><a href="../internals/tests/libcurl.html"><strong aria-hidden="true">18.13.7.</strong> libcurl tests</a></li><li class="chapter-item "><a href="../internals/tests/unit.html"><strong aria-hidden="true">18.13.8.</strong> Unit tests</a></li><li class="chapter-item "><a href="../internals/tests/valgrind.html"><strong aria-hidden="true">18.13.9.</strong> Valgrind</a></li><li class="chapter-item "><a href="../internals/tests/ci.html"><strong aria-hidden="true">18.13.10.</strong> Continuous Integration</a></li><li class="chapter-item "><a href="../internals/tests/autobuilds.html"><strong aria-hidden="true">18.13.11.</strong> Autobuilds</a></li><li class="chapter-item "><a href="../internals/tests/torture.html"><strong aria-hidden="true">18.13.12.</strong> Torture</a></li></ol></li></ol></li><li class="chapter-item "><a href="../bookindex.html"><strong aria-hidden="true">19.</strong> Index</a></li></ol> </div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"> <div class="sidebar-resize-indicator"></div> </div> </nav> <!-- Track and set sidebar scroll position --> <script> var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox'); sidebarScrollbox.addEventListener('click', function(e) { if (e.target.tagName === 'A') { sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop); } }, { passive: true }); var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll'); sessionStorage.removeItem('sidebar-scroll'); if (sidebarScrollTop) { // preserve sidebar scroll position when navigating via links within sidebar sidebarScrollbox.scrollTop = sidebarScrollTop; } else { // scroll sidebar to current active section when navigating via "next/previous chapter" buttons var activeSection = document.querySelector('#sidebar .active'); if (activeSection) { activeSection.scrollIntoView({ block: 'center' }); } } </script> <div id="page-wrapper" class="page-wrapper"> <div class="page"> <div id="menu-bar-hover-placeholder"></div> <div id="menu-bar" class="menu-bar sticky"> <div class="left-buttons"> <label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar"> <i class="fa fa-bars"></i> </label> <button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list"> <i class="fa fa-paint-brush"></i> </button> <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu"> <li role="none"><button role="menuitem" class="theme" id="light">Light</button></li> <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li> <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li> <li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li> <li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li> </ul> <button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar"> <i class="fa fa-search"></i> </button> </div> <h1 class="menu-title">everything curl</h1> <div class="right-buttons"> <a href="../print.html" title="Print this book" aria-label="Print this book"> <i id="print-button" class="fa fa-print"></i> </a> </div> </div> <div id="search-wrapper" class="hidden"> <form id="searchbar-outer" class="searchbar-outer"> <input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header"> </form> <div id="searchresults-outer" class="searchresults-outer hidden"> <div id="searchresults-header" class="searchresults-header"></div> <ul id="searchresults"> </ul> </div> </div> <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM --> <script> document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible'); document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible'); Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) { link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1); }); </script> <div id="content" class="content"> <main> <h1 id="structs"><a class="header" href="#structs">Structs</a></h1> <p>This section documents internal structs. Since they are truly internal, we change them occasionally which might make this section slightly out of date at times.</p> <h2 id="curl_easy"><a class="header" href="#curl_easy">Curl_easy</a></h2> <p>The <code>Curl_easy</code> struct is the one returned to the outside in the external API as an opaque <code>CURL *</code>. This pointer is usually known as an easy handle in API documentations and examples.</p> <p>Information and state that is related to the actual connection is in the <code>connectdata</code> struct. When a transfer is about to be made, libcurl either creates a new connection or re-uses an existing one. The current connectdata that is used by this handle is pointed out by <code>Curl_easy->conn</code>.</p> <p>Data and information that regard this particular single transfer is put in the <code>SingleRequest</code> sub-struct.</p> <p>When the <code>Curl_easy</code> struct is added to a multi handle, as it must be in order to do any transfer, the <code>->multi</code> member points to the <code>Curl_multi</code> struct it belongs to. The <code>->prev</code> and <code>->next</code> members are then used by the multi code to keep a linked list of <code>Curl_easy</code> structs that are added to that same multi handle. libcurl always uses multi so <code>->multi</code> points to a <code>Curl_multi</code> when a transfer is in progress.</p> <p><code>->mstate</code> is the multi state of this particular <code>Curl_easy</code>. When <code>multi_runsingle()</code> is called, it acts on this handle according to which state it is in. The mstate is also what tells which sockets to return for a specific <code>Curl_easy</code> when [<code>curl_multi_fdset()</code>][12] is called etc.</p> <p>The libcurl source code generally use the name <code>data</code> everywhere for the local variable that points to the <code>Curl_easy</code> struct.</p> <p>When doing multiplexed HTTP/2 transfers, each <code>Curl_easy</code> is associated with an individual stream, sharing the same connectdata struct. Multiplexing makes it even more important to keep things associated with the right thing.</p> <h2 id="connectdata"><a class="header" href="#connectdata">connectdata</a></h2> <p>A general idea in libcurl is to keep connections around in a connection cache after they have been used in case they are used again and then re-use an existing one instead of creating a new one as it creates a significant performance boost.</p> <p>Each <code>connectdata</code> struct identifies a single physical connection to a server. If the connection cannot be kept alive, the connection is closed after use and then this struct can be removed from the cache and freed.</p> <p>Thus, the same <code>Curl_easy</code> can be used multiple times and each time select another <code>connectdata</code> struct to use for the connection. Keep this in mind, as it is then important to consider if options or choices are based on the connection or the <code>Curl_easy</code>.</p> <p>As a special complexity, some protocols supported by libcurl require a special disconnect procedure that is more than just shutting down the socket. It can involve sending one or more commands to the server before doing so. Since connections are kept in the connection cache after use, the original <code>Curl_easy</code> may no longer be around when the time comes to shut down a particular connection. For this purpose, libcurl holds a special dummy <code>closure_handle</code> <code>Curl_easy</code> in the <code>Curl_multi</code> struct to use when needed.</p> <p>FTP uses two TCP connections for a typical transfer but it keeps both in this single struct and thus can be considered a single connection for most internal concerns.</p> <p>The libcurl source code generally uses the name <code>conn</code> for the local variable that points to the connectdata.</p> <h2 id="curl_multi"><a class="header" href="#curl_multi">Curl_multi</a></h2> <p>Internally, the easy interface is implemented as a wrapper around multi interface functions. This makes everything multi interface.</p> <p><code>Curl_multi</code> is the multi handle struct exposed as the opaque <code>CURLM *</code> in external APIs.</p> <p>This struct holds a list of <code>Curl_easy</code> structs that have been added to this handle with [<code>curl_multi_add_handle()</code>][13]. The start of the list is <code>->easyp</code> and <code>->num_easy</code> is a counter of added <code>Curl_easy</code>s.</p> <p><code>->msglist</code> is a linked list of messages to send back when [<code>curl_multi_info_read()</code>][14] is called. Basically a node is added to that list when an individual <code>Curl_easy</code>'s transfer has completed.</p> <p><code>->hostcache</code> points to the name cache. It is a hash table for looking up name to IP. The nodes have a limited lifetime in there and this cache is meant to reduce the time for when the same name is wanted within a short period of time.</p> <p><code>->timetree</code> points to a tree of <code>Curl_easy</code>s, sorted by the remaining time until it should be checked - normally some sort of timeout. Each <code>Curl_easy</code> has one node in the tree.</p> <p><code>->sockhash</code> is a hash table to allow fast lookups of socket descriptor for which <code>Curl_easy</code> uses that descriptor. This is necessary for the <code>multi_socket</code> API.</p> <p><code>->conn_cache</code> points to the connection cache. It keeps track of all connections that are kept after use. The cache has a maximum size.</p> <p><code>->closure_handle</code> is described in the <code>connectdata</code> section.</p> <p>The libcurl source code generally uses the name <code>multi</code> for the variable that points to the <code>Curl_multi</code> struct.</p> <h2 id="curl_handler"><a class="header" href="#curl_handler">Curl_handler</a></h2> <p>Each unique protocol that is supported by libcurl needs to provide at least one <code>Curl_handler</code> struct. It defines what the protocol is called and what functions the main code should call to deal with protocol specific issues. In general, there is a source file named <code>[protocol].c</code> in which there is a <code>struct Curl_handler Curl_handler_[protocol]</code> declared. In <code>url.c</code> there is then the main array with all individual <code>Curl_handler</code> structs pointed to from a single array which is scanned through when a URL is given to libcurl to work with.</p> <p>The concrete function pointer prototypes can be found in <code>lib/urldata.h</code>.</p> <ul> <li> <p><code>->scheme</code> is the URL scheme name, usually spelled out in uppercase. That is HTTP or FTP etc. SSL versions of the protocol need their own <code>Curl_handler</code> setup so HTTPS separate from HTTP.</p> </li> <li> <p><code>->setup_connection</code> is called to allow the protocol code to allocate protocol specific data that then gets associated with that <code>Curl_easy</code> for the rest of this transfer. It gets freed again at the end of the transfer. It gets called before the <code>connectdata</code> for the transfer has been selected/created. Most protocols allocate its private <code>struct [PROTOCOL]</code> here and assign <code>Curl_easy->req.p.[protocol]</code> to it.</p> </li> <li> <p><code>->connect_it</code> allows a protocol to do some specific actions after the TCP connect is done, that can still be considered part of the connection phase. Some protocols alter the <code>connectdata->recv[]</code> and <code>connectdata->send[]</code> function pointers in this function.</p> </li> <li> <p><code>->connecting</code> is similarly a function that keeps getting called as long as the protocol considers itself still in the connecting phase.</p> </li> <li> <p><code>->do_it</code> is the function called to issue the transfer request. What we call the DO action internally. If the DO is not enough and things need to be kept getting done for the entire DO sequence to complete, <code>->doing</code> is then usually also provided. Each protocol that needs to do multiple commands or similar for do/doing needs to implement their own state machines (see SCP, SFTP, FTP). Some protocols (only FTP and only due to historical reasons) have a separate piece of the DO state called <code>DO_MORE</code>.</p> </li> <li> <p><code>->doing</code> keeps getting called while issuing the transfer request command(s)</p> </li> <li> <p><code>->done</code> gets called when the transfer is complete and DONE. That is after the main data has been transferred.</p> </li> <li> <p><code>->do_more</code> gets called during the <code>DO_MORE</code> state. The FTP protocol uses this state when setting up the second connection.</p> </li> <li> <p><code>->proto_getsock</code>, <code>->doing_getsock</code>, <code>->domore_getsock</code>, <code>->perform_getsock</code> Functions that return socket information. Which socket(s) to wait for which I/O action(s) during the particular multi state.</p> </li> <li> <p><code>->disconnect</code> is called immediately before the TCP connection is shutdown.</p> </li> <li> <p><code>->readwrite</code> gets called during transfer to allow the protocol to do extra reads/writes</p> </li> <li> <p><code>->attach</code> attaches a transfer to the connection.</p> </li> <li> <p><code>->defport</code> is the default report TCP or UDP port this protocol uses</p> </li> <li> <p><code>->protocol</code> is one or more bits in the <code>CURLPROTO_*</code> set. The SSL versions have their base protocol set and then the SSL variation. Like <code>HTTP|HTTPS</code>.</p> </li> <li> <p><code>->flags</code> is a bitmask with additional information about the protocol that makes it get treated differently by the generic engine:</p> <ul> <li><code>PROTOPT_SSL</code> - makes it connect and negotiate SSL</li> <li><code>PROTOPT_DUAL</code> - this protocol uses two connections</li> <li><code>PROTOPT_CLOSEACTION</code> - this protocol has actions to do before closing the connection. This flag is no longer used by code, yet still set for a bunch of protocol handlers.</li> <li><code>PROTOPT_DIRLOCK</code> - direction lock. The SSH protocols set this bit to limit which direction of socket actions that the main engine concerns itself with.</li> <li><code>PROTOPT_NONETWORK</code> - a protocol that does not use the network (read <code>file:</code>)</li> <li><code>PROTOPT_NEEDSPWD</code> - this protocol needs a password and uses a default one unless one is provided</li> <li><code>PROTOPT_NOURLQUERY</code> - this protocol cannot handle a query part on the URL (?foo=bar)</li> </ul> </li> </ul> <h2 id="conncache"><a class="header" href="#conncache">conncache</a></h2> <p>Is a hash table with connections for later re-use. Each <code>Curl_easy</code> has a pointer to its connection cache. Each multi handle sets up a connection cache that all added <code>Curl_easy</code>s share by default.</p> <h2 id="curl_share"><a class="header" href="#curl_share">Curl_share</a></h2> <p>The libcurl share API allocates a <code>Curl_share</code> struct, exposed to the external API as <code>CURLSH *</code>.</p> <p>The idea is that the struct can have a set of its own versions of caches and pools and then by providing this struct in the <code>CURLOPT_SHARE</code> option, those specific <code>Curl_easy</code>s use the caches/pools that this share handle holds.</p> <p>Then individual <code>Curl_easy</code> structs can be made to share specific things that they otherwise would not, such as cookies.</p> <p>The <code>Curl_share</code> struct can currently hold cookies, DNS cache and the SSL session cache.</p> <h2 id="cookieinfo"><a class="header" href="#cookieinfo">CookieInfo</a></h2> <p>This is the main cookie struct. It holds all known cookies and related information. Each <code>Curl_easy</code> has its own private <code>CookieInfo</code> even when they are added to a multi handle. They can be made to share cookies by using the share API.</p> </main> <nav class="nav-wrapper" aria-label="Page navigation"> <!-- Mobile navigation buttons --> <a rel="prev" href="../internals/content-encoding.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left"> <i class="fa fa-angle-left"></i> </a> <a rel="next prefetch" href="../internals/resolving.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right"> <i class="fa fa-angle-right"></i> </a> <div style="clear: both"></div> </nav> </div> </div> <nav class="nav-wide-wrapper" aria-label="Page navigation"> <a rel="prev" href="../internals/content-encoding.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left"> <i class="fa fa-angle-left"></i> </a> <a rel="next prefetch" href="../internals/resolving.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right"> <i class="fa fa-angle-right"></i> </a> </nav> </div> <script> window.playground_copyable = true; </script> <script src="../elasticlunr.min.js"></script> <script src="../mark.min.js"></script> <script src="../searcher.js"></script> <script src="../clipboard.min.js"></script> <script src="../highlight.js"></script> <script src="../book.js"></script> <!-- Custom JS scripts --> </div> </body> </html>