libcurl-http发送数据流程
2021-05-13 04:27
标签:fill creat run version custom sts bsp sim set 源码目录 docs/example/httpcustomheader.c 添加自定义headers http-post.c 按字符串推送数据 simplepost.c 按长度推送数据 httpput.c 按文件推送 curl_easy_perform() easy_transfer() curl_multi_perform() multi_runsingle() CURLM_STATE_CONNECT Curl_connect() (url.c) create_conn() conn = allocate_conn(data); conn->recv[FIRSTSOCKET] = Curl_recv_plain; //默认发送接收数据 parseurlandfillconn() findprotocol() struct Curl_handler *p = Curl_builtin_scheme(protostr); conn->handler = conn->given = p; Curl_builtin_scheme() (url.c) 取出对应协议Curl_handler,包括连接,发送,接收处理等 static const struct Curl_handler * const protocols[] = { #ifndef CURL_DISABLE_HTTP #if defined(USE_SSL) && !defined(CURL_DISABLE_HTTP) CURLM_STATE_DO multi_do() conn->handler->do_it(conn, done); Curl_http() (http.c) Curl_add_bufferf(&req_buffer, //http 头数据发送 Curl_add_custom_headers() //添加自定义http头数据 if(data->set.postfields) { //按chunk,数据长度,文件推送数据 Curl_add_buffer_send() //发送数据 Curl_write() conn->send[] -> Curl_send_plain() *written = bytes_written; //保存已发送的数据 libcurl-http发送数据流程 标签:fill creat run version custom sts bsp sim set 原文地址:https://www.cnblogs.com/gluck-sw-life/p/12002772.html
conn->send[FIRSTSOCKET] = Curl_send_plain;
conn->recv[SECONDARYSOCKET] = Curl_recv_plain;
conn->send[SECONDARYSOCKET] = Curl_send_plain;
&Curl_handler_http,
#endif
&Curl_handler_https,
#endif
"%s" /* ftp typecode (;type=x) */
" HTTP/%s\r\n" /* HTTP version */
上一篇:js 实现前端导出execl
下一篇:HTML基础——表格的应用
文章标题:libcurl-http发送数据流程
文章链接:http://soscw.com/index.php/essay/84972.html