ngx_http_request_s

这篇具有很好参考价值的文章主要介绍了ngx_http_request_s。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

ngx_http_request_s,nginx,http,网络协议,网络

/* 
罗剑锋老师的注释参考:
https://github.com/chronolaw/annotated_nginx/blob/master/nginx/src/http/ngx_http_request.h
*/

struct ngx_http_request_s {
    uint32_t                          signature;         /* "HTTP" */

    ngx_connection_t                 *connection;

    void                            **ctx;
    void                            **main_conf;
    void                            **srv_conf;
    void                            **loc_conf;

    ngx_http_event_handler_pt         read_event_handler;
    ngx_http_event_handler_pt         write_event_handler;

#if (NGX_HTTP_CACHE)
    ngx_http_cache_t                 *cache;
#endif

    ngx_http_upstream_t              *upstream;
    ngx_array_t                      *upstream_states;
                                         /* of ngx_http_upstream_state_t */

    ngx_pool_t                       *pool;
    ngx_buf_t                        *header_in;

    ngx_http_headers_in_t             headers_in;
    ngx_http_headers_out_t            headers_out;

    ngx_http_request_body_t          *request_body;

    time_t                            lingering_time;
    time_t                            start_sec;
    ngx_msec_t                        start_msec;

    ngx_uint_t                        method;
    ngx_uint_t                        http_version;

    ngx_str_t                         request_line;
    ngx_str_t                         uri;
    ngx_str_t                         args;
    ngx_str_t                         exten;
    ngx_str_t                         unparsed_uri;

    ngx_str_t                         method_name;
    ngx_str_t                         http_protocol;
    ngx_str_t                         schema;

	ngx_str_t                         charset;
	ngx_str_t						  cookie_self;
	ngx_str_t						  user_name;

    ngx_chain_t                      *out;
    ngx_http_request_t               *main;
    ngx_http_request_t               *parent;
    ngx_http_postponed_request_t     *postponed;
    ngx_http_post_subrequest_t       *post_subrequest;
    ngx_http_posted_request_t        *posted_requests;

    ngx_int_t                         phase_handler;
    ngx_http_handler_pt               content_handler;
    ngx_uint_t                        access_code;

    ngx_http_variable_value_t        *variables;

#if (NGX_PCRE)
    ngx_uint_t                        ncaptures;
    int                              *captures;
    u_char                           *captures_data;
#endif

    size_t                            limit_rate;
    size_t                            limit_rate_after;

    /* used to learn the Apache compatible response length without a header */
    size_t                            header_size;

    off_t                             request_length;

    ngx_uint_t                        err_status;

    ngx_http_connection_t            *http_connection;
    ngx_http_v2_stream_t             *stream;

    ngx_http_log_handler_pt           log_handler;

    ngx_http_cleanup_t               *cleanup;

    unsigned                          count:16;
    unsigned                          subrequests:8;
    unsigned                          blocked:8;

    unsigned                          aio:1;

    unsigned                          http_state:4;

    /* URI with "/." and on Win32 with "//" */
    unsigned                          complex_uri:1;

    /* URI with "%" */
    unsigned                          quoted_uri:1;

    /* URI with "+" */
    unsigned                          plus_in_uri:1;

    /* URI with empty path */
    unsigned                          empty_path_in_uri:1;

    unsigned                          invalid_header:1;

    unsigned                          add_uri_to_alias:1;
    unsigned                          valid_location:1;
    unsigned                          valid_unparsed_uri:1;
    unsigned                          uri_changed:1;
    unsigned                          uri_changes:4;

    unsigned                          request_body_in_single_buf:1;
    unsigned                          request_body_in_file_only:1;
    unsigned                          request_body_in_persistent_file:1;
    unsigned                          request_body_in_clean_file:1;
    unsigned                          request_body_file_group_access:1;
    unsigned                          request_body_file_log_level:3;
    unsigned                          request_body_no_buffering:1;

    unsigned                          subrequest_in_memory:1;
    unsigned                          waited:1;

#if (NGX_HTTP_CACHE)
    unsigned                          cached:1;
#endif

#if (NGX_HTTP_GZIP)
    unsigned                          gzip_tested:1;
    unsigned                          gzip_ok:1;
    unsigned                          gzip_vary:1;
#endif

#if (NGX_PCRE)
    unsigned                          realloc_captures:1;
#endif

    unsigned                          proxy:1;
    unsigned                          bypass_cache:1;
    unsigned                          no_cache:1;

    /*
     * instead of using the request context data in
     * ngx_http_limit_conn_module and ngx_http_limit_req_module
     * we use the bit fields in the request structure
     */
    unsigned                          limit_conn_status:2;
    unsigned                          limit_req_status:3;

    unsigned                          limit_rate_set:1;
    unsigned                          limit_rate_after_set:1;

#if 0
    unsigned                          cacheable:1;
#endif

    unsigned                          pipeline:1;
    unsigned                          chunked:1;
    unsigned                          header_only:1;
    unsigned                          expect_trailers:1;
    unsigned                          keepalive:1;
    unsigned                          lingering_close:1;
    unsigned                          discard_body:1;
    unsigned                          reading_body:1;
    unsigned                          internal:1;
    unsigned                          error_page:1;
    unsigned                          filter_finalize:1;
    unsigned                          post_action:1;
    unsigned                          request_complete:1;
    unsigned                          request_output:1;
    unsigned                          header_sent:1;
    unsigned                          expect_tested:1;
    unsigned                          root_tested:1;
    unsigned                          done:1;
    unsigned                          logged:1;

    unsigned                          buffered:4;

    unsigned                          main_filter_need_in_memory:1;
    unsigned                          filter_need_in_memory:1;
    unsigned                          filter_need_temporary:1;
    unsigned                          preserve_body:1;
    unsigned                          allow_ranges:1;
    unsigned                          subrequest_ranges:1;
    unsigned                          single_range:1;
    unsigned                          disable_not_modified:1;
    unsigned                          stat_reading:1;
    unsigned                          stat_writing:1;
    unsigned                          stat_processing:1;

    unsigned                          background:1;
    unsigned                          health_check:1;

    /* used to parse HTTP headers */

    ngx_uint_t                        state;

    ngx_uint_t                        header_hash;
    ngx_uint_t                        lowcase_index;
    u_char                            lowcase_header[NGX_HTTP_LC_HEADER_LEN];

    u_char                           *header_name_start;
    u_char                           *header_name_end;
    u_char                           *header_start;
    u_char                           *header_end;

    /*
     * a memory that can be reused after parsing a request line
     * via ngx_http_ephemeral_t
     */

    u_char                           *uri_start;
    u_char                           *uri_end;
    u_char                           *uri_ext;
    u_char                           *args_start;
    u_char                           *request_start;
    u_char                           *request_end;
    u_char                           *method_end;
    u_char                           *schema_start;
    u_char                           *schema_end;
    u_char                           *host_start;
    u_char                           *host_end;
    u_char                           *port_start;
    u_char                           *port_end;

    unsigned                          http_minor:16;
    unsigned                          http_major:16;
};

ngx_http_headers_out_t 

/* 
罗剑锋老师的注释参考:
https://github.com/chronolaw/annotated_nginx/blob/master/nginx/src/http/ngx_http_request.h
*/

typedef struct {
    ngx_list_t                        headers;
    ngx_list_t                        trailers;

    ngx_uint_t                        status;
    ngx_str_t                         status_line;

    ngx_table_elt_t                  *server;
    ngx_table_elt_t                  *date;
    ngx_table_elt_t                  *content_length;
    ngx_table_elt_t                  *content_encoding;
    ngx_table_elt_t                  *location;
    ngx_table_elt_t                  *refresh;
    ngx_table_elt_t                  *last_modified;
    ngx_table_elt_t                  *content_range;
    ngx_table_elt_t                  *accept_ranges;
    ngx_table_elt_t                  *www_authenticate;
    ngx_table_elt_t                  *expires;
    ngx_table_elt_t                  *etag;

    ngx_str_t                        *override_charset;

    size_t                            content_type_len;
    ngx_str_t                         content_type;
    ngx_str_t                         charset;
    u_char                           *content_type_lowcase;
    ngx_uint_t                        content_type_hash;

    ngx_array_t                       cache_control;
    ngx_array_t                       link;

    off_t                             content_length_n;
    off_t                             content_offset;
    time_t                            date_time;
    time_t                            last_modified_time;
} ngx_http_headers_out_t;

ngx_list_t文章来源地址https://www.toymoban.com/news/detail-736607.html

typedef struct {
    ngx_list_part_t  *last;
    ngx_list_part_t   part;
    size_t            size;
    ngx_uint_t        nalloc;
    ngx_pool_t       *pool;
} ngx_list_t;

到了这里,关于ngx_http_request_s的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 云计算学习之路——Nginx基础监控—ngx_http_stub_status_module

    1、 Nginx基础监控 nginx作为web服务器以其高性能与抗并发能力被越来越多用户使用。nginx的ngx_http_stub_status_module模块提供了基本的监控功能。另外,若想要实现监控功能,也可以采用第三方软件Zabbix,可以实现进程和端口的监控,通过触发器的方式发送警告。但本文只先介绍

    2023年04月09日
    浏览(38)
  • 猫头虎分享已解决Bug || docker: Error response from daemon: Get https://registry-url/v2/: net/http: reque

    博主猫头虎的技术世界 🌟 欢迎来到猫头虎的博客 — 探索技术的无限可能! 专栏链接 : 🔗 精选专栏 : 《面试题大全》 — 面试准备的宝典! 《IDEA开发秘籍》 — 提升你的IDEA技能! 《100天精通鸿蒙》 — 从Web/安卓到鸿蒙大师! 《100天精通Golang(基础入门篇)》 — 踏入

    2024年02月19日
    浏览(55)
  • 猫头虎分享已解决Bug || docker: Error response from daemon: Get https://registry-url/v2/: net/http: reques

    博主猫头虎的技术世界 🌟 欢迎来到猫头虎的博客 — 探索技术的无限可能! 专栏链接 : 🔗 精选专栏 : 《面试题大全》 — 面试准备的宝典! 《IDEA开发秘籍》 — 提升你的IDEA技能! 《100天精通鸿蒙》 — 从Web/安卓到鸿蒙大师! 《100天精通Golang(基础入门篇)》 — 踏入

    2024年03月10日
    浏览(72)
  • nginx配置ssl的坑(TLSv1.3\ngx_http_ssl_module)

    查看openssl版本openssl version,一般腾讯云为1.0.2k版本。 到官网 www.openssl.org 查看最新版本openssl,现在最新为1.1.1h版。 下载nginx 重新make下nginx,最后openssl配置上面升级后的 完成后执行 make 命令,make失败执行 make clean后重新make 配置后的nginx.config 检查配置 nginx -t 启动nginx ./ngin

    2024年02月16日
    浏览(40)
  • nginx异常:the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx/conf

    待修改完善 - 仅备份 操作前必须先备份原有的nginx。 编译开始根据如下: 1.示例:nginx的安装目录是/usr/local/nginx,源码包在/root/nginx-1.10.1目录下。 2.切换到源码包: 3.进行编译: 4.配置完成后,运行命令: 5.make命令执行后,不要进行make install,否则会覆盖安装。 6.备份原有

    2024年02月05日
    浏览(47)
  • nginx配置SSL数字证书、报错nginx: [emerg] the “ssl“ parameter requires ngx_http_ssl_module in

    nginx一般默认安装目录是 /usr/local/nginx,请按自己实际安装目录操作 名称 命令 查看版本 /usr/local/nginx/sbin/nginx -v 启动服务 /usr/local/nginx/sbin/nginx 重启服务 /usr/local/nginx/sbin/nginx-s restart 停止服务 /usr/local/nginx/sbin/nginx -s stop 是否启动 ps -ef | grep nginx 强制结束 kill 进程ID (如:kil

    2024年02月15日
    浏览(55)
  • [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:35

    这个错误提示表明在Nginx配置文件(通常是nginx.conf)中使用了SSL(Secure Sockets Layer)相关的配置,但是Nginx没有加载相应的SSL模块。 1.检查Nginx是否编译了SSL模块: /usr/local/nginx/sbin/nginx -V 21 | grep --color=auto ssl /usr/local/nginx/sbin/nginx:安装nginx的绝对路径 输出以下结果 则为安装已

    2024年03月16日
    浏览(50)
  • Nginx: [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf

      出现上面标题中的问题是因为我当初在安装Nginx的时候没有安装SSL模块,但是现在我在Nginx配置文件(nginx.cnf)中配置了SSL的相关配置信息。当我再次启动Nginx的时候就提示我 nginx: [emerg] the \\\"ssl\\\" parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:111 了。下面我将我的解

    2024年02月07日
    浏览(38)
  • HTTP 请求走私漏洞(HTTP Request Smuggling)

            HTTP请求走私漏洞(HTTP Request Smuggling)是一种安全漏洞,利用了HTTP协议中请求和响应的解析和处理方式的不一致性。攻击者通过构造特定的恶意请求,以欺骗服务器和代理服务器,从而绕过安全机制,执行未经授权的操作。         HTTP请求走私漏洞通常涉及两

    2024年02月16日
    浏览(33)
  • 【Jmeter】HTTP请求(HTTP Request) - 配置基本HTTP请求

    右击 Thread (线程组) 鼠标移至 Add (添加) → Sampler (取样器) 点击 HTTP Rrequest (HTTP请求头) 即可完成HTTP请求新建 进入 HTTP Rrequest (HTTP请求头) 页面 输入 Protocol (传输协议类型) ,不输入默认为HTTP请求 输入 Server Name or IP (服务器或IP地址) 输入 Port Number (端口号),没有端口号则不输入

    2024年02月14日
    浏览(41)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包