]> granicus.if.org Git - apache/blob - include/http_protocol.h
*) Introduce "ap_conf_vector_t" type to assist with legibility and provide
[apache] / include / http_protocol.h
1 /* ====================================================================
2  * The Apache Software License, Version 1.1
3  *
4  * Copyright (c) 2000-2001 The Apache Software Foundation.  All rights
5  * reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in
16  *    the documentation and/or other materials provided with the
17  *    distribution.
18  *
19  * 3. The end-user documentation included with the redistribution,
20  *    if any, must include the following acknowledgment:
21  *       "This product includes software developed by the
22  *        Apache Software Foundation (http://www.apache.org/)."
23  *    Alternately, this acknowledgment may appear in the software itself,
24  *    if and wherever such third-party acknowledgments normally appear.
25  *
26  * 4. The names "Apache" and "Apache Software Foundation" must
27  *    not be used to endorse or promote products derived from this
28  *    software without prior written permission. For written
29  *    permission, please contact apache@apache.org.
30  *
31  * 5. Products derived from this software may not be called "Apache",
32  *    nor may "Apache" appear in their name, without prior written
33  *    permission of the Apache Software Foundation.
34  *
35  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
36  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
37  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
38  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
39  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
42  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
43  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
44  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
45  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46  * SUCH DAMAGE.
47  * ====================================================================
48  *
49  * This software consists of voluntary contributions made by many
50  * individuals on behalf of the Apache Software Foundation.  For more
51  * information on the Apache Software Foundation, please see
52  * <http://www.apache.org/>.
53  *
54  * Portions of this software are based upon public domain software
55  * originally written at the National Center for Supercomputing Applications,
56  * University of Illinois, Urbana-Champaign.
57  */
58
59 #ifndef APACHE_HTTP_PROTOCOL_H
60 #define APACHE_HTTP_PROTOCOL_H
61
62 #include "httpd.h"
63 #include "apr_hooks.h"
64 #include "apr_portable.h"
65 #include "apr_mmap.h"
66 #include "apr_buckets.h"
67
68 #ifdef __cplusplus
69 extern "C" {
70 #endif
71
72 /**
73  * @package HTTP protocol handling
74  */
75
76 /*
77  * Prototypes for routines which either talk directly back to the user,
78  * or control the ones that eventually do.
79  */
80
81 /**
82  * Read a request and fill in the fields.
83  * @param c The current connection
84  * @return The new request_rec
85  */ 
86 request_rec *ap_read_request(conn_rec *c);
87
88 /**
89  * Send the minimal part of an HTTP response header.
90  * @param r The current request
91  * @param bb The brigade to add the header to.
92  * @warning Modules should be very careful about using this, and should 
93  *          prefer ap_send_http_header().  Much of the HTTP/1.1 implementation 
94  *          correctness depends on code in ap_send_http_header().
95  * @deffunc void ap_basic_http_header(request_rec *r, apr_bucket_brigade *bb)
96  */
97 AP_DECLARE(void) ap_basic_http_header(request_rec *r, apr_bucket_brigade *bb);
98
99 /**
100  * Send the Status-Line and header fields for HTTP response
101  * @param r The current request
102  * @deffunc void ap_send_http_header(request_rec *r)
103  */
104 AP_DECLARE(void) ap_send_http_header(request_rec *r);
105
106 /* Send the response to special method requests */
107
108 AP_DECLARE(int) ap_send_http_trace(request_rec *r);
109 int ap_send_http_options(request_rec *r);
110
111 /* Finish up stuff after a request */
112
113 /**
114  * Called at completion of sending the response.  It sends the terminating
115  * protocol information.
116  * @param r The current request
117  * @deffunc void ap_finalize_request_protocol(request_rec *r)
118  */
119 AP_DECLARE(void) ap_finalize_request_protocol(request_rec *r);
120
121 /**
122  * Send error back to client.
123  * @param r The current request
124  * @param recursive_error last arg indicates error status in case we get 
125  *      an error in the process of trying to deal with an ErrorDocument 
126  *      to handle some other error.  In that case, we print the default 
127  *      report for the first thing that went wrong, and more briefly report 
128  *      on the problem with the ErrorDocument.
129  * @deffunc void ap_send_error_response(request_rec *r, int recursive_error)
130  */
131 AP_DECLARE(void) ap_send_error_response(request_rec *r, int recursive_error);
132
133 /* Set last modified header line from the lastmod date of the associated file.
134  * Also, set content length.
135  *
136  * May return an error status, typically HTTP_NOT_MODIFIED (that when the
137  * permit_cache argument is set to one).
138  */
139
140 /**
141  * Set the content length for this request
142  * @param r The current request
143  * @param length The new content length
144  * @deffunc void ap_set_content_length(request_rec *r, apr_off_t length)
145  */
146 AP_DECLARE(void) ap_set_content_length(request_rec *r, apr_off_t length);
147
148 /**
149  * Set the keepalive status for this request
150  * @param r The current request
151  * @return 1 if keepalive can be set, 0 otherwise
152  * @deffunc int ap_set_keepalive(request_rec *r)
153  */
154 AP_DECLARE(int) ap_set_keepalive(request_rec *r);
155
156 /**
157  * Return the latest rational time from a request/mtime pair.  Mtime is 
158  * returned unless it's in the future, in which case we return the current time.
159  * @param r The current request
160  * @param mtime The last modified time
161  * @return the latest rational time.
162  * @deffunc apr_time_t ap_rationalize_mtime(request_rec *r, apr_time_t mtime)
163  */
164 AP_DECLARE(apr_time_t) ap_rationalize_mtime(request_rec *r, apr_time_t mtime);
165
166 /**
167  * Construct an entity tag from the resource information.  If it's a real
168  * file, build in some of the file characteristics.
169  * @param r The current request
170  * @param force_weak Force the entity tag to be weak - it could be modified
171  *                   again in as short an interval.
172  * @return The entity tag
173  * @deffunc char *ap_make_etag(request_rec *r, int force_weak)
174  */ 
175 AP_DECLARE(char *) ap_make_etag(request_rec *r, int force_weak);
176
177 /**
178  * Set the E-tag outgoing header
179  * @param The current request
180  * @deffunc void ap_set_etag(request_rec *r)
181  */
182 AP_DECLARE(void) ap_set_etag(request_rec *r);
183
184 /**
185  * Set the last modified time for the file being sent
186  * @param r The current request
187  * @deffunc void ap_set_last_modified(request_rec *r)
188  */
189 AP_DECLARE(void) ap_set_last_modified(request_rec *r);
190
191 /**
192  * Implements condition GET rules for HTTP/1.1 specification.  This function
193  * inspects the client headers and determines if the response fulfills 
194  * the requirements specified.
195  * @param r The current request
196  * @return 1 if the response fulfills the condition GET rules, 0 otherwise
197  * @deffunc int ap_meets_conditions(request_rec *r)
198  */
199 AP_DECLARE(int) ap_meets_conditions(request_rec *r);
200
201 /* Other ways to send stuff at the client.  All of these keep track
202  * of bytes_sent automatically.  This indirection is intended to make
203  * it a little more painless to slide things like HTTP-NG packetization
204  * underneath the main body of the code later.  In the meantime, it lets
205  * us centralize a bit of accounting (bytes_sent).
206  *
207  * These also return the number of bytes written by the call.
208  * They should only be called with a timeout registered, for obvious reaasons.
209  * (Ditto the send_header stuff).
210  */
211
212 /**
213  * Send an entire file to the client, using sendfile if supported by the 
214  * current platform
215  * @param fd The file to send.
216  * @param r The current request
217  * @param offset Offset into the file to start sending.
218  * @param length Amount of data to send
219  * @param nbytes Amount of data actually sent
220  * @deffunc apr_status_t ap_send_fd(apr_file_t *fd, request_rec *r, apr_off_t offset, apr_size_t length, apr_size_t *nbytes);
221  */
222 AP_DECLARE(apr_status_t) ap_send_fd(apr_file_t *fd, request_rec *r, apr_off_t offset, 
223                                    apr_size_t length, apr_size_t *nbytes);
224
225 #if APR_HAS_MMAP
226 /**
227  * Send an MMAP'ed file to the client
228  * @param mm The MMAP'ed file to send
229  * @param r The current request
230  * @param offset The offset into the MMAP to start sending
231  * @param length The amount of data to send
232  * @return The number of bytes sent
233  * @deffunc size_t ap_send_mmap(apr_mmap_t *mm, request_rec *r, size_t offset, size_t length)
234  */
235 AP_DECLARE(size_t) ap_send_mmap(apr_mmap_t *mm, request_rec *r, size_t offset,
236                              size_t length);
237 #endif
238
239 /**
240  * Create a new method list with the specified number of preallocated
241  * slots for extension methods.
242  *
243  * @param   p       Pointer to a pool in which the structure should be
244  *                  allocated.
245  * @param   nelts   Number of preallocated extension slots
246  * @return  Pointer to the newly created structure.
247  * @deffunc ap_method_list_t ap_make_method_list(apr_pool_t *p, int nelts)
248  */
249 AP_DECLARE(ap_method_list_t *) ap_make_method_list(apr_pool_t *p, int nelts);
250 AP_DECLARE(void) ap_copy_method_list(ap_method_list_t *dest,
251                                      ap_method_list_t *src);
252 AP_DECLARE_NONSTD(void) ap_method_list_do(int (*comp) (void *urec, const char *mname,
253                                                        int mnum),
254                                           void *rec,
255                                           const ap_method_list_t *ml, ...);
256 AP_DECLARE(void) ap_method_list_vdo(int (*comp) (void *urec, const char *mname,
257                                                  int mnum),
258                                     void *rec, const ap_method_list_t *ml,
259                                     va_list vp);
260 /**
261  * Search for an HTTP method name in an ap_method_list_t structure, and
262  * return true if found.
263  *
264  * @param   method  String containing the name of the method to check.
265  * @param   l       Pointer to a method list, such as cmd->methods_limited.
266  * @return  1 if method is in the list, otherwise 0
267  * @deffunc int ap_method_in_list(const char *method, ap_method_list_t *l)
268  */
269 AP_DECLARE(int) ap_method_in_list(ap_method_list_t *l, const char *method);
270
271 /**
272  * Add an HTTP method name to an ap_method_list_t structure if it isn't
273  * already listed.
274  *
275  * @param   method  String containing the name of the method to check.
276  * @param   l       Pointer to a method list, such as cmd->methods_limited.
277  * @return  None.
278  * @deffunc void ap_method_in_list(ap_method_list_t *l, const char *method)
279  */
280 AP_DECLARE(void) ap_method_list_add(ap_method_list_t *l, const char *method);
281     
282 /**
283  * Remove an HTTP method name from an ap_method_list_t structure.
284  *
285  * @param   l       Pointer to a method list, such as cmd->methods_limited.
286  * @param   method  String containing the name of the method to remove.
287  * @return  None.
288  * @deffunc void ap_method_list_remove(ap_method_list_t *l, const char *method)
289  */
290 AP_DECLARE(void) ap_method_list_remove(ap_method_list_t *l,
291                                        const char *method);
292
293 /**
294  * Reset a method list to be completely empty.
295  *
296  * @param   l       Pointer to a method list, such as cmd->methods_limited.
297  * @return  None.
298  * @deffunc void ap_clear_method_list(ap_method_list_t *l)
299  */
300 AP_DECLARE(void) ap_clear_method_list(ap_method_list_t *l);
301     
302 /* Hmmm... could macrofy these for now, and maybe forever, though the
303  * definitions of the macros would get a whole lot hairier.
304  */
305
306 /**
307  * Output one character for this request
308  * @param c the character to output
309  * @param r the current request
310  * @return The number of bytes sent
311  * @deffunc int ap_rputc(int c, request_rec *r)
312  */
313 AP_DECLARE(int) ap_rputc(int c, request_rec *r);
314
315 /**
316  * Output a string for the current request
317  * @param str The string to output
318  * @param r The current request
319  * @return The number of bytes sent
320  * @deffunc int ap_rputs(const char *str, request_rec *r)
321  */
322 AP_DECLARE(int) ap_rputs(const char *str, request_rec *r);
323
324 /**
325  * Write a buffer for the current request
326  * @param buf The buffer to write
327  * @param nbyte The number of bytes to send from the buffer
328  * @param r The current request
329  * @return The number of bytes sent
330  * @deffunc int ap_rwrite(const void *buf, int nbyte, request_rec *r)
331  */
332 AP_DECLARE(int) ap_rwrite(const void *buf, int nbyte, request_rec *r);
333
334 /**
335  * Write an unspecified number of strings to the request
336  * @param r The current request
337  * @param ... The strings to write
338  * @return The number of bytes sent
339  * @deffunc int ap_rvputs(request_rec *r, ...)
340  */
341 AP_DECLARE_NONSTD(int) ap_rvputs(request_rec *r,...);
342
343 /**
344  * Output data to the client in a printf format
345  * @param r The current request
346  * @param fmt The format string
347  * @param vlist The arguments to use to fill out the format string
348  * @return The number of bytes sent
349  * @deffunc int ap_vrprintf(request_rec *r, const char *fmt, va_list vlist)
350  */
351 AP_DECLARE(int) ap_vrprintf(request_rec *r, const char *fmt, va_list vlist);
352
353 /**
354  * Output data to the client in a printf format
355  * @param r The current request
356  * @param fmt The format string
357  * @param ... The arguments to use to fill out the format string
358  * @return The number of bytes sent
359  * @deffunc int ap_rprintf(request_rec *r, const char *fmt, ...)
360  */
361 AP_DECLARE_NONSTD(int) ap_rprintf(request_rec *r, const char *fmt,...)
362                                 __attribute__((format(printf,2,3)));
363 /**
364  * Flush all of the data for the current request to the client
365  * @param r The current request
366  * @return The number of bytes sent
367  * @deffunc int ap_rflush(request_rec *r)
368  */
369 AP_DECLARE(int) ap_rflush(request_rec *r);
370
371 /**
372  * Index used in custom_responses array for a specific error code
373  * (only use outside protocol.c is in getting them configured).
374  * @param status HTTP status code
375  * @return The index of the response
376  * @deffunc int ap_index_of_response(int status)
377  */
378 AP_DECLARE(int) ap_index_of_response(int status);
379
380 /** 
381  * Return the Status-Line for a given status code (excluding the
382  * HTTP-Version field). If an invalid or unknown status code is
383  * passed, "500 Internal Server Error" will be returned. 
384  * @param status The HTTP status code
385  * @return The Status-Line
386  * @deffunc const char *ap_get_status_line(int status)
387  */
388 AP_DECLARE(const char *) ap_get_status_line(int status);
389
390 /* Reading a block of data from the client connection (e.g., POST arg) */
391
392 /**
393  * Setup the client to allow Apache to read the request body.
394  * @param r The current request
395  * @param read_policy How the server should interpret a chunked 
396  *                    transfer-encoding.  One of: <PRE>
397  *    REQUEST_NO_BODY          Send 413 error if message has any body
398  *    REQUEST_CHUNKED_ERROR    Send 411 error if body without Content-Length
399  *    REQUEST_CHUNKED_DECHUNK  If chunked, remove the chunks for me.
400  * </PRE>
401  * @return either OK or an error code
402  * @deffunc int ap_setup_cleint_block(request_rec *r, int read_policy)
403  */
404 AP_DECLARE(int) ap_setup_client_block(request_rec *r, int read_policy);
405
406 /**
407  * Determine if the client has sent any data.  This also sends a 
408  * 100 Continue resposne to HTTP/1.1 clients, so modules should not be called
409  * until the module is ready to read content.
410  * @warning Never call this function more than once.
411  * @param r The current request
412  * @return 0 if there is no message to read, 1 otherwise
413  * @deffunc int ap_should_client_block(request_rec *r)
414  */
415 AP_DECLARE(int) ap_should_client_block(request_rec *r);
416
417 /**
418  * Call this in a loop.  It will put data into a buffer and return the length
419  * of the input block
420  * @param r The current request
421  * @param buffer The buffer in which to store the data
422  * @param bufsiz The size of the buffer
423  * @return Number of bytes inserted into the buffer.  When done reading, 0
424  *         if EOF, or -1 if there was an error
425  * @deffunc long ap_get_client_block(request_rec *r, char *buffer, int bufsiz)
426  */
427 AP_DECLARE(long) ap_get_client_block(request_rec *r, char *buffer, int bufsiz);
428
429 /**
430  * In HTTP/1.1, any method can have a body.  However, most GET handlers
431  * wouldn't know what to do with a request body if they received one.
432  * This helper routine tests for and reads any message body in the request,
433  * simply discarding whatever it receives.  We need to do this because
434  * failing to read the request body would cause it to be interpreted
435  * as the next request on a persistent connection.
436  * @param r The current request
437  * @return error status if request is malformed, OK otherwise 
438  * @deffunc int ap_discard_request_body(request_rec *r)
439  */
440 AP_DECLARE(int) ap_discard_request_body(request_rec *r);
441
442
443 /* Sending a byterange */
444
445 /**
446  * Setup the output headers so that the client knows how to authenticate
447  * itself the next time, if an authentication request failed.  This function
448  * works for both basic and digest authentication
449  * @param r The current request
450  * @deffunc void ap_note_auth_failure(request_rec *r)
451  */ 
452 AP_DECLARE(void) ap_note_auth_failure(request_rec *r);
453
454 /**
455  * Setup the output headers so that the client knows how to authenticate
456  * itself the next time, if an authentication request failed.  This function
457  * works only for basic authentication
458  * @param r The current request
459  * @deffunc void ap_note_basic_auth_failure(request_rec *r)
460  */ 
461 AP_DECLARE(void) ap_note_basic_auth_failure(request_rec *r);
462
463 /**
464  * Setup the output headers so that the client knows how to authenticate
465  * itself the next time, if an authentication request failed.  This function
466  * works only for digest authentication
467  * @param r The current request
468  * @deffunc void ap_note_digest_auth_failure(request_rec *r)
469  */ 
470 AP_DECLARE(void) ap_note_digest_auth_failure(request_rec *r);
471
472 /**
473  * Get the password from the request headers
474  * @param r The current request
475  * @param pw The password as set in the headers
476  * @return 0 (OK) if it set the 'pw' argument (and assured
477  *         a correct value in r->connection->user); otherwise it returns 
478  *         an error code, either HTTP_INTERNAL_SERVER_ERROR if things are 
479  *         really confused, HTTP_UNAUTHORIZED if no authentication at all 
480  *         seemed to be in use, or DECLINED if there was authentication but 
481  *         it wasn't Basic (in which case, the caller should presumably 
482  *         decline as well).
483  * @deffunc int ap_get_basic_auth_pw(request_rec *r, const char **pw)
484  */
485 AP_DECLARE(int) ap_get_basic_auth_pw(request_rec *r, const char **pw);
486
487 /*
488  * Setting up the protocol fields for subsidiary requests...
489  * Also, a wrapup function to keep the internal accounting straight.
490  */
491
492 void ap_set_sub_req_protocol(request_rec *rnew, const request_rec *r);
493 void ap_finalize_sub_req_protocol(request_rec *sub_r);
494
495 /**
496  * parse_uri: break apart the uri
497  * @warning Side Effects: <PRE>
498  *    - sets r->args to rest after '?' (or NULL if no '?')
499  *    - sets r->uri to request uri (without r->args part)
500  *    - sets r->hostname (if not set already) from request (scheme://host:port)
501  * </PRE>
502  * @param r The current request
503  * @param uri The uri to break apart
504  * @deffunc void ap_parse_uri(request_rec *r, const char *uri)
505  */
506 AP_CORE_DECLARE(void) ap_parse_uri(request_rec *r, const char *uri);
507
508 AP_CORE_DECLARE(int) ap_getline(char *s, int n, request_rec *r, int fold);
509
510 /**
511  * Get the method number associated with the given string, assumed to
512  * contain an HTTP method.  Returns M_INVALID if not recognized.
513  * @param method A string containing a valid HTTP method
514  * @return The method number
515  * @deffunc int ap_method_number_of(const char *method)
516  */
517 AP_DECLARE(int) ap_method_number_of(const char *method);
518
519 /**
520  * Get the method name associated with the given internal method
521  * number.  Returns NULL if not recognized.
522  * @param methnum An integer value corresponding to an internal method number
523  * @return The name corresponding to the method number
524  * @deffunc const char *ap_method_name_of(int methnum)
525  */
526 AP_DECLARE(const char *) ap_method_name_of(int methnum);
527
528
529   /* Hooks */
530   /*
531    * post_read_request --- run right after read_request or internal_redirect,
532    *                  and not run during any subrequests.
533    */
534 /**
535  * This hook allows modules to affect the request immediately after the request
536  * has been read, and before any other phases have been processes.  This allows
537  * modules to make decisions based upon the input header fields
538  * @param r The current request
539  * @return OK or DECLINED
540  * @deffunc ap_run_post_read_request(request_rec *r)
541  */
542 AP_DECLARE_HOOK(int,post_read_request,(request_rec *r))
543
544 /**
545  * This hook allows modules to perform any module-specific logging activities
546  * over and above the normal server things.
547  * @param r The current request
548  * @return OK, DECLINED, or HTTP_...
549  * @deffunc int ap_run_log_transaction(request_rec *r)
550  */
551 AP_DECLARE_HOOK(int,log_transaction,(request_rec *r))
552
553 /**
554  * This hook allows modules to retrieve the http method from a request.  This
555  * allows Apache modules to easily extend the methods that Apache understands
556  * @param r The current request
557  * @return The http method from the request
558  * @deffunc const char *ap_run_http_method(const request_rec *r)
559  */
560 AP_DECLARE_HOOK(const char *,http_method,(const request_rec *r))
561
562 /**
563  * Return the default port from the current request
564  * @param r The current request
565  * @return The current port
566  * @deffunc apr_port_t ap_run_default_port(const request_rec *r)
567  */
568 AP_DECLARE_HOOK(apr_port_t,default_port,(const request_rec *r))
569
570 typedef struct ap_bucket_error ap_bucket_error;
571
572 /**
573  * A bucket referring to an HTTP error
574  * This bucket can be passed down the filter stack to indicate that an
575  * HTTP error occurred while running a filter.  In order for this bucket
576  * to be used successfully, it MUST be sent as the first bucket in the
577  * first brigade to be sent from a given filter.
578  */
579 struct ap_bucket_error {
580     /** The error code */
581     int status;
582     /** The error string */
583     const char    *start;
584 };
585
586 AP_DECLARE_DATA extern const apr_bucket_type_t ap_bucket_type_error;
587
588 /**
589  * Make the bucket passed in an error bucket
590  * @param b The bucket to make into an error bucket
591  * @param error The HTTP error code to put in the bucket. 
592  * @param buf An optional error string to put in the bucket.
593  * @param p A pool to allocate out of.
594  * @return The new bucket, or NULL if allocation failed
595  * @deffunc apr_bucket *ap_bucket_error_make(apr_bucket *b, int error, const char *buf, apr_pool_t *p)
596  */
597 AP_DECLARE(apr_bucket *) ap_bucket_error_make(apr_bucket *b, int error,
598                 const char *buf, apr_pool_t *p);
599
600 /**
601  * Create a bucket referring to an HTTP error.
602  * @param error The HTTP error code to put in the bucket. 
603  * @param buf An optional error string to put in the bucket.
604  * @param p A pool to allocate out of.
605  * @return The new bucket, or NULL if allocation failed
606  * @deffunc apr_bucket *ap_bucket_error_create(int error, const char *buf, apr_pool_t *p)
607  */
608 AP_DECLARE(apr_bucket *) ap_bucket_error_create(int error,
609                 const char *buf, apr_pool_t *p);
610
611 #ifdef __cplusplus
612 }
613 #endif
614
615 #endif  /* !APACHE_HTTP_PROTOCOL_H */