91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

純C語言實現https的post和get,不依賴任何庫。支持window,linux等多平臺,因此get及post效率較高,可移植性很好。本次上傳的是vc6下的完整工程的壓縮包,解壓后可直接使用。若要在linux下編譯和運行,可按照壓縮包內Linux下編譯運行https的幫助文檔來操作。

資源截圖

代碼片段和文件信息

#include?“http.h“
#include?“http_parser.h“

#include?
#include?
#include?

#ifdef?WIN32
#include?
#ifdef?WINCE
#pragma?comment(?lib?“ws2.lib“)?
#else
#pragma?comment(?lib?“ws2_32.lib“)?
#endif
#else
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include??
#include?
#include?
#include?

#define?_strdup?strdup
#define?_stricmp?strcasecmp
#define?_strnicmp?strncasecmp

#endif


#if?FT_SUPPORT_HTTPS

#ifdef?USEOPENSSL

#include?
#include?

#else?
#include?“krypton.h“
#endif


#endif

const?int?kSelectRead =?1?<const?int?kSelectWrite =?1?<const?int?kSelectError =?1?<
#define?DEFAULT_USER_AGENT_STR?“User-Agent:?Mozilla/5.0?(Windows?NT?6.1;?WOW64;?rv:29.0)?Gecko/20100101?Firefox/29.0\r\n“
#define?CONNECT_STR?“Connection:?close\r\n“
#define?ACCEPT_STR?“Accept:?*/*\r\n“
#define?CONTENT_LENGTH_STR?“Content-Length“
#define?CONTENT_TYPE_STR?“Content-Type:application/x-www-form-urlencoded\r\n“
#define?CONTENT_DISPOSITION_STR?“Content-Disposition“
#define?CRLF?“\r\n“

enum?parser_statue_e?{?PARSERD_NONE?=?0?PARSERD_FIELD?PARSERD_VALUE?PARSERD_BODY?};

enum?proto_type_e?{?PROTO_HTTP?=?0?PROTO_HTTPS?};

#ifdef?WIN32
typedef?SOCKET?socket_t;
#define?HTTP_INVALID_SOCKET?INVALID_SOCKET
#define?HTTP_EINTR?WSAEINTR
#define?HTTP_EINPROGRESS?WSAEINPROGRESS
#define?HTTP_EWOULDBLOCK?WSAEWOULDBLOCK
#define?HTTP_EALREADY?WSAEALREADY
#else
typedef?int?socket_t;
#define?HTTP_INVALID_SOCKET?-1
#define?HTTP_EINTR?EINTR
#define?HTTP_EINPROGRESS?EINPROGRESS
#define?HTTP_EWOULDBLOCK?EWOULDBLOCK
#define?HTTP_EALREADY?EALREADY
#endif

#define?RECV_BUF_SIZE?4?*?1024

struct?ft_http_client_t
{
FILE*?pf;
char*?filename;
char*?body;
char*?redirect_url;
char*?header_field;
char*?header_value;

char*?user;
data_recv_cb_t?recv_cb;

unsigned?long?body_len;
unsigned?long?content_length;

enum?http_request_method_e?method;
enum?proto_type_e?proto_type;

unsigned?short?field_size;
unsigned?short?value_size;
unsigned?short?cur_field_size;
unsigned?short?cur_value_size;

#if?FT_SUPPORT_HTTPS
SSL_CTX?*ctx;
SSL?*ssl;
#endif

socket_t?fd;?
int?timeout;

short?status_code;
char?parser_statue;
char?error_code;
unsigned?cancel ??:?1;
unsigned?exit ??:?1;
unsigned?download?:?1;
unsigned?redirect?:?1;
};

#ifdef?WIN32
#define?socket_close?closesocket
#else
#define?socket_close?close
#endif

#define?free_member(member)?if((member))?{?free(member);?(member)?=?NULL;?}
#define?close_socket(fd)?if(fd?!=?HTTP_INVALID_SOCKET)?{?socket_close(fd);?fd?=?HTTP_INVALID_SOCKET;?}
#define?close_file(pf)?if

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????45287??2018-08-02?08:43??https\Debug\http.obj

?????文件??????77902??2018-08-02?08:43??https\Debug\http_parser.obj

?????文件?????225729??2018-08-02?08:43??https\Debug\krypton.obj

?????文件?????352324??2018-08-02?09:09??https\Debug\main.exe

?????文件?????304744??2018-08-02?09:09??https\Debug\main.ilk

?????文件???????4693??2018-08-02?09:09??https\Debug\main.obj

????I.A....????185200??2018-08-02?09:09??https\Debug\main.pch

?????文件?????828416??2018-08-02?09:09??https\Debug\main.pdb

?????文件??????50176??2018-08-02?09:09??https\Debug\vc60.idb

?????文件??????86016??2018-08-02?09:09??https\Debug\vc60.pdb

????I.A....?????22529??2018-07-26?09:03??https\http.c

????I.A....??????2221??2018-07-25?20:05??https\http.h

?????文件??????74049??2018-08-01?16:02??https\http_parser.c

?????文件??????13513??2018-08-01?16:01??https\http_parser.h

?????文件??????22141??2018-08-02?09:09??https\img.jpg

?????文件?????241070??2018-08-01?16:01??https\krypton.c

?????文件???????2908??2018-08-01?16:02??https\krypton.h

?????文件????????376??2018-08-02?09:17??https\Linux下編譯運行https幫助文檔.txt

?????文件????????944??2018-08-02?09:09??https\main.c

?????文件???????3749??2018-08-01?16:14??https\main.dsp

?????文件????????514??2018-08-01?16:14??https\main.dsw

?????文件?????115712??2018-08-02?09:09??https\main.ncb

?????文件??????49664??2018-08-02?09:09??https\main.opt

?????文件???????1196??2018-08-02?09:09??https\main.plg

?????目錄??????????0??2018-08-02?09:09??https\Debug

?????目錄??????????0??2019-12-24?14:15??https

-----------?---------??----------?-----??----

??????????????2711073????????????????????26


評論

共有 條評論