Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
separate piece of the DO state called `DO_MORE`.
->doing keeps getting called while issuing the transfer request command(s)
->done gets called when the transfer is complete and DONE. That's after the
main data has been transferred.
->do_more gets called during the `DO_MORE` state. The FTP protocol uses this
state when setting up the second connection.
->`proto_getsock`
->`doing_getsock`
->`domore_getsock`
->`perform_getsock`
Functions that return socket information. Which socket(s) to wait for which
action(s) during the particular multi state.
->disconnect is called immediately before the TCP connection is shutdown.
->readwrite gets called during transfer to allow the protocol to do extra
reads/writes
->defport is the default report TCP or UDP port this protocol uses
->protocol is one or more bits in the `CURLPROTO_*` set. The SSL versions
have their "base" protocol set and then the SSL variation. Like
"HTTP|HTTPS".
->flags is a bitmask with additional information about the protocol that will
make it get treated differently by the generic engine:
- `PROTOPT_SSL` - will make it connect and negotiate SSL
- `PROTOPT_DUAL` - this protocol uses two connections
- `PROTOPT_CLOSEACTION` - this protocol has actions to do before closing the
connection. This flag is no longer used by code, yet still set for a bunch
protocol handlers.
- `PROTOPT_DIRLOCK` - "direction lock". The SSH protocols set this bit to
limit which "direction" of socket actions that the main engine will
concern itself about.
- `PROTOPT_NONETWORK` - a protocol that doesn't use network (read file:)
- `PROTOPT_NEEDSPWD` - this protocol needs a password and will use a default
one unless one is provided
- `PROTOPT_NOURLQUERY` - this protocol can't handle a query part on the URL
(?foo=bar)
## conncache
Is a hash table with connections for later re-use. Each SessionHandle has
a pointer to its connection cache. Each multi handle sets up a connection
cache that all added SessionHandles share by default.
## Curl_share
The libcurl share API allocates a `Curl_share` struct, exposed to the
external API as "CURLSH *".
The idea is that the struct can have a set of own versions of caches and
pools and then by providing this struct in the `CURLOPT_SHARE` option, those
specific SessionHandles will use the caches/pools that this share handle
holds.
Then individual SessionHandle structs can be made to share specific things
that they otherwise wouldn't, such as cookies.
The `Curl_share` struct can currently hold cookies, DNS cache and the SSL
session cache.
## CookieInfo
This is the main cookie struct. It holds all known cookies and related
information. Each SessionHandle has its own private CookieInfo even when
they are added to a multi handle. They can be made to share cookies by using
the share API.
[1]: http://curl.haxx.se/libcurl/c/curl_easy_setopt.html
[2]: http://curl.haxx.se/libcurl/c/curl_easy_init.html
[3]: http://c-ares.haxx.se/
[4]: https://tools.ietf.org/html/rfc7230 "RFC 7230"
[5]: http://curl.haxx.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html
[6]: http://curl.haxx.se/docs/manpage.html#--compressed
[7]: http://curl.haxx.se/libcurl/c/curl_multi_socket_action.html
[8]: http://curl.haxx.se/libcurl/c/curl_multi_timeout.html
[9]: http://curl.haxx.se/libcurl/c/curl_multi_setopt.html
[10]: http://curl.haxx.se/libcurl/c/CURLMOPT_TIMERFUNCTION.html
[11]: http://curl.haxx.se/libcurl/c/curl_multi_perform.html
[12]: http://curl.haxx.se/libcurl/c/curl_multi_fdset.html
[13]: http://curl.haxx.se/libcurl/c/curl_multi_add_handle.html
[14]: http://curl.haxx.se/libcurl/c/curl_multi_info_read.html