资源简介
libghttp windows下移植,采用vs2010封装成库。带测试说明,带源码+库封装。
代码片段和文件信息
/*
* ghttp.c -- Implementation of the public interface to http functions
* Created: Christopher Blizzard 21-Aug-1998
*
* Copyright (C) 1998 Free Software Foundation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not write to the Free
* Software Foundation Inc. 675 Mass Ave Cambridge MA 02139 USA.
*/
#include
#include
#ifdef WIN32
#else
#include
#endif
#include “ghttp.h“
#include “http_uri.h“
#include “http_hdrs.h“
#include “http_trans.h“
#include “http_req.h“
#include “http_resp.h“
#include “http_date.h“
#include “http_global.h“
#include “http_base64.h“
struct _ghttp_request
{
http_uri *uri;
http_uri *proxy;
http_req *req;
http_resp *resp;
http_trans_conn *conn;
const char *errstr;
int connected;
ghttp_proc proc;
char *username;
char *password;
char *authtoken;
char *proxy_username;
char *proxy_password;
char *proxy_authtoken;
};
static const char *basic_header = “Basic “;
ghttp_request *
ghttp_request_new(void)
{
struct _ghttp_request *l_return = NULL;
/* create everything */
l_return = malloc(sizeof(struct _ghttp_request));
memset(l_return 0 sizeof(struct _ghttp_request));
l_return->uri = http_uri_new();
l_return->proxy = http_uri_new();
l_return->req = http_req_new();
l_return->resp = http_resp_new();
l_return->conn = http_trans_conn_new();
return l_return;
}
void
ghttp_request_destroy(ghttp_request *a_request)
{
if (!a_request)
return;
/* make sure that the socket was shut down. */
if (a_request->conn->sock >= 0)
{
close(a_request->conn->sock);
a_request->conn->sock = -1;
}
/* destroy everything else */
if (a_request->uri)
http_uri_destroy(a_request->uri);
if (a_request->proxy)
http_uri_destroy(a_request->proxy);
if (a_request->req)
http_req_destroy(a_request->req);
if (a_request->resp)
http_resp_destroy(a_request->resp);
if (a_request->conn)
http_trans_conn_destroy(a_request->conn);
/* destroy username info. */
if (a_request->username)
{
free(a_request->username);
a_request->username = NULL;
}
if (a_request->password)
{
free(a_request->password);
a_request->password = NULL;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 18444 2001-01-06 06:04 libghttp-1.0.9\aclocal.m4
文件 275 1999-05-05 21:25 libghttp-1.0.9\AUTHORS
文件 31101 2001-01-23 08:32 libghttp-1.0.9\ChangeLog
文件 33085 2001-01-06 06:04 libghttp-1.0.9\config.guess
文件 25243 2001-01-06 06:04 libghttp-1.0.9\config.sub
文件 71809 2001-01-06 06:04 libghttp-1.0.9\configure
文件 1060 2000-12-06 03:49 libghttp-1.0.9\configure.in
文件 17992 1999-12-12 22:40 libghttp-1.0.9\COPYING
文件 25265 1998-09-28 22:33 libghttp-1.0.9\COPYING.LIB
文件 7539 1999-08-26 21:05 libghttp-1.0.9\doc\ghttp.html
文件 19668 2016-12-10 19:25 libghttp-1.0.9\ghttp.c
文件 6126 2016-12-10 19:43 libghttp-1.0.9\ghttp.h
文件 204 2000-06-11 06:57 libghttp-1.0.9\ghttpConf.sh.in
文件 3492 1999-08-19 07:27 libghttp-1.0.9\ghttp_constants.h
文件 2792 1998-12-10 04:26 libghttp-1.0.9\http_ba
文件 1031 1998-11-21 00:37 libghttp-1.0.9\http_ba
文件 8601 2000-10-31 09:28 libghttp-1.0.9\http_date.c
文件 1053 1998-09-28 22:33 libghttp-1.0.9\http_date.h
文件 1217 1998-09-28 22:34 libghttp-1.0.9\http_global.h
文件 10096 2016-12-10 19:33 libghttp-1.0.9\http_hdrs.c
文件 2240 2000-12-06 03:49 libghttp-1.0.9\http_hdrs.h
文件 6540 2000-12-06 03:49 libghttp-1.0.9\http_req.c
文件 2180 1999-08-21 04:48 libghttp-1.0.9\http_req.h
文件 20683 2016-12-10 19:33 libghttp-1.0.9\http_resp.c
文件 2518 2001-01-23 08:32 libghttp-1.0.9\http_resp.h
文件 8988 2016-12-10 19:26 libghttp-1.0.9\http_trans.c
文件 2995 2016-12-10 19:07 libghttp-1.0.9\http_trans.h
文件 5678 2000-10-31 09:28 libghttp-1.0.9\http_uri.c
文件 1494 1999-03-03 11:11 libghttp-1.0.9\http_uri.h
文件 7831 1999-12-12 22:40 libghttp-1.0.9\INSTALL
............此处省略72个文件信息
相关资源
- Windows Kits
- gperf3.0.1 windows版
- Lua cjson.dll windows动态链接库
- windows下最好用的端口转发软件PassPo
- Windows日志清除及伪造工具
- tomcat-connectors-1.2.40-windows-x86_64-httpd-
-
Syba
seIQ 12.7 for Windows - windows 2008 DNS 与 Linux 同步
- MSComm_VS2010
- vs2010自动补齐双引号
- windows下fastboot工具
- 仿Windows计算器 Delphi
- SID Change 1.0 (支持所有windows系统)
- jansson windows 下使用的x64和x86的lib库
- 使用Windows实时扩展RTX的串口编程
- dx9_2d_demo_game directx9实现2D游戏例程
- IndentGuide VS2010 开始结束括号之间连线
- json vs2010
- win10缺失msvcr100d.dll文件 64位
- Windows操作系统 hansky butterfly从32位jd
- 关闭电脑显示器,同时锁定WINDOWS操作
- triangle编译的exe_dll_lib文件.zip
- windows下snort安装配置教程
- VS2010中文旗舰版(破解版).txt
- CtabSheet源代码
- socket编程_windows_linux_数据传输
- windows平台下socket编程之TCP
- windows evtsys_x64
- LabWindows CVI 3D graph控件编程
- 简单的windows任务管理器源代码
评论
共有 条评论