mirror of
https://github.com/nginx/nginx.git
synced 2024-12-18 13:13:33 -06:00
nginx-0.0.1-2003-06-12-09:54:39 import
This commit is contained in:
parent
239baac646
commit
0915977df5
@ -74,17 +74,17 @@ void ngx_destroy_pool(ngx_pool_t *pool)
|
|||||||
|
|
||||||
void *ngx_palloc(ngx_pool_t *pool, size_t size)
|
void *ngx_palloc(ngx_pool_t *pool, size_t size)
|
||||||
{
|
{
|
||||||
void *m;
|
char *m;
|
||||||
ngx_pool_t *p, *n;
|
ngx_pool_t *p, *n;
|
||||||
ngx_pool_large_t *large, *last;
|
ngx_pool_large_t *large, *last;
|
||||||
|
|
||||||
if (size <= NGX_MAX_ALLOC_FROM_POOL) {
|
if (size <= NGX_MAX_ALLOC_FROM_POOL) {
|
||||||
|
|
||||||
for (p = pool, n = pool->next; /* void */; p = n, n = n->next) {
|
for (p = pool, n = pool->next; /* void */; p = n, n = n->next) {
|
||||||
if ((size_t) (p->end - ngx_align(p->last)) >= size) {
|
|
||||||
m = ngx_align(p->last);
|
m = ngx_align(p->last);
|
||||||
p->last = ngx_align(p->last);
|
|
||||||
p->last += size ;
|
if ((size_t) (p->end - m) >= size) {
|
||||||
|
p->last = m + size ;
|
||||||
|
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
@ -38,10 +38,10 @@
|
|||||||
|
|
||||||
|
|
||||||
/* TODO: auto_conf */
|
/* TODO: auto_conf */
|
||||||
#define NGX_ALIGN (4 - 1)
|
#define NGX_ALIGN (sizeof(unsigned long) - 1) /* platform word */
|
||||||
#define NGX_ALIGN_TYPE (unsigned int)
|
#define NGX_ALIGN_CAST (unsigned long) /* size of the pointer */
|
||||||
|
|
||||||
#define ngx_align(p) (char *) ((NGX_ALIGN_TYPE p + NGX_ALIGN) & ~NGX_ALIGN)
|
#define ngx_align(p) (char *) ((NGX_ALIGN_CAST p + NGX_ALIGN) & ~NGX_ALIGN)
|
||||||
|
|
||||||
|
|
||||||
/* TODO: auto_conf: ngx_inline inline __inline __inline__ */
|
/* TODO: auto_conf: ngx_inline inline __inline __inline__ */
|
||||||
@ -55,10 +55,10 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef INADDR_NONE /* Solaris */
|
#ifndef INADDR_NONE /* Solaris */
|
||||||
#define INADDR_NONE ((unsigned long) -1)
|
#define INADDR_NONE ((unsigned int) -1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef INET_ADDRSTRLEN
|
#ifndef INET_ADDRSTRLEN /* Win32 */
|
||||||
#define INET_ADDRSTRLEN 16
|
#define INET_ADDRSTRLEN 16
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -56,8 +56,10 @@ typedef struct ngx_connection_s ngx_connection_t;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* STUB */
|
/* STUB */
|
||||||
extern ngx_log_t ngx_log;
|
extern ngx_log_t ngx_log;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif /* _NGX_CORE_H_INCLUDED_ */
|
#endif /* _NGX_CORE_H_INCLUDED_ */
|
||||||
|
@ -25,8 +25,8 @@
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ssize_t (*recv)(ngx_connection_t *c, char *buf, size_t size);
|
ssize_t (*recv)(ngx_connection_t *c, char *buf, size_t size);
|
||||||
void *dummy_recv_chain;
|
ssize_t (*recv_chain)(ngx_connection_t *c, ngx_chain_t *in);
|
||||||
void *dummy_send;
|
ssize_t (*send)(ngx_connection_t *c, char *buf, size_t size);
|
||||||
ngx_chain_t *(*send_chain)(ngx_connection_t *c, ngx_chain_t *in);
|
ngx_chain_t *(*send_chain)(ngx_connection_t *c, ngx_chain_t *in);
|
||||||
int flags;
|
int flags;
|
||||||
} ngx_os_io_t;
|
} ngx_os_io_t;
|
||||||
|
@ -513,7 +513,8 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
|
|
||||||
/* prepare for the next cycle */
|
/* prepare for the next cycle */
|
||||||
|
|
||||||
(char *) in_port[p].addrs.elts += in_port[p].addrs.size;
|
in_port[p].addrs.elts = (char *) in_port[p].addrs.elts
|
||||||
|
+ in_port[p].addrs.size;
|
||||||
in_port[p].addrs.nelts--;
|
in_port[p].addrs.nelts--;
|
||||||
|
|
||||||
in_addr = (ngx_http_in_addr_t *) in_port[p].addrs.elts;
|
in_addr = (ngx_http_in_addr_t *) in_port[p].addrs.elts;
|
||||||
|
@ -35,9 +35,9 @@ typedef struct {
|
|||||||
|
|
||||||
ngx_msec_t post_accept_timeout;
|
ngx_msec_t post_accept_timeout;
|
||||||
ssize_t connection_pool_size;
|
ssize_t connection_pool_size;
|
||||||
size_t request_pool_size;
|
ssize_t request_pool_size;
|
||||||
ngx_msec_t client_header_timeout;
|
ngx_msec_t client_header_timeout;
|
||||||
size_t client_header_buffer_size;
|
ssize_t client_header_buffer_size;
|
||||||
int large_client_header;
|
int large_client_header;
|
||||||
} ngx_http_core_srv_conf_t;
|
} ngx_http_core_srv_conf_t;
|
||||||
|
|
||||||
@ -99,8 +99,8 @@ typedef struct {
|
|||||||
|
|
||||||
int sendfile; /* sendfile */
|
int sendfile; /* sendfile */
|
||||||
ngx_msec_t send_timeout; /* send_timeout */
|
ngx_msec_t send_timeout; /* send_timeout */
|
||||||
size_t send_lowat; /* send_lowat */
|
ssize_t send_lowat; /* send_lowat */
|
||||||
size_t discarded_buffer_size; /* discarded_buffer_size */
|
ssize_t discarded_buffer_size; /* discarded_buffer_size */
|
||||||
ngx_msec_t keepalive_timeout; /* keepalive_timeout */
|
ngx_msec_t keepalive_timeout; /* keepalive_timeout */
|
||||||
ngx_msec_t lingering_time; /* lingering_time */
|
ngx_msec_t lingering_time; /* lingering_time */
|
||||||
ngx_msec_t lingering_timeout; /* lingering_timeout */
|
ngx_msec_t lingering_timeout; /* lingering_timeout */
|
||||||
|
@ -1035,8 +1035,7 @@ static void ngx_http_read_discarded_body_event(ngx_event_t *rev)
|
|||||||
|
|
||||||
static int ngx_http_read_discarded_body(ngx_http_request_t *r)
|
static int ngx_http_read_discarded_body(ngx_http_request_t *r)
|
||||||
{
|
{
|
||||||
size_t size;
|
ssize_t size, n;
|
||||||
ssize_t n;
|
|
||||||
ngx_http_core_loc_conf_t *clcf;
|
ngx_http_core_loc_conf_t *clcf;
|
||||||
|
|
||||||
ngx_log_debug(r->connection->log, "http read discarded body");
|
ngx_log_debug(r->connection->log, "http read discarded body");
|
||||||
@ -1318,7 +1317,7 @@ static void ngx_http_lingering_close_handler(ngx_event_t *rev)
|
|||||||
or the end of parsed header (otherwise)
|
or the end of parsed header (otherwise)
|
||||||
instead of r->header_in->last */
|
instead of r->header_in->last */
|
||||||
|
|
||||||
if ((size_t)(r->header_in->end - r->header_in->last)
|
if (r->header_in->end - r->header_in->last
|
||||||
>= clcf->discarded_buffer_size) {
|
>= clcf->discarded_buffer_size) {
|
||||||
r->discarded_buffer = r->header_in->last;
|
r->discarded_buffer = r->header_in->last;
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ ngx_module_t ngx_http_output_filter_module = {
|
|||||||
int ngx_http_output_filter(ngx_http_request_t *r, ngx_hunk_t *hunk)
|
int ngx_http_output_filter(ngx_http_request_t *r, ngx_hunk_t *hunk)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
size_t size;
|
ssize_t size;
|
||||||
ngx_chain_t *ce, *le;
|
ngx_chain_t *ce, *le;
|
||||||
ngx_http_output_filter_ctx_t *ctx;
|
ngx_http_output_filter_ctx_t *ctx;
|
||||||
ngx_http_output_filter_conf_t *conf;
|
ngx_http_output_filter_conf_t *conf;
|
||||||
|
@ -22,19 +22,18 @@
|
|||||||
#include <osreldate.h>
|
#include <osreldate.h>
|
||||||
|
|
||||||
|
|
||||||
/* STUB */
|
|
||||||
#define QD_FMT "%lld"
|
|
||||||
#define QX_FMT "%llx"
|
|
||||||
/**/
|
|
||||||
|
|
||||||
#if (i386)
|
#if (i386)
|
||||||
|
|
||||||
#define OFF_FMT "%lld"
|
#define OFF_FMT "%lld"
|
||||||
#define SIZE_FMT "%d"
|
#define SIZE_FMT "%d"
|
||||||
#define SIZEX_FMT "%x"
|
#define SIZEX_FMT "%x"
|
||||||
#else
|
|
||||||
|
#else /* amd64, alpha, sparc64, ia64 */
|
||||||
|
|
||||||
#define OFF_FMT "%ld"
|
#define OFF_FMT "%ld"
|
||||||
#define SIZE_FMT "%ld"
|
#define SIZE_FMT "%ld"
|
||||||
#define SIZEX_FMT "%lx"
|
#define SIZEX_FMT "%lx"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PID_FMT "%d"
|
#define PID_FMT "%d"
|
||||||
|
@ -30,12 +30,13 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define QD_FMT "%qd"
|
#define OFF_FMT "%lld"
|
||||||
#define QX_FMT "%qx"
|
#define SIZE_FMT "%d"
|
||||||
#define OFF_FMT "%qd"
|
#define SIZEX_FMT "%x"
|
||||||
#define PID_FMT "%d"
|
#define PID_FMT "%d"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef HAVE_SELECT
|
#ifndef HAVE_SELECT
|
||||||
#define HAVE_SELECT 1
|
#define HAVE_SELECT 1
|
||||||
#endif
|
#endif
|
||||||
|
@ -27,9 +27,9 @@
|
|||||||
|
|
||||||
typedef uint32_t u_int32_t;
|
typedef uint32_t u_int32_t;
|
||||||
|
|
||||||
#define QD_FMT "%lld"
|
|
||||||
#define QX_FMT "%llx"
|
|
||||||
#define OFF_FMT "%lld"
|
#define OFF_FMT "%lld"
|
||||||
|
#define SIZE_FMT "%d"
|
||||||
|
#define SIZEX_FMT "%x"
|
||||||
#define PID_FMT "%ld"
|
#define PID_FMT "%ld"
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include <ngx_config.h>
|
#include <ngx_config.h>
|
||||||
|
|
||||||
typedef u_int ngx_msec_t;
|
typedef u_int ngx_msec_t;
|
||||||
#define NGX_MAX_MSEC (u_int) ~0
|
#define NGX_MAX_MSEC (u_int) -1
|
||||||
|
|
||||||
typedef struct tm ngx_tm_t;
|
typedef struct tm ngx_tm_t;
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
#define NGX_WRITE_SHUTDOWN SD_SEND
|
#define NGX_WRITE_SHUTDOWN SD_SEND
|
||||||
|
|
||||||
#define INET_ADDRSTRLEN 16
|
|
||||||
|
|
||||||
typedef SOCKET ngx_socket_t;
|
typedef SOCKET ngx_socket_t;
|
||||||
typedef int socklen_t;
|
typedef int socklen_t;
|
||||||
|
@ -16,9 +16,9 @@ typedef unsigned __int64 off_t;
|
|||||||
typedef BY_HANDLE_FILE_INFORMATION ngx_file_info_t;
|
typedef BY_HANDLE_FILE_INFORMATION ngx_file_info_t;
|
||||||
|
|
||||||
|
|
||||||
#define QD_FMT "%I64d"
|
|
||||||
#define QX_FMT "%I64x"
|
|
||||||
#define OFF_FMT "%I64d"
|
#define OFF_FMT "%I64d"
|
||||||
|
#define SIZE_FMT "%d"
|
||||||
|
#define SIZEX_FMT "%x"
|
||||||
#define PID_FMT "%d"
|
#define PID_FMT "%d"
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user