apr_buckets_eos.c revision 251876
1251876Speter/* Licensed to the Apache Software Foundation (ASF) under one or more 2251876Speter * contributor license agreements. See the NOTICE file distributed with 3251876Speter * this work for additional information regarding copyright ownership. 4251876Speter * The ASF licenses this file to You under the Apache License, Version 2.0 5251876Speter * (the "License"); you may not use this file except in compliance with 6251876Speter * the License. You may obtain a copy of the License at 7251876Speter * 8251876Speter * http://www.apache.org/licenses/LICENSE-2.0 9251876Speter * 10251876Speter * Unless required by applicable law or agreed to in writing, software 11251876Speter * distributed under the License is distributed on an "AS IS" BASIS, 12251876Speter * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13251876Speter * See the License for the specific language governing permissions and 14251876Speter * limitations under the License. 15251876Speter */ 16251876Speter 17251876Speter#include "apr_buckets.h" 18251876Speter 19251876Speterstatic apr_status_t eos_bucket_read(apr_bucket *b, const char **str, 20251876Speter apr_size_t *len, apr_read_type_e block) 21251876Speter{ 22251876Speter *str = NULL; 23251876Speter *len = 0; 24251876Speter return APR_SUCCESS; 25251876Speter} 26251876Speter 27251876SpeterAPU_DECLARE(apr_bucket *) apr_bucket_eos_make(apr_bucket *b) 28251876Speter{ 29251876Speter b->length = 0; 30251876Speter b->start = 0; 31251876Speter b->data = NULL; 32251876Speter b->type = &apr_bucket_type_eos; 33251876Speter 34251876Speter return b; 35251876Speter} 36251876Speter 37251876SpeterAPU_DECLARE(apr_bucket *) apr_bucket_eos_create(apr_bucket_alloc_t *list) 38251876Speter{ 39251876Speter apr_bucket *b = apr_bucket_alloc(sizeof(*b), list); 40251876Speter 41251876Speter APR_BUCKET_INIT(b); 42251876Speter b->free = apr_bucket_free; 43251876Speter b->list = list; 44251876Speter return apr_bucket_eos_make(b); 45251876Speter} 46251876Speter 47251876SpeterAPU_DECLARE_DATA const apr_bucket_type_t apr_bucket_type_eos = { 48251876Speter "EOS", 5, APR_BUCKET_METADATA, 49251876Speter apr_bucket_destroy_noop, 50251876Speter eos_bucket_read, 51251876Speter apr_bucket_setaside_noop, 52251876Speter apr_bucket_split_notimpl, 53251876Speter apr_bucket_simple_copy 54251876Speter}; 55