mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
nginx-0.0.1-2003-12-02-08:47:29 import
This commit is contained in:
parent
4fc368fa30
commit
a7dcbaf4ff
@ -25,9 +25,6 @@ struct ngx_event_s {
|
|||||||
/* TODO rename to handler, move flags to struct start */
|
/* TODO rename to handler, move flags to struct start */
|
||||||
void (*event_handler)(ngx_event_t *ev);
|
void (*event_handler)(ngx_event_t *ev);
|
||||||
|
|
||||||
void *context;
|
|
||||||
char *action;
|
|
||||||
|
|
||||||
u_int index;
|
u_int index;
|
||||||
|
|
||||||
/* queue in mutex(), aio_read(), aio_write() */
|
/* queue in mutex(), aio_read(), aio_write() */
|
||||||
|
@ -47,8 +47,14 @@ ngx_http_cache_t *ngx_http_cache_get(ngx_http_cache_hash_t *hash,
|
|||||||
&& c[i].key.len == key->len
|
&& c[i].key.len == key->len
|
||||||
&& ngx_rstrncmp(c[i].key.data, key->data, key->len) == 0)
|
&& ngx_rstrncmp(c[i].key.data, key->data, key->len) == 0)
|
||||||
{
|
{
|
||||||
c[i].refs++;
|
#if 0
|
||||||
|
if (c[i].expired) {
|
||||||
ngx_mutex_unlock(&hash->mutex);
|
ngx_mutex_unlock(&hash->mutex);
|
||||||
|
return (void *) NGX_AGAIN;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
c[i].refs++;
|
||||||
|
|
||||||
if ((!(c[i].notify && (ngx_event_flags & NGX_HAVE_KQUEUE_EVENT)))
|
if ((!(c[i].notify && (ngx_event_flags & NGX_HAVE_KQUEUE_EVENT)))
|
||||||
&& (ngx_cached_time - c[i].updated >= hash->update))
|
&& (ngx_cached_time - c[i].updated >= hash->update))
|
||||||
@ -56,6 +62,8 @@ ngx_http_cache_t *ngx_http_cache_get(ngx_http_cache_hash_t *hash,
|
|||||||
c[i].expired = 1;
|
c[i].expired = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngx_mutex_unlock(&hash->mutex);
|
||||||
|
|
||||||
if (cleanup) {
|
if (cleanup) {
|
||||||
cleanup->data.cache.hash = hash;
|
cleanup->data.cache.hash = hash;
|
||||||
cleanup->data.cache.cache = &c[i];
|
cleanup->data.cache.cache = &c[i];
|
||||||
@ -217,6 +225,12 @@ void ngx_http_cache_free(ngx_http_cache_t *cache,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ngx_http_cache_lock(ngx_http_cache_hash_t *hash, ngx_http_cache_t *cache)
|
||||||
|
{
|
||||||
|
ngx_mutex_lock(&hash->mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void ngx_http_cache_unlock(ngx_http_cache_hash_t *hash,
|
void ngx_http_cache_unlock(ngx_http_cache_hash_t *hash,
|
||||||
ngx_http_cache_t *cache, ngx_log_t *log)
|
ngx_http_cache_t *cache, ngx_log_t *log)
|
||||||
{
|
{
|
||||||
@ -234,9 +248,11 @@ void ngx_http_cache_unlock(ngx_http_cache_hash_t *hash,
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
ngx_add_file_event(ngx_fd_t, ngx_event_handler_pt *handler, void *data)
|
ngx_http_cache_add_file_event(ngx_http_cache_hash_t *hash,
|
||||||
|
ngx_http_cache_t *cache)
|
||||||
{
|
{
|
||||||
ngx_event_t *ev;
|
ngx_event_t *ev;
|
||||||
|
ngx_http_cache_event_ctx_t *ctx;
|
||||||
|
|
||||||
ev = &ngx_cycle->read_events[fd];
|
ev = &ngx_cycle->read_events[fd];
|
||||||
ngx_memzero(ev, sizeof(ngx_event_t);
|
ngx_memzero(ev, sizeof(ngx_event_t);
|
||||||
@ -250,7 +266,7 @@ ngx_add_file_event(ngx_fd_t, ngx_event_handler_pt *handler, void *data)
|
|||||||
|
|
||||||
void ngx_http_cache_invalidate(ngx_event_t *ev)
|
void ngx_http_cache_invalidate(ngx_event_t *ev)
|
||||||
{
|
{
|
||||||
ngx_http_cache_ctx_t *ctx;
|
ngx_http_cache_event_ctx_t *ctx;
|
||||||
|
|
||||||
ctx = ev->data;
|
ctx = ev->data;
|
||||||
|
|
||||||
|
@ -101,6 +101,7 @@ ngx_http_cache_t *ngx_http_cache_alloc(ngx_http_cache_hash_t *hash,
|
|||||||
ngx_str_t *value, ngx_log_t *log);
|
ngx_str_t *value, ngx_log_t *log);
|
||||||
void ngx_http_cache_free(ngx_http_cache_t *cache,
|
void ngx_http_cache_free(ngx_http_cache_t *cache,
|
||||||
ngx_str_t *key, ngx_str_t *value, ngx_log_t *log);
|
ngx_str_t *key, ngx_str_t *value, ngx_log_t *log);
|
||||||
|
void ngx_http_cache_lock(ngx_http_cache_hash_t *hash, ngx_http_cache_t *cache);
|
||||||
void ngx_http_cache_unlock(ngx_http_cache_hash_t *hash,
|
void ngx_http_cache_unlock(ngx_http_cache_hash_t *hash,
|
||||||
ngx_http_cache_t *cache, ngx_log_t *log);
|
ngx_http_cache_t *cache, ngx_log_t *log);
|
||||||
|
|
||||||
|
@ -176,6 +176,8 @@ ngx_log_debug(c->log, "NOPUSH");
|
|||||||
hsize = 0;
|
hsize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sent = 0;
|
||||||
|
|
||||||
rc = sendfile(file->file->fd, c->fd, file->file_pos,
|
rc = sendfile(file->file->fd, c->fd, file->file_pos,
|
||||||
fsize + hsize, &hdtr, &sent, 0);
|
fsize + hsize, &hdtr, &sent, 0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user