curl/curl
6 articles
Prerequisites
- ›Basic C programming (structs, pointers, function pointers)
- ›Familiarity with HTTP and general networking concepts
- ›Understanding of what curl does at the user level
Architecture Overview and Navigating the curl Codebase
A guided tour of curl's dual-product architecture, directory layout, core data structures, and the three architectural pillars that power every transfer.
The Multi State Machine — How Every Transfer Executes
Tracing a curl transfer's complete lifecycle through 16 states, from INIT to COMPLETED, revealing the single execution engine at the heart of libcurl.
Connection Filters — The Stackable I/O Architecture
Dissecting curl's connection filter system: composable, stackable I/O filters from TCP sockets through TLS to HTTP/2 multiplexing.
TLS Backends, DNS Resolution, and Connection Pooling
How curl abstracts 7+ TLS backends, three DNS resolver strategies, and a sophisticated connection pool behind clean vtable interfaces.
Protocol Handlers — From HTTP to MQTT
How curl's two-tier protocol handler design supports 28+ URI schemes through composable vtables, client reader/writer stacks, and dual-socket protocols.
The curl Command-Line Tool and the Test Suite
How the curl CLI translates 250+ options into libcurl API calls, and how 1978 test cases in a custom Perl harness validate the entire stack.