nxt_buf.c (1267:74acbd89400a) nxt_buf.c (1269:41331471eee7)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

--- 181 unchanged lines hidden (view full) ---

190 return length;
191}
192
193
194static void
195nxt_buf_completion(nxt_task_t *task, void *obj, void *data)
196{
197 nxt_mp_t *mp;
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

--- 181 unchanged lines hidden (view full) ---

190 return length;
191}
192
193
194static void
195nxt_buf_completion(nxt_task_t *task, void *obj, void *data)
196{
197 nxt_mp_t *mp;
198 nxt_buf_t *b, *parent;
198 nxt_buf_t *b, *next, *parent;
199
200 b = obj;
201 parent = data;
202
203 nxt_debug(task, "buf completion: %p %p", b, b->mem.start);
204
205 nxt_assert(data == b->parent);
206
199
200 b = obj;
201 parent = data;
202
203 nxt_debug(task, "buf completion: %p %p", b, b->mem.start);
204
205 nxt_assert(data == b->parent);
206
207 mp = b->data;
208 nxt_mp_free(mp, b);
207 do {
208 next = b->next;
209 parent = b->parent;
210 mp = b->data;
209
211
210 nxt_buf_parent_completion(task, parent);
212 nxt_mp_free(mp, b);
213
214 nxt_buf_parent_completion(task, parent);
215
216 b = next;
217 } while (b != NULL);
211}
212
213
214void
215nxt_buf_parent_completion(nxt_task_t *task, nxt_buf_t *parent)
216{
217 if (parent != NULL) {
218 nxt_debug(task, "parent retain:%uD", parent->retain);

--- 38 unchanged lines hidden (view full) ---

257 return 0;
258}
259
260
261static void
262nxt_buf_ts_completion(nxt_task_t *task, void *obj, void *data)
263{
264 nxt_mp_t *mp;
218}
219
220
221void
222nxt_buf_parent_completion(nxt_task_t *task, nxt_buf_t *parent)
223{
224 if (parent != NULL) {
225 nxt_debug(task, "parent retain:%uD", parent->retain);

--- 38 unchanged lines hidden (view full) ---

264 return 0;
265}
266
267
268static void
269nxt_buf_ts_completion(nxt_task_t *task, void *obj, void *data)
270{
271 nxt_mp_t *mp;
265 nxt_buf_t *b, *parent;
272 nxt_buf_t *b, *next, *parent;
266
267 b = obj;
268 parent = data;
269
270 if (nxt_buf_ts_handle(task, obj, data)) {
271 return;
272 }
273
274 nxt_debug(task, "buf ts completion: %p %p", b, b->mem.start);
275
276 nxt_assert(data == b->parent);
277
273
274 b = obj;
275 parent = data;
276
277 if (nxt_buf_ts_handle(task, obj, data)) {
278 return;
279 }
280
281 nxt_debug(task, "buf ts completion: %p %p", b, b->mem.start);
282
283 nxt_assert(data == b->parent);
284
278 mp = b->data;
279 nxt_mp_free(mp, b);
280 nxt_mp_release(mp);
285 do {
286 next = b->next;
287 parent = b->parent;
288 mp = b->data;
281
289
282 nxt_buf_parent_completion(task, parent);
290 nxt_mp_free(mp, b);
291 nxt_mp_release(mp);
292
293 nxt_buf_parent_completion(task, parent);
294
295 b = next;
296 } while (b != NULL);
283}
284
285
286nxt_buf_t *
287nxt_buf_make_plain(nxt_mp_t *mp, nxt_buf_t *src, size_t size)
288{
289 nxt_buf_t *b, *i;
290

--- 24 unchanged lines hidden ---
297}
298
299
300nxt_buf_t *
301nxt_buf_make_plain(nxt_mp_t *mp, nxt_buf_t *src, size_t size)
302{
303 nxt_buf_t *b, *i;
304

--- 24 unchanged lines hidden ---