summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_buf.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/nxt_buf.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nxt_buf.h b/src/nxt_buf.h
index 2e896093..7a894d0f 100644
--- a/src/nxt_buf.h
+++ b/src/nxt_buf.h
@@ -250,6 +250,19 @@ 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);
+NXT_EXPORT nxt_buf_t *nxt_buf_make_plain(nxt_mp_t *mp, nxt_buf_t *src,
+ size_t size);
+
+nxt_inline nxt_buf_t *
+nxt_buf_chk_make_plain(nxt_mp_t *mp, nxt_buf_t *src, size_t size)
+{
+ if (nxt_slow_path(src != NULL && src->next != NULL)) {
+ return nxt_buf_make_plain(mp, src, size);
+ }
+
+ return src;
+}
+
#define \
nxt_buf_free(mp, b) \
nxt_mp_free((mp), (b))