00001 /* 00002 * Phusion Passenger - http://www.modrails.com/ 00003 * Copyright (C) 2008 Phusion 00004 * 00005 * Phusion Passenger is a trademark of Hongli Lai & Ninh Bui. 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; version 2 of the License. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along 00017 * with this program; if not, write to the Free Software Foundation, Inc., 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00019 */ 00020 #ifndef _PASSENGER_BUCKET_H_ 00021 #define _PASSENGER_BUCKET_H_ 00022 00023 /** 00024 * apr_bucket_pipe closes a pipe's file descriptor when it has reached 00025 * end-of-stream, but not when an error has occurred. This behavior is 00026 * undesirable because it can easily cause file descriptor leaks. 00027 * 00028 * passenger_bucket is like apr_bucket_pipe, but it also holds a reference to 00029 * a Session. When a read error has occured or when end-of-stream has been 00030 * reached, the Session will be dereferenced, so that the underlying file 00031 * descriptor is closed. 00032 * 00033 * passenger_bucket also ignores the APR_NONBLOCK_READ flag because that's 00034 * known to cause strange I/O problems. 00035 */ 00036 00037 #include <apr_buckets.h> 00038 #include "Application.h" 00039 00040 apr_bucket *passenger_bucket_create(Passenger::Application::SessionPtr session, 00041 apr_file_t *pipe, 00042 apr_bucket_alloc_t *list); 00043 00044 #endif /* _PASSENGER_BUCKET_H_ */ 00045