Curl 20071208
Curl 20071208
curl.haxx.se
Daniel Stenberg 1
Agenda
● what's curl ● protocol
● history ● license
● what's libcurl ● bindings
● development ● alternatives
● ownership ● future
● users
Daniel Stenberg 2
Daniel Stenberg
● Professional developer since 1991
● Consultant since 1996
● Contactor Data since 2000
Daniel Stenberg 3
what's curl?
● command line tool
● get and send data using internet-
protocols specified as a URL
● FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP,
TELNET, DICT, LDAP, LDAPS and FILE
● “trust” the input
● unix-style (pipes, stdin/stdout, etc)
● shell front-end for libcurl
Daniel Stenberg 4
cURL began
● what if I would write my own little
program that would...
● httpget 1997 => urlget => curl 1998
● HTTP
● GOPHER
● FTP
● upload
Daniel Stenberg 5
curl command line
● curl http://curl.haxx.se/ -o storehere
● curl ftp://curl.haxx.se/ -o storehere
● curl https://curl.haxx.se/ -o storehere
● curl sftp://curl.haxx.se/ -u me:pwd -o storehere
● curl scp://curl.haxx.se/ -o storehere
● curl tftp://curl.haxx.se/ -o storehere
● curl -T uploadfile ftp://curl.haxx.se/tohere/
● curl -T uploadfile https://curl.haxx.se/tohere/
Daniel Stenberg 6
command line part 2
● 120 command line options!
● can be entered in a config file
● “man curl”
● curl -–manual
● pipes, files, stdin/stdout
Daniel Stenberg 7
libcurl began in 2000
● version 7
● API for other apps
● portable
● C
● PHP binding was early
Daniel Stenberg 8
what's libcurl?
● functions for getting and sending data, given as
URL for internet-related protocols
● written in C89 – for maximum portability, re-use,
bindings etc
● doesn't care about the content
● offers blocking and non-blocking API (push vs pull)
● “hide” protocol-details when possible
● high performance
● do well at c10k+
● use thirds party libs where applicable
Daniel Stenberg 9
why use libcurl?
● free, open and zero price
● thread-safe
● IPv6 compatible
● feature-rich
● well supported and maintained
● fast
● well documented
● portable
Daniel Stenberg 10
libcurl hello world
● Using libcurl is very simple!
int main(void)
{
CURL *curl;
CURLcode result;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://curl.haxx.se");
/* set more options here... */
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
return 0;
}
Daniel Stenberg 11
contributors
● I started
● many provide “drive-by” patches
● most contributors fix a single problem
● few want to know nor care for “the big
picture”
● a few sticks around, the core guys
● 10 persons have commit access
● ~600 named contributors so far
Daniel Stenberg 12
over the years
● steady development
● scratch-an-itch
Daniel Stenberg 13
my role
● Originator and project leader
● Spends roughly 2 hours/day
● Mostly mail support and patch reviewing
● Holding the wheel, saying what I like and
not and what's good or bad.
Daniel Stenberg 14
license
● started as GPL
● turned MPL oct 1998
● changed to MIT/MPL jan 2001
● changed to MIT sep 2002
● will not change license again, ever
Daniel Stenberg 15
who owns curl?
● Daniel Stenberg owns the copyright
● Daniel does > 90% of all commits
● Almost all larger/major changes were
done by D
● Assumes that people own or have rights
to their contributions
● Carefully attributes and gives credit to
contributors for their efforts
Daniel Stenberg 16
OS- and Linux- distros
● Linux: Red Hat, Fedora, Suse, Debian, Mandriva,
Ubuntu, Gentoo and many more
● Others: Mac OS X, IBM AIX, SGI IRIX, Sun Solaris,
FreeBSD, OpenBSD, NetBSD, UnixWare, HP-UX
● they don't tell us
● don't contribute in any particular extent
● “absorbs bug reports” for good and bad
● lagging behind terribly at times
● not always good at telling where things come from
(= they didn't create this thing)
Daniel Stenberg 17
commercial use
● license
● portability
● stability
● Adobe, Apple, CERN, Cisco, Google, F-
Secure, IBM, Linden Lab, MacAfee,
Polaroid, RSA Inc, SAS Institute, SEB,
Siemens, Sun, Symantec, Yahoo, etc
Daniel Stenberg 18
open source use
● GPL compatible
● Exists in “all” distros
● Well documented
● OpenOffice.org, git, Firefox3, Gnash,
gimp, libtorrent, Boinc, Xen, Gizmo,
metadl, curl-loader, grip, UnrealIRCd,
Aegis, Cmake, slapt-get, Xine, AlsaPlayer,
xmms2, EmBrowser, OpenVRML,
libcomprex and more
Daniel Stenberg 19
how many users?
● >1 million downloads per year
● distros offer their own packages
● comes on “bonus”-CDs
● comes with applications
● simply no way to measure
Daniel Stenberg 20
portability
● Solaris, NetBSD, FreeBSD, OpenBSD, Darwin, HPUX,
IRIX, AIX, Tru64, Linux, UnixWare, HURD, Windows,
Amiga, OS/2, BeOs, Mac OS X, Ultrix, QNX,
OpenVMS, RISC OS, Novell NetWare, DOS, MVS,
VxWorks, Windows CE, OS/400 ...
● Alpha, HP-PA, HP3000, MIPS, PowerPC, POWER,
SuperH4, Sparc, ARM, i386, ia64, m68k, s390, ...
● no other transfer-lib is even close
● autobuilds and tests
● still relies on users to report problems
Daniel Stenberg 21
test
● Test against requirement?
● Autobuilds
● CVS-daily snapshots
● ask on the mailing list
● no formal
● no unit-tests...
Daniel Stenberg 22
protocols
● HTTP, FTP, TELNET, TFTP, FILE, DICT
● HTTPS, FTPS – SSL-libraries (OpenSSL,
GnuTLS, NSS, yassl, oqssl, ...)
● LDAP – openldap
● SCP, SFTP – libssh2
● libcurl is standards compliant, but adjusts
to what common browsers do
Daniel Stenberg 23
community
● users / library mailing lists (100 / 300
mails/month in average)
● bugs, bugtracking
● new ideas
● design discussions
● post patches!
● bug and feature-request trackers
● everyone can join!
Daniel Stenberg 24
who pays?
● my family
● volunteers
● many use/fix bugs on paid work time or
for commercial projects
● a few companies have sponsored/paid
development of certain features etc
● The Swedish IIS fund 2005/2006
Daniel Stenberg 25
bindings
● Ada95, Basic, C, C++, Ch, Cocoa, D,
Dylan, Euphoria, Ferite, Gambas,
glib/GTK+, Java, Lisp, Lua, Mono, .NET,
Object-Pascal, Ocaml, Pascal, Perl, PHP,
Postgres, Python, R, Rexx, Ruby, Scheme,
S-Lang, Smalltalk, SPL, Tcl, Visual Basic,
Q, wxWidgets, XBLite, and more!
● all major environments covered
● maintained outside of the cURL project
Daniel Stenberg 26
libcurl alternatives
● C? libwww, neon, libsoup – not as
portable, less functions, fewer protocols
● language-specific ones are common, but
then too mostly not as feature-rich
● no idea about commercial ones, anyone?
Daniel Stenberg 27
curl vs wget
curl wget
● libcurl ● command line
● pipes ● recursive fetch
● return codes ● older
● single-shot ● much less developer
● many protocols activity
● more portable ● HTTP 1.0
● more SSL libraries ● GPL
● more HTTP auth
● GNU
● bidirectional
Daniel Stenberg 28
curl numbers, nov 2007
● number of curl releases: 102
● unique web site visitors/month: 110,000+
● web site mirrors: 43
● number of contributors: 600
● mails in user + library lists (jan-oct 2007)
5969
● mails written by Daniel: 1460
● comment ratio in code: 24%
● number of code lines: 68K - 110K
Daniel Stenberg 29
the future!
● faster and better
● more protocols
● greater control over details
● fewer irrelevant functions
● more and better tests
● used more widely
● depends on what people want and do
Daniel Stenberg 30
Questions?
visit us at
curl.haxx.se
Daniel Stenberg 31