view src/http/ngx_http.h @ 0:4eff17414a43

nginx-0.0.1-2002-08-06-20:39:45 import The first code that uses "ngx_" prefix, the previous one used "gx_" prefix. At that point the code is not yet usable. The first draft ideas are dated back to 23.10.2001.
author Igor Sysoev <igor@sysoev.ru>
date Tue, 06 Aug 2002 16:39:45 +0000
parents
children d220029ac7f3
line wrap: on
line source

#ifndef _NGX_HTTP_H_INCLUDED_
#define _NGX_HTTP_H_INCLUDED_


#include <ngx_config.h>
#include <ngx_types.h>
#include <ngx_connection.h>


#define NGX_SYS_ERROR             -1
#define NGX_HTTP_INVALID_METHOD   -2
#define NGX_HTTP_INVALID_REQUEST  -3
#define NGX_HTTP_INVALID_HEADER   -4

#define NGX_HTTP_GET   1
#define NGX_HTTP_HEAD  2
#define NGX_HTTP_POST  3

#define NGX_HTTP_CONN_CLOSE       0
#define NGX_HTTP_CONN_KEEP_ALIVE  1

#define NGX_HTTP_OK               200


typedef struct {
    char *buff;
    char *pos;
    char *last;
    char *end;
} ngx_buff_t;

typedef struct {
    int     status;
    int     connection;
    size_t  content_length;
    char   *content_type;
    char   *charset;
    char   *etag;
    time_t  date;
    time_t  last_modified;
} ngx_http_header_out_t;

typedef struct ngx_http_request_s ngx_http_request_t;

struct ngx_http_request_s {
    int    method;

    int    http_version;
    int    http_major;
    int    http_minor;

    char  *uri;
    ngx_http_request_t *main;

    ngx_connection_t *connection;
    ngx_buff_t  *buff;
    ngx_pool_t  *pool;

    /* internal */
    unsigned  unusual_uri:1;
    unsigned  complex_uri:1;

    int    state;
    char  *uri_start;
    char  *uri_end;
    char  *uri_ext;
    char  *args_start;
    char  *header_name_start;
    char  *header_name_end;
    char  *header_start;
    char  *header_end;
#ifdef NGX_EVENT
    int  (*state_handler)(ngx_http_request_t *r);
#endif
};


#define NGX_INDEX "index.html"


int ngx_http_init_connection(ngx_connection_t *c);


#endif /* _NGX_HTTP_H_INCLUDED_ */