zoukankan      html  css  js  c++  java
  • NGINX----源码阅读---数据结构---配置文件相关

    1 typedef struct {
    2     ngx_file_t            file;
    3     ngx_buf_t            *buffer;
    4     ngx_buf_t            *dump;
    5     ngx_uint_t            line;
    6 } ngx_conf_file_t;

    core/ngx_conf_file.h

    buffer:配置文件缓存,在配置文件解析时提供缓存作用。

    dump:

    line:当前配置文件解析的行数

    file:配置文件的相关信息:

    core/ngx_file.h

    struct ngx_file_s {
        //nginx文件基础结构
        ngx_fd_t                   fd;
        ngx_str_t                  name;  //文件名称
        ngx_file_info_t            info;   //文件信息
    
        off_t                      offset;      //当前文件读写位置
        off_t                      sys_offset;
    
        ngx_log_t                 *log;     //文件日志
    
    #if (NGX_THREADS)
        ngx_int_t                (*thread_handler)(ngx_thread_task_t *task,
                                                   ngx_file_t *file);
        void                      *thread_ctx;
        ngx_thread_task_t         *thread_task;
    #endif
    
    #if (NGX_HAVE_FILE_AIO)
        ngx_event_aio_t           *aio;
    #endif
    
        unsigned                   valid_info:1;
        unsigned                   directio:1;
    };

    core/ngx_core.h

    typedef struct ngx_file_s        ngx_file_t;

    ngx_fd的数据结构如下:

    srcosunix gx_files.h

    typedef int                      ngx_fd_t;
    typedef struct stat              ngx_file_info_t;
  • 相关阅读:
    网络安全之常见攻击
    引入element-ui
    引入sass
    浏览器解析流程
    JDK8 HashMap--removeNode()移除节点方法
    JDK8 HashMap--treeify()树形化方法
    JDK1.8 HashMap--treeifyBin()方法
    二叉查找树ADT
    队列ADT

  • 原文地址:https://www.cnblogs.com/wangtengxiang/p/6445668.html
Copyright © 2011-2022 走看看