mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
nginx-0.0.1-2003-10-30-19:51:33 import
This commit is contained in:
parent
68ee8f1442
commit
b5910d497e
@ -741,7 +741,7 @@ char *ngx_conf_set_bufs_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bufs->size = ngx_parse_size(&value[2]);
|
bufs->size = ngx_parse_size(&value[2]);
|
||||||
if (bufs->size == NGX_ERROR || bufs->size == 0) {
|
if (bufs->size == (size_t) NGX_ERROR || bufs->size == 0) {
|
||||||
return "invalid value";
|
return "invalid value";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ void ngx_chain_update_chains(ngx_chain_t **free, ngx_chain_t **busy,
|
|||||||
*out = NULL;
|
*out = NULL;
|
||||||
|
|
||||||
while (*busy) {
|
while (*busy) {
|
||||||
if (ngx_hunk_size((*busy)->hunk) > 0) {
|
if (ngx_hunk_size((*busy)->hunk) != 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ struct ngx_chain_s {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int num;
|
int num;
|
||||||
ssize_t size;
|
size_t size;
|
||||||
} ngx_bufs_t;
|
} ngx_bufs_t;
|
||||||
|
|
||||||
|
|
||||||
@ -117,8 +117,8 @@ typedef struct {
|
|||||||
|
|
||||||
|
|
||||||
#define ngx_hunk_size(h) \
|
#define ngx_hunk_size(h) \
|
||||||
((h->type & NGX_HUNK_IN_MEMORY) ? h->last - h->pos: \
|
((h->type & NGX_HUNK_IN_MEMORY) ? (size_t) (h->last - h->pos): \
|
||||||
(size_t) (h->file_last - h->file_pos))
|
(size_t) (h->file_last - h->file_pos))
|
||||||
|
|
||||||
|
|
||||||
ngx_hunk_t *ngx_create_temp_hunk(ngx_pool_t *pool, int size);
|
ngx_hunk_t *ngx_create_temp_hunk(ngx_pool_t *pool, int size);
|
||||||
|
@ -16,7 +16,8 @@ static int ngx_output_chain_copy_hunk(ngx_hunk_t *dst, ngx_hunk_t *src,
|
|||||||
int ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in)
|
int ngx_output_chain(ngx_output_chain_ctx_t *ctx, ngx_chain_t *in)
|
||||||
{
|
{
|
||||||
int rc, last;
|
int rc, last;
|
||||||
ssize_t size, hsize;
|
size_t hsize;
|
||||||
|
ssize_t size;
|
||||||
ngx_chain_t *cl, *out, **last_out;
|
ngx_chain_t *cl, *out, **last_out;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -41,7 +41,7 @@ static int ngx_devpoll_process_events(ngx_log_t *log);
|
|||||||
static void *ngx_devpoll_create_conf(ngx_cycle_t *cycle);
|
static void *ngx_devpoll_create_conf(ngx_cycle_t *cycle);
|
||||||
static char *ngx_devpoll_init_conf(ngx_cycle_t *cycle, void *conf);
|
static char *ngx_devpoll_init_conf(ngx_cycle_t *cycle, void *conf);
|
||||||
|
|
||||||
static int dp;
|
static int dp = -1;
|
||||||
static struct pollfd *change_list, *event_list;
|
static struct pollfd *change_list, *event_list;
|
||||||
static u_int nchanges, max_changes, nevents;
|
static u_int nchanges, max_changes, nevents;
|
||||||
|
|
||||||
|
@ -203,16 +203,32 @@ ngx_log_debug(pc->log, "CONNECT: %s" _ peer->addr_port_text.data);
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ngx_event_flags & NGX_USE_AIO_EVENT) {
|
if (ngx_event_flags & NGX_USE_AIO_EVENT) {
|
||||||
/* aio, iocp */
|
|
||||||
|
|
||||||
#if 1
|
|
||||||
/* TODO: NGX_EINPROGRESS */
|
|
||||||
|
|
||||||
|
/* aio, iocp */
|
||||||
|
|
||||||
|
if (ngx_blocking(s) == -1) {
|
||||||
|
ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
|
||||||
|
ngx_blocking_n " failed");
|
||||||
|
|
||||||
|
if (ngx_close_socket(s) == -1) {
|
||||||
|
ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
|
||||||
|
ngx_close_socket_n " failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
return NGX_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* aio allows to post operation on non-connected socket
|
||||||
|
* at least in FreeBSD
|
||||||
|
*
|
||||||
|
* TODO: check in Win32, etc.
|
||||||
|
*/
|
||||||
|
|
||||||
rev->ready = 1;
|
rev->ready = 1;
|
||||||
wev->ready = 1;
|
wev->ready = 1;
|
||||||
|
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: epoll */
|
/* TODO: epoll */
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
#define _FILE_OFFSET_BITS 64 /* must be before sys/types.h */
|
#define _FILE_OFFSET_BITS 64 /* must be before sys/types.h */
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <inttypes.h>
|
||||||
#include <stddef.h> /* offsetof */
|
#include <stddef.h> /* offsetof */
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user