Around emacs, linux, etc.
apache module中取post数据
一共使用三个函数
- ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK)
Apache里面说Setup the client to allow Apache to read the request body. 差不多意思就是初始化,第二个参数可以取以下三个值。- REQUEST_NO_BODY
意为如果request必须没有body,如果有就发一个413错误 - REQUEST_CHUNKED_ERROR
意为request必须不可为chunked,如果有就发一个411错误 - REQUEST_CHUNKED_DECHUNK
意思为如果chunked了,则dechunk。
对于我们要读取post的数据,只能取后面两个,而chunked则是对长连接的选项了,使用哪个视情况而定。
- REQUEST_NO_BODY
- ap_should_client_block(r)
检查是否有数据,对于chunked的话会发送一个100 continue的命令让客户端继续发送数据。 - ap_get_client_block(r, pBuff, size)
读取数据
| Print article | This entry was posted by Jay Xie on 2006/04/30 at 3:37 pm, and is filed under Apache. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
搜狐微博
新浪微博