lighttpd base.h 代码阅读笔记 (不断完善中。。。)
2010-06-18 21:28
337 查看
sock_addr : union , 此联合是一个能处理IPV4和IPV6和UNIX域套接字的结构。类似于 struct sockaddr 结构体。一般此联合用于存储连接双方的IP地址。
request : typedef struct {…} request , lighttpd存储远程请求的结构体。在一个请求处理完成之前些结构体一直存活,生命周期是在一次请求。此结构体放在下面要说明的 server结构中。结构体成员说明:
[code type="c"]
typedef struct {
/** HEADER */
/* the request-line */
buffer *request; //请求原始数据缓冲区
buffer *uri; //请求地址:
buffer *orig_uri; //这与上面的地址的区别是什么呢?大多数时候都相同。在什么时候不相同呢?
http_method_t http_method; //请求方法:为 GET POST , HEAD
http_version_t http_version; //请求版本:1.0 , 1.1
buffer *request_line; //指的是request头信息中的第一行,GET /path/xxx.html HTTP/1.1这行。
/* strings to the header */
buffer *http_host; /* not alloced */
const char *http_range;
const char *http_content_type;
const char *http_if_modified_since;
const char *http_if_none_match;
array *headers; //这个我猜着应该是把request的缓冲区块分割为多行了吧
/* CONTENT */
size_t content_length; /* returned by strtoul() */ //这个是在POST方法时才有的吧。
/* internal representation */
int accept_encoding;
/* internal */
buffer *pathinfo; //URL重写信息
} request;
[/code]
request : typedef struct {…} request , lighttpd存储远程请求的结构体。在一个请求处理完成之前些结构体一直存活,生命周期是在一次请求。此结构体放在下面要说明的 server结构中。结构体成员说明:
[code type="c"]
typedef struct {
/** HEADER */
/* the request-line */
buffer *request; //请求原始数据缓冲区
buffer *uri; //请求地址:
buffer *orig_uri; //这与上面的地址的区别是什么呢?大多数时候都相同。在什么时候不相同呢?
http_method_t http_method; //请求方法:为 GET POST , HEAD
http_version_t http_version; //请求版本:1.0 , 1.1
buffer *request_line; //指的是request头信息中的第一行,GET /path/xxx.html HTTP/1.1这行。
/* strings to the header */
buffer *http_host; /* not alloced */
const char *http_range;
const char *http_content_type;
const char *http_if_modified_since;
const char *http_if_none_match;
array *headers; //这个我猜着应该是把request的缓冲区块分割为多行了吧
/* CONTENT */
size_t content_length; /* returned by strtoul() */ //这个是在POST方法时才有的吧。
/* internal representation */
int accept_encoding;
/* internal */
buffer *pathinfo; //URL重写信息
} request;
[/code]
相关文章推荐
- lighttpd base.h 代码阅读笔记 (不断完善中。。。)
- lighttpd代码阅读笔记(一) watcher-worker模式
- 视频编码SVC --- JSVM代码阅读笔记(三)
- Caffe代码阅读笔记(1)
- 梦断代码阅读笔记02
- fg代码阅读笔记1
- 梦断代码阅读笔记03
- 梦断代码--阅读笔记--软件工程
- arcgis server 9.2代码阅读笔记二:在页面上动态加载图层
- [置顶] Linux协议栈代码阅读笔记(二)网络接口的配置
- 代码大全第二版阅读笔记
- 阅读笔记&&实现代码_of_Python灰帽子(二)
- x264代码阅读笔记2
- 阅读笔记:《C#字符串和正则表达式参考手册》 1-4章部分代码
- IPVS代码阅读笔记(三):调度算法
- ffmpeg中的http协议相关代码阅读笔记
- 代码阅读技巧笔记
- 梦断代码阅读笔记一
- SD卡规范之一:PART 1 Physical Layer 阅读笔记【不断更新】
- Discuz!NT代码阅读笔记(6)--从全局看看:各个模块功能摘要(2)