Lines Matching refs:datlen
149 size_t datlen);
329 evbuffer_chain_insert_new(struct evbuffer *buf, size_t datlen) in evbuffer_chain_insert_new() argument
332 if ((chain = evbuffer_chain_new(datlen)) == NULL) in evbuffer_chain_insert_new()
1165 evbuffer_remove(struct evbuffer *buf, void *data_out, size_t datlen) in evbuffer_remove() argument
1169 n = evbuffer_copyout_from(buf, NULL, data_out, datlen); in evbuffer_remove()
1179 evbuffer_copyout(struct evbuffer *buf, void *data_out, size_t datlen) in evbuffer_copyout() argument
1181 return evbuffer_copyout_from(buf, NULL, data_out, datlen); in evbuffer_copyout()
1186 void *data_out, size_t datlen) in evbuffer_copyout_from() argument
1198 if (datlen > (size_t)(EV_SSIZE_MAX - pos->pos)) { in evbuffer_copyout_from()
1204 if (datlen + pos->pos > buf->total_len) in evbuffer_copyout_from()
1205 datlen = buf->total_len - pos->pos; in evbuffer_copyout_from()
1209 if (datlen > buf->total_len) in evbuffer_copyout_from()
1210 datlen = buf->total_len; in evbuffer_copyout_from()
1214 if (datlen == 0) in evbuffer_copyout_from()
1222 nread = datlen; in evbuffer_copyout_from()
1224 while (datlen && datlen >= chain->off - pos_in_chain) { in evbuffer_copyout_from()
1230 datlen -= copylen; in evbuffer_copyout_from()
1234 EVUTIL_ASSERT(chain || datlen==0); in evbuffer_copyout_from()
1237 if (datlen) { in evbuffer_copyout_from()
1239 EVUTIL_ASSERT(datlen+pos_in_chain <= chain->off); in evbuffer_copyout_from()
1242 datlen); in evbuffer_copyout_from()
1256 size_t datlen) in evbuffer_remove_buffer() argument
1269 if (datlen == 0 || dst == src) { in evbuffer_remove_buffer()
1280 if (datlen >= src->total_len) { in evbuffer_remove_buffer()
1281 datlen = src->total_len; in evbuffer_remove_buffer()
1283 result = (int)datlen; /*XXXX should return ev_ssize_t*/ in evbuffer_remove_buffer()
1288 while (chain->off <= datlen) { in evbuffer_remove_buffer()
1294 datlen -= chain->off; in evbuffer_remove_buffer()
1322 evbuffer_add(dst, chain->buffer + chain->misalign, datlen); in evbuffer_remove_buffer()
1323 chain->misalign += datlen; in evbuffer_remove_buffer()
1324 chain->off -= datlen; in evbuffer_remove_buffer()
1325 nread += datlen; in evbuffer_remove_buffer()
1723 evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen) in evbuffer_add() argument
1736 if (datlen > EV_SIZE_MAX - buf->total_len) { in evbuffer_add()
1749 chain = evbuffer_chain_new(datlen); in evbuffer_add()
1760 if (remain >= datlen) { in evbuffer_add()
1764 data, datlen); in evbuffer_add()
1765 chain->off += datlen; in evbuffer_add()
1766 buf->total_len += datlen; in evbuffer_add()
1767 buf->n_add_for_cb += datlen; in evbuffer_add()
1770 evbuffer_chain_should_realign(chain, datlen)) { in evbuffer_add()
1774 memcpy(chain->buffer + chain->off, data, datlen); in evbuffer_add()
1775 chain->off += datlen; in evbuffer_add()
1776 buf->total_len += datlen; in evbuffer_add()
1777 buf->n_add_for_cb += datlen; in evbuffer_add()
1789 if (datlen > to_alloc) in evbuffer_add()
1790 to_alloc = datlen; in evbuffer_add()
1804 datlen -= remain; in evbuffer_add()
1806 memcpy(tmp->buffer, data, datlen); in evbuffer_add()
1807 tmp->off = datlen; in evbuffer_add()
1809 buf->n_add_for_cb += datlen; in evbuffer_add()
1820 evbuffer_prepend(struct evbuffer *buf, const void *data, size_t datlen) in evbuffer_prepend() argument
1830 if (datlen > EV_SIZE_MAX - buf->total_len) { in evbuffer_prepend()
1837 chain = evbuffer_chain_new(datlen); in evbuffer_prepend()
1854 if ((size_t)chain->misalign >= datlen) { in evbuffer_prepend()
1856 memcpy(chain->buffer + chain->misalign - datlen, in evbuffer_prepend()
1857 data, datlen); in evbuffer_prepend()
1858 chain->off += datlen; in evbuffer_prepend()
1859 chain->misalign -= datlen; in evbuffer_prepend()
1860 buf->total_len += datlen; in evbuffer_prepend()
1861 buf->n_add_for_cb += datlen; in evbuffer_prepend()
1866 (char*)data + datlen - chain->misalign, in evbuffer_prepend()
1871 datlen -= (size_t)chain->misalign; in evbuffer_prepend()
1877 if ((tmp = evbuffer_chain_new(datlen)) == NULL) in evbuffer_prepend()
1885 tmp->off = datlen; in evbuffer_prepend()
1886 EVUTIL_ASSERT(datlen <= tmp->buffer_len); in evbuffer_prepend()
1887 tmp->misalign = tmp->buffer_len - datlen; in evbuffer_prepend()
1889 memcpy(tmp->buffer + tmp->misalign, data, datlen); in evbuffer_prepend()
1890 buf->total_len += datlen; in evbuffer_prepend()
1891 buf->n_add_for_cb += datlen; in evbuffer_prepend()
1918 size_t datlen) in evbuffer_chain_should_realign() argument
1920 return chain->buffer_len - chain->off >= datlen && in evbuffer_chain_should_realign()
1928 evbuffer_expand_singlechain(struct evbuffer *buf, size_t datlen) in evbuffer_expand_singlechain() argument
1954 if (CHAIN_SPACE_LEN(chain) >= datlen) { in evbuffer_expand_singlechain()
1971 if (evbuffer_chain_should_realign(chain, datlen)) { in evbuffer_expand_singlechain()
1986 datlen >= (EVBUFFER_CHAIN_MAX - chain->off)) { in evbuffer_expand_singlechain()
1989 if (chain->next && CHAIN_SPACE_LEN(chain->next) >= datlen) { in evbuffer_expand_singlechain()
2005 size_t length = chain->off + datlen; in evbuffer_expand_singlechain()
2027 result = evbuffer_chain_insert_new(buf, datlen); in evbuffer_expand_singlechain()
2032 EVUTIL_ASSERT(CHAIN_SPACE_LEN(result) >= datlen); in evbuffer_expand_singlechain()
2040 evbuffer_expand_fast_(struct evbuffer *buf, size_t datlen, int n) in evbuffer_expand_fast_() argument
2052 chain = evbuffer_chain_new(datlen); in evbuffer_expand_fast_()
2079 if (avail >= datlen) { in evbuffer_expand_fast_()
2095 tmp = evbuffer_chain_new(datlen - avail); in evbuffer_expand_fast_()
2126 EVUTIL_ASSERT(datlen >= avail); in evbuffer_expand_fast_()
2127 tmp = evbuffer_chain_new(datlen - avail); in evbuffer_expand_fast_()
2150 evbuffer_expand(struct evbuffer *buf, size_t datlen) in evbuffer_expand() argument
2155 chain = evbuffer_expand_singlechain(buf, datlen); in evbuffer_expand()
2909 const void *data, size_t datlen, in evbuffer_add_reference() argument
2921 chain->buffer_len = datlen; in evbuffer_add_reference()
2922 chain->off = datlen; in evbuffer_add_reference()
2936 outbuf->n_add_for_cb += datlen; in evbuffer_add_reference()