diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-07-07 16:01:34 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-07-07 16:01:34 +0300 |
commit | f319220a6c4515f3d31e546b4f1f5de0b94aceb7 (patch) | |
tree | eb4a3ed43d9d7ebef794e51fba56715e65b5a936 /src/nxt_buf.h | |
parent | c9fbd832ab4f5743824b155fb3bf3a42206fdd52 (diff) | |
download | unit-f319220a6c4515f3d31e546b4f1f5de0b94aceb7.tar.gz unit-f319220a6c4515f3d31e546b4f1f5de0b94aceb7.tar.bz2 |
Redirecting buffer completion handler to specific engine.
There is a case in router where we use port in router connection thread.
Buffers are allocated within connection memory pool which can be used only in
this router thread. sendmsg() can be postponed into main router thread and
completion handler will compare current engine and post itself to correct
engine.
Diffstat (limited to 'src/nxt_buf.h')
-rw-r--r-- | src/nxt_buf.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/nxt_buf.h b/src/nxt_buf.h index 43c0c453..ae96b24a 100644 --- a/src/nxt_buf.h +++ b/src/nxt_buf.h @@ -76,11 +76,6 @@ struct nxt_buf_s { nxt_buf_t *next; uint32_t retain; - /* - * Used by nxt_mem_cache_free() to return buffer - * in appropriate memory pool cache. - */ - uint8_t size; uint8_t is_file; /* 1 bit */ @@ -92,6 +87,7 @@ struct nxt_buf_s { uint16_t is_flush:1; uint16_t is_last:1; uint16_t is_port_mmap_sent:1; + uint16_t is_ts:1; nxt_buf_mem_t mem; @@ -245,11 +241,14 @@ nxt_buf_used_size(b) \ NXT_EXPORT void nxt_buf_mem_init(nxt_buf_t *b, void *start, size_t size); NXT_EXPORT nxt_buf_t *nxt_buf_mem_alloc(nxt_mp_t *mp, size_t size, nxt_uint_t flags); +NXT_EXPORT nxt_buf_t *nxt_buf_mem_ts_alloc(nxt_task_t *task, nxt_mp_t *mp, + size_t size); NXT_EXPORT nxt_buf_t *nxt_buf_file_alloc(nxt_mp_t *mp, size_t size, nxt_uint_t flags); NXT_EXPORT nxt_buf_t *nxt_buf_mmap_alloc(nxt_mp_t *mp, size_t size); NXT_EXPORT nxt_buf_t *nxt_buf_sync_alloc(nxt_mp_t *mp, nxt_uint_t flags); +NXT_EXPORT nxt_int_t nxt_buf_ts_handle(nxt_task_t *task, void *obj, void *data); #define \ nxt_buf_free(mp, b) \ |