Main Page | Modules | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

eoc_bucket.c

Go to the documentation of this file.
00001 /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
00002  * applicable.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #include "httpd.h"
00018 #include "http_connection.h"
00019 
00020 static apr_status_t eoc_bucket_read(apr_bucket *b, const char **str, 
00021                                     apr_size_t *len, apr_read_type_e block)
00022 {
00023     *str = NULL;
00024     *len = 0;
00025     return APR_SUCCESS;
00026 }
00027 
00028 AP_DECLARE(apr_bucket *) ap_bucket_eoc_make(apr_bucket *b)
00029 {
00030     b->length      = 0;
00031     b->start       = 0;
00032     b->data        = NULL;
00033     b->type        = &ap_bucket_type_eoc;
00034     
00035     return b;
00036 }
00037 
00038 AP_DECLARE(apr_bucket *) ap_bucket_eoc_create(apr_bucket_alloc_t *list)
00039 {
00040     apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
00041 
00042     APR_BUCKET_INIT(b);
00043     b->free = apr_bucket_free;
00044     b->list = list;
00045     return ap_bucket_eoc_make(b);
00046 }
00047 
00048 AP_DECLARE_DATA const apr_bucket_type_t ap_bucket_type_eoc = {
00049     "EOC", 5, APR_BUCKET_METADATA,
00050     apr_bucket_destroy_noop,
00051     eoc_bucket_read,
00052     apr_bucket_setaside_noop,
00053     apr_bucket_split_notimpl,
00054     apr_bucket_simple_copy
00055 };