nginx-0.0.1-2003-06-12-09:54:39 import

This commit is contained in:
Igor Sysoev 2003-06-12 05:54:39 +00:00
parent 239baac646
commit 0915977df5
14 changed files with 53 additions and 52 deletions

View File

@ -74,17 +74,17 @@ void ngx_destroy_pool(ngx_pool_t *pool)
void *ngx_palloc(ngx_pool_t *pool, size_t size)
{
void *m;
char *m;
ngx_pool_t *p, *n;
ngx_pool_large_t *large, *last;
if (size <= NGX_MAX_ALLOC_FROM_POOL) {
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);
p->last = ngx_align(p->last);
p->last += size ;
m = ngx_align(p->last);
if ((size_t) (p->end - m) >= size) {
p->last = m + size ;
return m;
}

View File

@ -38,10 +38,10 @@
/* TODO: auto_conf */
#define NGX_ALIGN (4 - 1)
#define NGX_ALIGN_TYPE (unsigned int)
#define NGX_ALIGN (sizeof(unsigned long) - 1) /* platform word */
#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__ */
@ -50,16 +50,16 @@
#endif
#ifndef INFTIM /* Linux */
#define INFTIM -1
#ifndef INFTIM /* Linux */
#define INFTIM -1
#endif
#ifndef INADDR_NONE /* Solaris */
#define INADDR_NONE ((unsigned long) -1)
#ifndef INADDR_NONE /* Solaris */
#define INADDR_NONE ((unsigned int) -1)
#endif
#ifndef INET_ADDRSTRLEN
#define INET_ADDRSTRLEN 16
#ifndef INET_ADDRSTRLEN /* Win32 */
#define INET_ADDRSTRLEN 16
#endif

View File

@ -56,8 +56,10 @@ typedef struct ngx_connection_s ngx_connection_t;
*/
#if 0
/* STUB */
extern ngx_log_t ngx_log;
#endif
#endif /* _NGX_CORE_H_INCLUDED_ */

View File

@ -25,8 +25,8 @@
typedef struct {
ssize_t (*recv)(ngx_connection_t *c, char *buf, size_t size);
void *dummy_recv_chain;
void *dummy_send;
ssize_t (*recv_chain)(ngx_connection_t *c, ngx_chain_t *in);
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);
int flags;
} ngx_os_io_t;

View File

@ -513,7 +513,8 @@ static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
/* 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_addr = (ngx_http_in_addr_t *) in_port[p].addrs.elts;

View File

@ -35,9 +35,9 @@ typedef struct {
ngx_msec_t post_accept_timeout;
ssize_t connection_pool_size;
size_t request_pool_size;
ssize_t request_pool_size;
ngx_msec_t client_header_timeout;
size_t client_header_buffer_size;
ssize_t client_header_buffer_size;
int large_client_header;
} ngx_http_core_srv_conf_t;
@ -99,8 +99,8 @@ typedef struct {
int sendfile; /* sendfile */
ngx_msec_t send_timeout; /* send_timeout */
size_t send_lowat; /* send_lowat */
size_t discarded_buffer_size; /* discarded_buffer_size */
ssize_t send_lowat; /* send_lowat */
ssize_t discarded_buffer_size; /* discarded_buffer_size */
ngx_msec_t keepalive_timeout; /* keepalive_timeout */
ngx_msec_t lingering_time; /* lingering_time */
ngx_msec_t lingering_timeout; /* lingering_timeout */

View File

@ -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)
{
size_t size;
ssize_t n;
ssize_t size, n;
ngx_http_core_loc_conf_t *clcf;
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)
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) {
r->discarded_buffer = r->header_in->last;

View File

@ -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 rc;
size_t size;
ssize_t size;
ngx_chain_t *ce, *le;
ngx_http_output_filter_ctx_t *ctx;
ngx_http_output_filter_conf_t *conf;

View File

@ -22,22 +22,21 @@
#include <osreldate.h>
/* STUB */
#define QD_FMT "%lld"
#define QX_FMT "%llx"
/**/
#if (i386)
#define OFF_FMT "%lld"
#define SIZE_FMT "%d"
#define SIZEX_FMT "%x"
#else
#define OFF_FMT "%ld"
#define SIZE_FMT "%ld"
#define SIZEX_FMT "%lx"
#define OFF_FMT "%lld"
#define SIZE_FMT "%d"
#define SIZEX_FMT "%x"
#else /* amd64, alpha, sparc64, ia64 */
#define OFF_FMT "%ld"
#define SIZE_FMT "%ld"
#define SIZEX_FMT "%lx"
#endif
#define PID_FMT "%d"
#define PID_FMT "%d"
#ifndef HAVE_SELECT

View File

@ -30,10 +30,11 @@
#define QD_FMT "%qd"
#define QX_FMT "%qx"
#define OFF_FMT "%qd"
#define PID_FMT "%d"
#define OFF_FMT "%lld"
#define SIZE_FMT "%d"
#define SIZEX_FMT "%x"
#define PID_FMT "%d"
#ifndef HAVE_SELECT

View File

@ -27,10 +27,10 @@
typedef uint32_t u_int32_t;
#define QD_FMT "%lld"
#define QX_FMT "%llx"
#define OFF_FMT "%lld"
#define PID_FMT "%ld"
#define OFF_FMT "%lld"
#define SIZE_FMT "%d"
#define SIZEX_FMT "%x"
#define PID_FMT "%ld"
#ifndef HAVE_SELECT

View File

@ -5,7 +5,7 @@
#include <ngx_config.h>
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;

View File

@ -8,7 +8,6 @@
#define NGX_WRITE_SHUTDOWN SD_SEND
#define INET_ADDRSTRLEN 16
typedef SOCKET ngx_socket_t;
typedef int socklen_t;

View File

@ -16,10 +16,10 @@ typedef unsigned __int64 off_t;
typedef BY_HANDLE_FILE_INFORMATION ngx_file_info_t;
#define QD_FMT "%I64d"
#define QX_FMT "%I64x"
#define OFF_FMT "%I64d"
#define PID_FMT "%d"
#define OFF_FMT "%I64d"
#define SIZE_FMT "%d"
#define SIZEX_FMT "%x"
#define PID_FMT "%d"
#endif /* _NGX_TYPES_H_INCLUDED_ */