Lines Matching refs:bm
10 static nxt_bool_t nxt_sendbuf_copy(nxt_buf_mem_t *bm, nxt_buf_t *b,
211 nxt_sendbuf_copy_coalesce(nxt_conn_t *c, nxt_buf_mem_t *bm, nxt_buf_t *b, in nxt_sendbuf_copy_coalesce() argument
219 bsize = nxt_buf_mem_size(bm); in nxt_sendbuf_copy_coalesce()
223 if (size > bsize && bm->pos == bm->free) { in nxt_sendbuf_copy_coalesce()
231 if (bm->pos == NULL) { in nxt_sendbuf_copy_coalesce()
232 bm->pos = nxt_malloc(bsize); in nxt_sendbuf_copy_coalesce()
233 if (nxt_slow_path(bm->pos == NULL)) { in nxt_sendbuf_copy_coalesce()
237 bm->start = bm->pos; in nxt_sendbuf_copy_coalesce()
238 bm->free = bm->pos; in nxt_sendbuf_copy_coalesce()
239 bm->end += (uintptr_t) bm->pos; in nxt_sendbuf_copy_coalesce()
244 flush = nxt_sendbuf_copy(bm, b, &copied); in nxt_sendbuf_copy_coalesce()
252 size = nxt_buf_mem_used_size(bm); in nxt_sendbuf_copy_coalesce()
258 n = c->io->send(c, bm->pos, nxt_min(size, limit)); in nxt_sendbuf_copy_coalesce()
263 bm->pos += n; in nxt_sendbuf_copy_coalesce()
265 if (bm->pos == bm->free) { in nxt_sendbuf_copy_coalesce()
266 bm->pos = bm->start; in nxt_sendbuf_copy_coalesce()
267 bm->free = bm->start; in nxt_sendbuf_copy_coalesce()
295 nxt_sendbuf_copy(nxt_buf_mem_t *bm, nxt_buf_t *b, size_t *copied) in nxt_sendbuf_copy() argument
306 bsize = bm->end - bm->free; in nxt_sendbuf_copy()
310 nxt_memcpy(bm->free, b->mem.pos, size); in nxt_sendbuf_copy()
313 bm->free += size; in nxt_sendbuf_copy()
315 if (bm->free == bm->end) { in nxt_sendbuf_copy()