上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 70 下一页
摘要: HTTP包体的长度有可能非常大,不同业务可能对包体读取 处理不相同, 比如waf, 也许会读取body内容或者只是读取很少的前几十字节。所以根据不同业务特性,对http body 数据包处理方式不同,nginx核心本身不会主动读取请求体,这个工作是交给请求处理阶段的模块处理,ngx 里面目前提供了接 阅读全文
posted @ 2020-08-16 13:09 codestacklinuxer 阅读(673) 评论(0) 推荐(0)
摘要: 在处理完http的头部信息后 然后在 处理request-body信息ngx_http_process_request ngx_http_process_request_headers(ngx_http_process_request_header)头部行解析完毕后调用函数ngx_http_proc 阅读全文
posted @ 2020-08-11 23:03 codestacklinuxer 阅读(394) 评论(0) 推荐(0)
摘要: 简要而说:accept 到连接后 根据fd 构建一个connection 由于是 http ; 重新封装为http-connection;同时设置fd的读回调; 回调函数根据是否是https/http 进行区别 ngx_http_init_connection(ngx_connection_t *c 阅读全文
posted @ 2020-08-10 21:27 codestacklinuxer 阅读(232) 评论(0) 推荐(0)
摘要: 首先看下 连接池的获取以及释放 ngx_connection_t * ngx_get_connection(ngx_socket_t s, ngx_log_t *log) //从连接池中获取一个ngx_connection_t { ngx_uint_t instance; ngx_event_t * 阅读全文
posted @ 2020-08-10 00:23 codestacklinuxer 阅读(140) 评论(0) 推荐(0)
摘要: 尝试获取锁,如果获取了锁,那么还要将当前监听端口全部注册到当前worker进程的epoll当中去 获取失败就需要确保此时ls-fd 没有被 epoll 监听 ngx_int_t ngx_trylock_accept_mutex(ngx_cycle_t *cycle) { if (ngx_shmtx_ 阅读全文
posted @ 2020-08-09 23:41 codestacklinuxer 阅读(241) 评论(0) 推荐(0)
摘要: static void ngx_cache_manager_process_cycle(ngx_cycle_t *cycle, void *data) { /* * Set correct process type since closing listening Unix domain socket 阅读全文
posted @ 2020-08-09 18:41 codestacklinuxer 阅读(276) 评论(0) 推荐(0)
摘要: 网络设备一次能够传输的最大数据量就是MTU,即IP传递给网络设备的每一个数据包不能超过MTU个字节,IP层的分段和重组功能就是为了适配网络设备的MTU而存在的。从理论上来讲,TCP可以不关心MTU的限定,只需要按照自己的意愿随意的将数据包丢给IP,是否需要分段可以由IP透明的处理,但是由于TCP是可 阅读全文
posted @ 2020-08-07 21:06 codestacklinuxer 阅读(1379) 评论(0) 推荐(1)
摘要: http://www.cnhalo.net/2016/09/13/linux-gro/ GRO(Generic receive offload): 在napi poll里把小包封装成大包再递交给协议栈 LRO: GRO的硬件实现(通过网卡的RSC功能) http://lwn.net/Articles 阅读全文
posted @ 2020-08-07 21:05 codestacklinuxer 阅读(587) 评论(0) 推荐(0)
摘要: 1、connection 字段 2、accept 字段 3、user-agent 字段 4、host字段 等字段需要注意: HTTP事务的延时主要有以下:1).解析时延 DNS解析与DNS缓存 客户端首先需要根据URL确定Web服务器的IP地址和端口号,如果最近没有对URL中的主机名进行访问,通过D 阅读全文
posted @ 2020-08-05 23:04 codestacklinuxer 阅读(193) 评论(0) 推荐(0)
摘要: /* * Main IP Receive routine. */ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev) { const 阅读全文
posted @ 2020-08-05 20:01 codestacklinuxer 阅读(513) 评论(0) 推荐(0)
上一页 1 ··· 49 50 51 52 53 54 55 56 57 ··· 70 下一页