2
0

apr_buckets_eos.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
  2. * applicable.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * 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. */
  16. #include "apr_buckets.h"
  17. static apr_status_t eos_bucket_read(apr_bucket *b, const char **str,
  18. apr_size_t *len, apr_read_type_e block)
  19. {
  20. *str = NULL;
  21. *len = 0;
  22. return APR_SUCCESS;
  23. }
  24. APU_DECLARE(apr_bucket *) apr_bucket_eos_make(apr_bucket *b)
  25. {
  26. b->length = 0;
  27. b->start = 0;
  28. b->data = NULL;
  29. b->type = &apr_bucket_type_eos;
  30. return b;
  31. }
  32. APU_DECLARE(apr_bucket *) apr_bucket_eos_create(apr_bucket_alloc_t *list)
  33. {
  34. apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
  35. APR_BUCKET_INIT(b);
  36. b->free = apr_bucket_free;
  37. b->list = list;
  38. return apr_bucket_eos_make(b);
  39. }
  40. APU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_eos = {
  41. "EOS", 5, APR_BUCKET_METADATA,
  42. apr_bucket_destroy_noop,
  43. eos_bucket_read,
  44. apr_bucket_setaside_noop,
  45. apr_bucket_split_notimpl,
  46. apr_bucket_simple_copy
  47. };