小桥流水
xiqiao1229 · 共 8 篇文章
Ningx代码研究(五)
关于subrequest 在 ngx_http_core_module 里面,我们可以看到一些subrequest的函数,根据evan miller 的文章,我们知道 subrequest是在主请求的基础上发起的子请求,subrequest返回的内容会被附加到自请求上面,他的实现方法就是调用 ngx_http_subrequest 函数,subrequest函数的圆形是 ngx_int_t ngx_http_subrequest(ngx_http_request_t *r, ngx_str_t *uri, ngx_str_t *args, ngx_http_request_t **psr, …
2010-11-08 10:07 · 应用技术 · 评论(0)
Ningx代码研究(四)
虽然代码理解起来比较混乱,但是使用还是比较简单的,常用的有创建 hash 和在 hash 中进行查找两个操作,对于创建hash的操作,过程一般为: 构造一个 ngx_hash_key_t 为成员的数组, 包含 key, value 和 使用key计算出的一个hash值 构建一个 ngx_hash_init_t结构体的变量, 其中包含了ngx_hash_t 的成员, 为hash的结构体, 还包括一些其他初始设置,如bucket的大小,内存池等 调用 ngx_hash_init 传入 ngx_hash_init_t 结构, ngx_hash_key_t 的数组,和数组的长度, 进行初始化,这样 …
2010-11-08 10:05 · 评论(0)
Ningx代码研究(三)
ngx的基本容器 ngx_array 对应的文件为 core/ngx_array.{c|h} ngx_array是nginx内部封装的使用 ngx_pool_t对内存池进行分配的数组容器,其中的数据是在一整片内存区中连续存放的。更新数组时只能在尾部压入1个或多个元素。 数组的实现结构为 struct ngx_array_s { void *elts; ngx_uint_t nelts; size_t size; ngx_uint_t nalloc; ngx_pool_t *pool; }; 其中 elts 为具体的数据区域的指针, nelts 为数组实际包含的元素数量, size为数组单个元…
2010-11-08 10:01 · 应用技术 · 评论(0)
Ningx代码研究(二)
内存分配相关 系统功能封装 内存相关的操作主要在 os/unix/ngx_alloc.{h,c} 和 core/ngx_palloc.{h,c} 下 其中 os/unix/ngx_alloc.{h,c} 封装了最基本的内存分配函数,是对c原有的malloc/free/memalign 等原有的函数的封装,对应的函数为: ngx_alloc 使用malloc分配内存空间 ngx_calloc 使用malloc分配内存空间,并且将空间内容初始化为0 ngx_memalign 返回基于一个指定的alignment大小的数值为对齐基数的空间 ngx_free 对内存的释放操作 ngx的内存池 为了方…
2010-11-08 09:58 · 应用技术 · 评论(0)
Ningx代码研究(一)
Updated Aug 19, 2009 by RainX1982 NginxCodeReview Ningx代码研究. 概述 研究计划 参与人员 研究文档 学习emiller的文章 熟悉nginx的基本数据结构 nginx 代码的目录结构 nginx简单的数据类型的表示 nginx字符串的数据类型的表示 内存分配相关 系统功能封装 ngx的内存池 ngx的基本容器 ngx_array ngx_queue [ngx_h
2010-11-08 09:47 · 应用技术 · 评论(0)
Tutorial: install and use Java on the IPhone
With this tutorial you will be able to install Java on the IPhone, compile and run simple Java applications using IPhone. I decided to split this tutorial into two different ones. So here they are: Tutorial: install Java on the IPhone Tutorial: compile and run Java application on the IPhone Have fu…
2010-11-02 16:04 · 应用技术 · 评论(0)
Generate PDF files from Java applications dynamically
Many applications demand dynamic generation of PDF documents. Such applications range from banks generating customer statements for e-mail delivery to readers buying specific book chapters and receiving them in PDF format. The list is endless. In this article, we will use the iText Java library to …
2010-11-02 13:46 · 应用技术 · 评论(0)
MyEclipse 8.5 优化实例
第一步: 取消自动validation validation有一堆,什么xml、jsp、jsf、js等等,我们没有必要全部都去自动校验一下,只是需要的时候才会手工校验一下! 取消方法: windows–>perferences–>myeclipse–>validation 除开Manual下面的复选框全部选中之外,其他全部不选 手工验证方法: 在要验证的文件上,单击鼠标右键–>myeclipse–>run validation **第二步:**取消Eclipse拼写检查 1、拼写检查会给我们带来不少的麻烦,我们的方法命名都会是单词的缩写,他也会提示有错,所以最好去掉,没有多大的用处 wind…
2010-10-22 10:19 · 环境配置&优化 · 评论(0)