Apache Portable Runtime Utility Library
apr_buckets.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
21 #ifndef APR_BUCKETS_H
22 #define APR_BUCKETS_H
23 
24 #if defined(APR_BUCKET_DEBUG) && !defined(APR_RING_DEBUG)
25 #define APR_RING_DEBUG
26 #endif
27 
28 #include "apu.h"
29 #include "apr_network_io.h"
30 #include "apr_file_io.h"
31 #include "apr_general.h"
32 #include "apr_mmap.h"
33 #include "apr_errno.h"
34 #include "apr_ring.h"
35 #include "apr.h"
36 #if APR_HAVE_SYS_UIO_H
37 #include <sys/uio.h> /* for struct iovec */
38 #endif
39 #if APR_HAVE_STDARG_H
40 #include <stdarg.h>
41 #endif
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
54 #define APR_BUCKET_BUFF_SIZE 8000
55 
57 typedef enum {
61 
114 /*
115  * Forward declaration of the main types.
116  */
117 
121 typedef struct apr_bucket apr_bucket;
124 
127 
135  const char *name;
140  int num_func;
151  enum {
156  } is_metadata;
164  void (*destroy)(void *data);
165 
176  apr_status_t (*read)(apr_bucket *b, const char **str, apr_size_t *len,
177  apr_read_type_e block);
178 
192  apr_status_t (*setaside)(apr_bucket *e, apr_pool_t *pool);
193 
203  apr_status_t (*split)(apr_bucket *e, apr_size_t point);
204 
211  apr_status_t (*copy)(apr_bucket *e, apr_bucket **c);
212 
213 };
214 
224 struct apr_bucket {
234  apr_size_t length;
242  apr_off_t start;
244  void *data;
252  void (*free)(void *e);
255 };
256 
264  apr_pool_t *p;
266  /*
267  * The apr_bucket_list structure doesn't actually need a name tag
268  * because it has no existence independent of struct apr_bucket_brigade;
269  * the ring macros are designed so that you can leave the name tag
270  * argument empty in this situation but apparently the Windows compiler
271  * doesn't like that.
272  */
273  APR_RING_HEAD(apr_bucket_list, apr_bucket) list;
276 };
277 
278 
282 typedef apr_status_t (*apr_brigade_flush)(apr_bucket_brigade *bb, void *ctx);
283 
284 /*
285  * define APR_BUCKET_DEBUG if you want your brigades to be checked for
286  * validity at every possible instant. this will slow your code down
287  * substantially but is a very useful debugging tool.
288  */
289 #ifdef APR_BUCKET_DEBUG
290 
291 #define APR_BRIGADE_CHECK_CONSISTENCY(b) \
292  APR_RING_CHECK_CONSISTENCY(&(b)->list, apr_bucket, link)
293 
294 #define APR_BUCKET_CHECK_CONSISTENCY(e) \
295  APR_RING_CHECK_ELEM_CONSISTENCY((e), apr_bucket, link)
296 
297 #else
298 
304 #define APR_BRIGADE_CHECK_CONSISTENCY(b)
305 
311 #define APR_BUCKET_CHECK_CONSISTENCY(e)
312 #endif
313 
314 
331 #define APR_BRIGADE_SENTINEL(b) APR_RING_SENTINEL(&(b)->list, apr_bucket, link)
332 
338 #define APR_BRIGADE_EMPTY(b) APR_RING_EMPTY(&(b)->list, apr_bucket, link)
339 
345 #define APR_BRIGADE_FIRST(b) APR_RING_FIRST(&(b)->list)
346 
351 #define APR_BRIGADE_LAST(b) APR_RING_LAST(&(b)->list)
352 
358 #define APR_BRIGADE_INSERT_HEAD(b, e) do { \
359  apr_bucket *ap__b = (e); \
360  APR_RING_INSERT_HEAD(&(b)->list, ap__b, apr_bucket, link); \
361  APR_BRIGADE_CHECK_CONSISTENCY((b)); \
362  } while (0)
363 
369 #define APR_BRIGADE_INSERT_TAIL(b, e) do { \
370  apr_bucket *ap__b = (e); \
371  APR_RING_INSERT_TAIL(&(b)->list, ap__b, apr_bucket, link); \
372  APR_BRIGADE_CHECK_CONSISTENCY((b)); \
373  } while (0)
374 
380 #define APR_BRIGADE_CONCAT(a, b) do { \
381  APR_RING_CONCAT(&(a)->list, &(b)->list, apr_bucket, link); \
382  APR_BRIGADE_CHECK_CONSISTENCY((a)); \
383  } while (0)
384 
390 #define APR_BRIGADE_PREPEND(a, b) do { \
391  APR_RING_PREPEND(&(a)->list, &(b)->list, apr_bucket, link); \
392  APR_BRIGADE_CHECK_CONSISTENCY((a)); \
393  } while (0)
394 
400 #define APR_BUCKET_INSERT_BEFORE(a, b) do { \
401  apr_bucket *ap__a = (a), *ap__b = (b); \
402  APR_RING_INSERT_BEFORE(ap__a, ap__b, link); \
403  APR_BUCKET_CHECK_CONSISTENCY(ap__a); \
404  } while (0)
405 
411 #define APR_BUCKET_INSERT_AFTER(a, b) do { \
412  apr_bucket *ap__a = (a), *ap__b = (b); \
413  APR_RING_INSERT_AFTER(ap__a, ap__b, link); \
414  APR_BUCKET_CHECK_CONSISTENCY(ap__a); \
415  } while (0)
416 
422 #define APR_BUCKET_NEXT(e) APR_RING_NEXT((e), link)
423 
428 #define APR_BUCKET_PREV(e) APR_RING_PREV((e), link)
429 
434 #define APR_BUCKET_REMOVE(e) APR_RING_REMOVE((e), link)
435 
440 #define APR_BUCKET_INIT(e) APR_RING_ELEM_INIT((e), link)
441 
448 #define APR_BUCKET_IS_METADATA(e) ((e)->type->is_metadata)
449 
455 #define APR_BUCKET_IS_FLUSH(e) ((e)->type == &apr_bucket_type_flush)
456 
461 #define APR_BUCKET_IS_EOS(e) ((e)->type == &apr_bucket_type_eos)
462 
467 #define APR_BUCKET_IS_FILE(e) ((e)->type == &apr_bucket_type_file)
468 
473 #define APR_BUCKET_IS_PIPE(e) ((e)->type == &apr_bucket_type_pipe)
474 
479 #define APR_BUCKET_IS_SOCKET(e) ((e)->type == &apr_bucket_type_socket)
480 
485 #define APR_BUCKET_IS_HEAP(e) ((e)->type == &apr_bucket_type_heap)
486 
491 #define APR_BUCKET_IS_TRANSIENT(e) ((e)->type == &apr_bucket_type_transient)
492 
497 #define APR_BUCKET_IS_IMMORTAL(e) ((e)->type == &apr_bucket_type_immortal)
498 #if APR_HAS_MMAP
499 
504 #define APR_BUCKET_IS_MMAP(e) ((e)->type == &apr_bucket_type_mmap)
505 #endif
506 
511 #define APR_BUCKET_IS_POOL(e) ((e)->type == &apr_bucket_type_pool)
512 
513 /*
514  * General-purpose reference counting for the various bucket types.
515  *
516  * Any bucket type that keeps track of the resources it uses (i.e.
517  * most of them except for IMMORTAL, TRANSIENT, and EOS) needs to
518  * attach a reference count to the resource so that it can be freed
519  * when the last bucket that uses it goes away. Resource-sharing may
520  * occur because of bucket splits or buckets that refer to globally
521  * cached data. */
522 
533  int refcount;
534 };
535 
536 /* ***** Reference-counted bucket types ***** */
537 
549  char *base;
551  apr_size_t alloc_len;
553  void (*free_func)(void *data);
554 };
555 
579  const char *base;
586  apr_pool_t *pool;
591 };
592 
593 #if APR_HAS_MMAP
594 
603  apr_mmap_t *mmap;
604 };
605 #endif
606 
616  apr_file_t *fd;
619  apr_pool_t *readpool;
620 #if APR_HAS_MMAP
621 
623  int can_mmap;
624 #endif /* APR_HAS_MMAP */
625 
626  apr_size_t read_size;
627 };
628 
639 #if APR_HAS_MMAP
641 #endif
643 };
644 
650 #define APR_BUCKET_ALLOC_SIZE APR_ALIGN_DEFAULT(2*sizeof(apr_bucket_structs))
651 
652 /* ***** Bucket Brigade Functions ***** */
660 APU_DECLARE(apr_bucket_brigade *) apr_brigade_create(apr_pool_t *p,
661  apr_bucket_alloc_t *list);
662 
668 APU_DECLARE(apr_status_t) apr_brigade_destroy(apr_bucket_brigade *b);
669 
681 APU_DECLARE(apr_status_t) apr_brigade_cleanup(void *data);
682 
699  apr_bucket *e,
700  apr_bucket_brigade *a);
701 
714  apr_bucket *e);
715 
728 APU_DECLARE(apr_status_t) apr_brigade_partition(apr_bucket_brigade *b,
729  apr_off_t point,
730  apr_bucket **after_point);
731 
740 APU_DECLARE(apr_status_t) apr_brigade_length(apr_bucket_brigade *bb,
741  int read_all,
742  apr_off_t *length);
743 
751 APU_DECLARE(apr_status_t) apr_brigade_flatten(apr_bucket_brigade *bb,
752  char *c,
753  apr_size_t *len);
754 
762 APU_DECLARE(apr_status_t) apr_brigade_pflatten(apr_bucket_brigade *bb,
763  char **c,
764  apr_size_t *len,
765  apr_pool_t *pool);
766 
775 APU_DECLARE(apr_status_t) apr_brigade_split_line(apr_bucket_brigade *bbOut,
776  apr_bucket_brigade *bbIn,
777  apr_read_type_e block,
778  apr_off_t maxbytes);
779 
789 APU_DECLARE(apr_status_t) apr_brigade_to_iovec(apr_bucket_brigade *b,
790  struct iovec *vec, int *nvec);
791 
800 APU_DECLARE(apr_status_t) apr_brigade_vputstrs(apr_bucket_brigade *b,
801  apr_brigade_flush flush,
802  void *ctx,
803  va_list va);
804 
828 APU_DECLARE(apr_status_t) apr_brigade_write(apr_bucket_brigade *b,
829  apr_brigade_flush flush, void *ctx,
830  const char *str, apr_size_t nbyte);
831 
841 APU_DECLARE(apr_status_t) apr_brigade_writev(apr_bucket_brigade *b,
842  apr_brigade_flush flush,
843  void *ctx,
844  const struct iovec *vec,
845  apr_size_t nvec);
846 
855 APU_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb,
856  apr_brigade_flush flush, void *ctx,
857  const char *str);
858 
867 APU_DECLARE(apr_status_t) apr_brigade_putc(apr_bucket_brigade *b,
868  apr_brigade_flush flush, void *ctx,
869  const char c);
870 
879 APU_DECLARE_NONSTD(apr_status_t) apr_brigade_putstrs(apr_bucket_brigade *b,
880  apr_brigade_flush flush,
881  void *ctx, ...);
882 
893 APU_DECLARE_NONSTD(apr_status_t) apr_brigade_printf(apr_bucket_brigade *b,
894  apr_brigade_flush flush,
895  void *ctx,
896  const char *fmt, ...)
897  __attribute__((format(printf,4,5)));
898 
909 APU_DECLARE(apr_status_t) apr_brigade_vprintf(apr_bucket_brigade *b,
910  apr_brigade_flush flush,
911  void *ctx,
912  const char *fmt, va_list va);
913 
927  apr_file_t *f,
928  apr_off_t start,
929  apr_off_t len,
930  apr_pool_t *p);
931 
932 
933 
934 /* ***** Bucket freelist functions ***** */
948 APU_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create(apr_pool_t *p);
949 
958 APU_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create_ex(apr_allocator_t *allocator);
959 
964 APU_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t *list);
965 
974 APU_DECLARE_NONSTD(apr_size_t) apr_bucket_alloc_aligned_floor(apr_bucket_alloc_t *list,
975  apr_size_t size)
976  __attribute__((nonnull(1)));
977 
983 APU_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size, apr_bucket_alloc_t *list);
984 
989 APU_DECLARE_NONSTD(void) apr_bucket_free(void *block);
990 
991 
992 /* ***** Bucket Functions ***** */
999 #define apr_bucket_destroy(e) do { \
1000  (e)->type->destroy((e)->data); \
1001  (e)->free(e); \
1002  } while (0)
1003 
1015 #define apr_bucket_delete(e) do { \
1016  APR_BUCKET_REMOVE(e); \
1017  apr_bucket_destroy(e); \
1018  } while (0)
1019 
1087 #define apr_bucket_read(e,str,len,block) (e)->type->read(e, str, len, block)
1088 
1095 #define apr_bucket_setaside(e,p) (e)->type->setaside(e,p)
1096 
1107 #define apr_bucket_split(e,point) (e)->type->split(e, point)
1108 
1114 #define apr_bucket_copy(e,c) (e)->type->copy(e, c)
1115 
1116 /* Bucket type handling */
1117 
1127 APU_DECLARE_NONSTD(apr_status_t) apr_bucket_setaside_noop(apr_bucket *data,
1128  apr_pool_t *pool);
1129 
1137 APU_DECLARE_NONSTD(apr_status_t) apr_bucket_setaside_notimpl(apr_bucket *data,
1138  apr_pool_t *pool);
1139 
1147 APU_DECLARE_NONSTD(apr_status_t) apr_bucket_split_notimpl(apr_bucket *data,
1148  apr_size_t point);
1149 
1157 APU_DECLARE_NONSTD(apr_status_t) apr_bucket_copy_notimpl(apr_bucket *e,
1158  apr_bucket **c);
1159 
1169 APU_DECLARE_NONSTD(void) apr_bucket_destroy_noop(void *data);
1170 
1177 /* There is no apr_bucket_read_notimpl, because it is a required function
1178  */
1179 
1180 
1181 /* All of the bucket types implemented by the core */
1186 APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_flush;
1192 APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_eos;
1196 APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_file;
1201 APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_heap;
1202 #if APR_HAS_MMAP
1203 
1206 APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_mmap;
1207 #endif
1208 
1213 APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_pool;
1217 APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_pipe;
1223 APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_immortal;
1229 APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_transient;
1233 APU_DECLARE_DATA extern const apr_bucket_type_t apr_bucket_type_socket;
1234 
1235 
1236 /* ***** Simple buckets ***** */
1237 
1249 APU_DECLARE_NONSTD(apr_status_t) apr_bucket_simple_split(apr_bucket *b,
1250  apr_size_t point);
1251 
1262 APU_DECLARE_NONSTD(apr_status_t) apr_bucket_simple_copy(apr_bucket *a,
1263  apr_bucket **b);
1264 
1265 
1266 /* ***** Shared, reference-counted buckets ***** */
1267 
1282 APU_DECLARE(apr_bucket *) apr_bucket_shared_make(apr_bucket *b, void *data,
1283  apr_off_t start,
1284  apr_size_t length);
1285 
1294 APU_DECLARE(int) apr_bucket_shared_destroy(void *data);
1295 
1307 APU_DECLARE_NONSTD(apr_status_t) apr_bucket_shared_split(apr_bucket *b,
1308  apr_size_t point);
1309 
1319 APU_DECLARE_NONSTD(apr_status_t) apr_bucket_shared_copy(apr_bucket *a,
1320  apr_bucket **b);
1321 
1322 
1323 /* ***** Functions to Create Buckets of varying types ***** */
1324 /*
1325  * Each bucket type foo has two initialization functions:
1326  * apr_bucket_foo_make which sets up some already-allocated memory as a
1327  * bucket of type foo; and apr_bucket_foo_create which allocates memory
1328  * for the bucket, calls apr_bucket_make_foo, and initializes the
1329  * bucket's list pointers. The apr_bucket_foo_make functions are used
1330  * inside the bucket code to change the type of buckets in place;
1331  * other code should call apr_bucket_foo_create. All the initialization
1332  * functions change nothing if they fail.
1333  */
1334 
1342 
1350 APU_DECLARE(apr_bucket *) apr_bucket_eos_make(apr_bucket *b);
1351 
1360 
1368 APU_DECLARE(apr_bucket *) apr_bucket_flush_make(apr_bucket *b);
1369 
1377 APU_DECLARE(apr_bucket *) apr_bucket_immortal_create(const char *buf,
1378  apr_size_t nbyte,
1379  apr_bucket_alloc_t *list);
1380 
1389  const char *buf,
1390  apr_size_t nbyte);
1391 
1399 APU_DECLARE(apr_bucket *) apr_bucket_transient_create(const char *buf,
1400  apr_size_t nbyte,
1401  apr_bucket_alloc_t *list);
1402 
1411  const char *buf,
1412  apr_size_t nbyte);
1413 
1428 APU_DECLARE(apr_bucket *) apr_bucket_heap_create(const char *buf,
1429  apr_size_t nbyte,
1430  void (*free_func)(void *data),
1431  apr_bucket_alloc_t *list);
1441 APU_DECLARE(apr_bucket *) apr_bucket_heap_make(apr_bucket *b, const char *buf,
1442  apr_size_t nbyte,
1443  void (*free_func)(void *data));
1444 
1454 APU_DECLARE(apr_bucket *) apr_bucket_pool_create(const char *buf,
1455  apr_size_t length,
1456  apr_pool_t *pool,
1457  apr_bucket_alloc_t *list);
1458 
1467 APU_DECLARE(apr_bucket *) apr_bucket_pool_make(apr_bucket *b, const char *buf,
1468  apr_size_t length,
1469  apr_pool_t *pool);
1470 
1471 #if APR_HAS_MMAP
1472 
1481 APU_DECLARE(apr_bucket *) apr_bucket_mmap_create(apr_mmap_t *mm,
1482  apr_off_t start,
1483  apr_size_t length,
1484  apr_bucket_alloc_t *list);
1485 
1495 APU_DECLARE(apr_bucket *) apr_bucket_mmap_make(apr_bucket *b, apr_mmap_t *mm,
1496  apr_off_t start,
1497  apr_size_t length);
1498 #endif
1499 
1506 APU_DECLARE(apr_bucket *) apr_bucket_socket_create(apr_socket_t *thissock,
1507  apr_bucket_alloc_t *list);
1514 APU_DECLARE(apr_bucket *) apr_bucket_socket_make(apr_bucket *b,
1515  apr_socket_t *thissock);
1516 
1523 APU_DECLARE(apr_bucket *) apr_bucket_pipe_create(apr_file_t *thispipe,
1524  apr_bucket_alloc_t *list);
1525 
1532 APU_DECLARE(apr_bucket *) apr_bucket_pipe_make(apr_bucket *b,
1533  apr_file_t *thispipe);
1534 
1551 APU_DECLARE(apr_bucket *) apr_bucket_file_create(apr_file_t *fd,
1552  apr_off_t offset,
1553  apr_size_t len,
1554  apr_pool_t *p,
1555  apr_bucket_alloc_t *list);
1556 
1567 APU_DECLARE(apr_bucket *) apr_bucket_file_make(apr_bucket *b, apr_file_t *fd,
1568  apr_off_t offset,
1569  apr_size_t len, apr_pool_t *p);
1570 
1577 APU_DECLARE(apr_status_t) apr_bucket_file_enable_mmap(apr_bucket *b,
1578  int enabled);
1579 
1590 APU_DECLARE(apr_status_t) apr_bucket_file_set_buf_size(apr_bucket *e,
1591  apr_size_t size);
1592 
1594 #ifdef __cplusplus
1595 }
1596 #endif
1597 
1598 #endif /* !APR_BUCKETS_H */
apr_bucket_mmap::mmap
apr_mmap_t * mmap
Definition: apr_buckets.h:603
apr_bucket_flush_make
apr_bucket * apr_bucket_flush_make(apr_bucket *b)
apr_bucket_type_mmap
const apr_bucket_type_t apr_bucket_type_mmap
apr_bucket_file::can_mmap
int can_mmap
Definition: apr_buckets.h:623
apr_bucket_brigade::bucket_alloc
apr_bucket_alloc_t * bucket_alloc
Definition: apr_buckets.h:275
apr_bucket_alloc
void * apr_bucket_alloc(apr_size_t size, apr_bucket_alloc_t *list)
apr_bucket_alloc_destroy
void apr_bucket_alloc_destroy(apr_bucket_alloc_t *list)
apr_brigade_printf
apr_status_t apr_brigade_printf(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, const char *fmt,...)
APR_BLOCK_READ
@ APR_BLOCK_READ
Definition: apr_buckets.h:58
apr_bucket_pool_create
apr_bucket * apr_bucket_pool_create(const char *buf, apr_size_t length, apr_pool_t *pool, apr_bucket_alloc_t *list)
apr_bucket_file::readpool
apr_pool_t * readpool
Definition: apr_buckets.h:619
apr_bucket_type_immortal
const apr_bucket_type_t apr_bucket_type_immortal
apr_bucket_type_file
const apr_bucket_type_t apr_bucket_type_file
apr_bucket_alloc_create
apr_bucket_alloc_t * apr_bucket_alloc_create(apr_pool_t *p)
apr_bucket_type_eos
const apr_bucket_type_t apr_bucket_type_eos
apr_bucket_simple_copy
apr_status_t apr_bucket_simple_copy(apr_bucket *a, apr_bucket **b)
apr_bucket_mmap_make
apr_bucket * apr_bucket_mmap_make(apr_bucket *b, apr_mmap_t *mm, apr_off_t start, apr_size_t length)
apr_bucket_file::fd
apr_file_t * fd
Definition: apr_buckets.h:616
apr_bucket_immortal_make
apr_bucket * apr_bucket_immortal_make(apr_bucket *b, const char *buf, apr_size_t nbyte)
apr_bucket_heap_make
apr_bucket * apr_bucket_heap_make(apr_bucket *b, const char *buf, apr_size_t nbyte, void(*free_func)(void *data))
apr_brigade_partition
apr_status_t apr_brigade_partition(apr_bucket_brigade *b, apr_off_t point, apr_bucket **after_point)
apr_bucket_socket_make
apr_bucket * apr_bucket_socket_make(apr_bucket *b, apr_socket_t *thissock)
apr_bucket_heap::base
char * base
Definition: apr_buckets.h:549
apr_bucket_refcount::refcount
int refcount
Definition: apr_buckets.h:533
apr_bucket_split_notimpl
apr_status_t apr_bucket_split_notimpl(apr_bucket *data, apr_size_t point)
apr_bucket_structs::heap
apr_bucket_heap heap
Definition: apr_buckets.h:637
apr_bucket_type_t::name
const char * name
Definition: apr_buckets.h:135
apr_bucket_type_heap
const apr_bucket_type_t apr_bucket_type_heap
apr_bucket::length
apr_size_t length
Definition: apr_buckets.h:234
apr_brigade_create
apr_bucket_brigade * apr_brigade_create(apr_pool_t *p, apr_bucket_alloc_t *list)
apr_bucket_mmap_create
apr_bucket * apr_bucket_mmap_create(apr_mmap_t *mm, apr_off_t start, apr_size_t length, apr_bucket_alloc_t *list)
apr_brigade_length
apr_status_t apr_brigade_length(apr_bucket_brigade *bb, int read_all, apr_off_t *length)
apr_bucket::type
const apr_bucket_type_t * type
Definition: apr_buckets.h:228
apr_bucket_structs::mmap
apr_bucket_mmap mmap
Definition: apr_buckets.h:640
apr_bucket_setaside_noop
apr_status_t apr_bucket_setaside_noop(apr_bucket *data, apr_pool_t *pool)
apr_bucket_immortal_create
apr_bucket * apr_bucket_immortal_create(const char *buf, apr_size_t nbyte, apr_bucket_alloc_t *list)
apr_brigade_vputstrs
apr_status_t apr_brigade_vputstrs(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, va_list va)
apr_brigade_flatten
apr_status_t apr_brigade_flatten(apr_bucket_brigade *bb, char *c, apr_size_t *len)
apr_brigade_puts
apr_status_t apr_brigade_puts(apr_bucket_brigade *bb, apr_brigade_flush flush, void *ctx, const char *str)
apr_brigade_cleanup
apr_status_t apr_brigade_cleanup(void *data)
apr_bucket_shared_destroy
int apr_bucket_shared_destroy(void *data)
apr_bucket_type_t::copy
apr_status_t(* copy)(apr_bucket *e, apr_bucket **c)
Definition: apr_buckets.h:211
apr_bucket_flush_create
apr_bucket * apr_bucket_flush_create(apr_bucket_alloc_t *list)
apr_brigade_split_ex
apr_bucket_brigade * apr_brigade_split_ex(apr_bucket_brigade *b, apr_bucket *e, apr_bucket_brigade *a)
apr_bucket_heap_create
apr_bucket * apr_bucket_heap_create(const char *buf, apr_size_t nbyte, void(*free_func)(void *data), apr_bucket_alloc_t *list)
apr_brigade_split_line
apr_status_t apr_brigade_split_line(apr_bucket_brigade *bbOut, apr_bucket_brigade *bbIn, apr_read_type_e block, apr_off_t maxbytes)
apr_bucket_type_t::APR_BUCKET_DATA
@ APR_BUCKET_DATA
Definition: apr_buckets.h:153
apr_bucket_type_flush
const apr_bucket_type_t apr_bucket_type_flush
apr_bucket_mmap
Definition: apr_buckets.h:599
apr_bucket_destroy_noop
void apr_bucket_destroy_noop(void *data)
apr_bucket_pipe_make
apr_bucket * apr_bucket_pipe_make(apr_bucket *b, apr_file_t *thispipe)
apr_bucket_pool::heap
apr_bucket_heap heap
Definition: apr_buckets.h:573
apr_brigade_write
apr_status_t apr_brigade_write(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, const char *str, apr_size_t nbyte)
apr_bucket_type_t::APR_BUCKET_METADATA
@ APR_BUCKET_METADATA
Definition: apr_buckets.h:155
apr_bucket_type_t::setaside
apr_status_t(* setaside)(apr_bucket *e, apr_pool_t *pool)
Definition: apr_buckets.h:192
apr_bucket_structs::file
apr_bucket_file file
Definition: apr_buckets.h:642
apr_bucket_brigade
Definition: apr_buckets.h:258
apr_bucket_brigade::APR_RING_HEAD
APR_RING_HEAD(apr_bucket_list, apr_bucket) list
apr_bucket_pool::list
apr_bucket_alloc_t * list
Definition: apr_buckets.h:590
apr_bucket::data
void * data
Definition: apr_buckets.h:244
apr_bucket_eos_create
apr_bucket * apr_bucket_eos_create(apr_bucket_alloc_t *list)
apr_bucket_alloc_t
struct apr_bucket_alloc_t apr_bucket_alloc_t
Definition: apr_buckets.h:123
apr_bucket_type_t::destroy
void(* destroy)(void *data)
Definition: apr_buckets.h:164
apr_brigade_insert_file
apr_bucket * apr_brigade_insert_file(apr_bucket_brigade *bb, apr_file_t *f, apr_off_t start, apr_off_t len, apr_pool_t *p)
apr_bucket_transient_create
apr_bucket * apr_bucket_transient_create(const char *buf, apr_size_t nbyte, apr_bucket_alloc_t *list)
apr_bucket::start
apr_off_t start
Definition: apr_buckets.h:242
apr_bucket_heap
Definition: apr_buckets.h:543
apr_bucket_pipe_create
apr_bucket * apr_bucket_pipe_create(apr_file_t *thispipe, apr_bucket_alloc_t *list)
apr_bucket::free
void(* free)(void *e)
Definition: apr_buckets.h:252
apr_bucket_heap::free_func
void(* free_func)(void *data)
Definition: apr_buckets.h:553
apr_bucket_structs::b
apr_bucket b
Definition: apr_buckets.h:636
apr_brigade_destroy
apr_status_t apr_brigade_destroy(apr_bucket_brigade *b)
apr_bucket_socket_create
apr_bucket * apr_bucket_socket_create(apr_socket_t *thissock, apr_bucket_alloc_t *list)
apr_bucket_structs::pool
apr_bucket_pool pool
Definition: apr_buckets.h:638
apr_bucket_type_pool
const apr_bucket_type_t apr_bucket_type_pool
APR_NONBLOCK_READ
@ APR_NONBLOCK_READ
Definition: apr_buckets.h:59
apr_bucket_file::read_size
apr_size_t read_size
Definition: apr_buckets.h:626
apr_brigade_putc
apr_status_t apr_brigade_putc(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, const char c)
apr_bucket_copy_notimpl
apr_status_t apr_bucket_copy_notimpl(apr_bucket *e, apr_bucket **c)
apr_bucket_file::refcount
apr_bucket_refcount refcount
Definition: apr_buckets.h:614
apr_bucket_heap::alloc_len
apr_size_t alloc_len
Definition: apr_buckets.h:551
apr_bucket_shared_copy
apr_status_t apr_bucket_shared_copy(apr_bucket *a, apr_bucket **b)
apr_bucket_free
void apr_bucket_free(void *block)
apr_brigade_putstrs
apr_status_t apr_brigade_putstrs(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx,...)
apr_bucket_brigade::p
apr_pool_t * p
Definition: apr_buckets.h:264
apr_read_type_e
apr_read_type_e
Definition: apr_buckets.h:57
apr_bucket_type_t::is_metadata
enum apr_bucket_type_t::@0 is_metadata
apr_bucket_setaside_notimpl
apr_status_t apr_bucket_setaside_notimpl(apr_bucket *data, apr_pool_t *pool)
apr_bucket_shared_make
apr_bucket * apr_bucket_shared_make(apr_bucket *b, void *data, apr_off_t start, apr_size_t length)
apr_bucket_simple_split
apr_status_t apr_bucket_simple_split(apr_bucket *b, apr_size_t point)
apr_bucket_alloc_aligned_floor
apr_size_t apr_bucket_alloc_aligned_floor(apr_bucket_alloc_t *list, apr_size_t size)
apr_bucket_type_socket
const apr_bucket_type_t apr_bucket_type_socket
apr_bucket_pool_make
apr_bucket * apr_bucket_pool_make(apr_bucket *b, const char *buf, apr_size_t length, apr_pool_t *pool)
apr_bucket_type_pipe
const apr_bucket_type_t apr_bucket_type_pipe
apr_bucket_pool
Definition: apr_buckets.h:561
apr_brigade_pflatten
apr_status_t apr_brigade_pflatten(apr_bucket_brigade *bb, char **c, apr_size_t *len, apr_pool_t *pool)
apr_bucket_alloc_create_ex
apr_bucket_alloc_t * apr_bucket_alloc_create_ex(apr_allocator_t *allocator)
apr_bucket_type_t
Definition: apr_buckets.h:131
apr_bucket_heap::refcount
apr_bucket_refcount refcount
Definition: apr_buckets.h:545
apr_bucket_file_set_buf_size
apr_status_t apr_bucket_file_set_buf_size(apr_bucket *e, apr_size_t size)
apr_bucket_type_transient
const apr_bucket_type_t apr_bucket_type_transient
apr_brigade_split
apr_bucket_brigade * apr_brigade_split(apr_bucket_brigade *b, apr_bucket *e)
apr_brigade_vprintf
apr_status_t apr_brigade_vprintf(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, const char *fmt, va_list va)
apr_bucket_file
Definition: apr_buckets.h:612
apr_bucket_transient_make
apr_bucket * apr_bucket_transient_make(apr_bucket *b, const char *buf, apr_size_t nbyte)
apr_bucket_pool::pool
apr_pool_t * pool
Definition: apr_buckets.h:586
apr_brigade_writev
apr_status_t apr_brigade_writev(apr_bucket_brigade *b, apr_brigade_flush flush, void *ctx, const struct iovec *vec, apr_size_t nvec)
apr_bucket_file_create
apr_bucket * apr_bucket_file_create(apr_file_t *fd, apr_off_t offset, apr_size_t len, apr_pool_t *p, apr_bucket_alloc_t *list)
apr_bucket_mmap::refcount
apr_bucket_refcount refcount
Definition: apr_buckets.h:601
apr_bucket_refcount
Definition: apr_buckets.h:531
apr_bucket_pool::base
const char * base
Definition: apr_buckets.h:579
apr_brigade_flush
apr_status_t(* apr_brigade_flush)(apr_bucket_brigade *bb, void *ctx)
Definition: apr_buckets.h:282
apr_bucket::list
apr_bucket_alloc_t * list
Definition: apr_buckets.h:254
apr_bucket_type_t::read
apr_status_t(* read)(apr_bucket *b, const char **str, apr_size_t *len, apr_read_type_e block)
Definition: apr_buckets.h:176
apr_bucket_eos_make
apr_bucket * apr_bucket_eos_make(apr_bucket *b)
apr_bucket_type_t::split
apr_status_t(* split)(apr_bucket *e, apr_size_t point)
Definition: apr_buckets.h:203
apr_bucket_shared_split
apr_status_t apr_bucket_shared_split(apr_bucket *b, apr_size_t point)
apr_bucket
Definition: apr_buckets.h:224
apr_bucket_structs
Definition: apr_buckets.h:635
apr_bucket_file_make
apr_bucket * apr_bucket_file_make(apr_bucket *b, apr_file_t *fd, apr_off_t offset, apr_size_t len, apr_pool_t *p)
apr_bucket::APR_RING_ENTRY
APR_RING_ENTRY(apr_bucket) link
apr_brigade_to_iovec
apr_status_t apr_brigade_to_iovec(apr_bucket_brigade *b, struct iovec *vec, int *nvec)
apr_bucket_type_t::num_func
int num_func
Definition: apr_buckets.h:140
apr_bucket_file_enable_mmap
apr_status_t apr_bucket_file_enable_mmap(apr_bucket *b, int enabled)