-*- coding: utf-8 -*-
Changes with Apache 2.5.0
+ *) mpm_event[opt]: Send the SSL close notify alert when the KeepAliveTimeout
+ expires. PR54998. [Yann Ylavic]
+
*) mod_ssl: Ensure that the SSL close notify alert is flushed to the client.
PR54998. [Tim Kosse <tim.kosse filezilla-project.org>, Yann Ylavic]
* ap_mpm_query(), and suspended_baton to conn_rec
* 20140207.6 (2.5.0-dev) Added ap_log_common().
* 20140207.7 (2.5.0-dev) Added ap_force_set_tz().
+ * 20140207.8 (2.5.0-dev) Added ap_shutdown_conn().
*/
#define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20140207
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 7 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 8 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
*/
AP_CORE_DECLARE(void) ap_process_connection(conn_rec *c, void *csd);
+/**
+ * Shutdown the connection for writing.
+ * @param c The connection to shutdown
+ * @param flush Whether or not to flush pending data before
+ * @return APR_SUCCESS or the underlying error
+ */
+AP_CORE_DECLARE(apr_status_t) ap_shutdown_conn(conn_rec *c, int flush);
+
/**
* Flushes all remain data in the client send buffer
* @param c The connection to flush
+ * @remark calls ap_shutdown_conn(c, 1)
*/
AP_CORE_DECLARE(void) ap_flush_conn(conn_rec *c);
#define MAX_SECS_TO_LINGER 30
#endif
-AP_CORE_DECLARE(void) ap_flush_conn(conn_rec *c)
+AP_CORE_DECLARE(apr_status_t) ap_shutdown_conn(conn_rec *c, int flush)
{
+ apr_status_t rv;
apr_bucket_brigade *bb;
apr_bucket *b;
bb = apr_brigade_create(c->pool, c->bucket_alloc);
- /* FLUSH bucket */
- b = apr_bucket_flush_create(c->bucket_alloc);
- APR_BRIGADE_INSERT_TAIL(bb, b);
+ if (flush) {
+ /* FLUSH bucket */
+ b = apr_bucket_flush_create(c->bucket_alloc);
+ APR_BRIGADE_INSERT_TAIL(bb, b);
+ }
/* End Of Connection bucket */
b = ap_bucket_eoc_create(c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb, b);
- ap_pass_brigade(c->output_filters, bb);
+ rv = ap_pass_brigade(c->output_filters, bb);
+ apr_brigade_destroy(bb);
+ return rv;
+}
+
+AP_CORE_DECLARE(void) ap_flush_conn(conn_rec *c)
+{
+ (void)ap_shutdown_conn(c, 1);
}
/* we now proceed to read from the client until we get EOF, or until
apr_socket_t *csd = cs->pfd.desc.s;
if (c->aborted
+ || ap_shutdown_conn(c, 0) != APR_SUCCESS || c->aborted
|| apr_socket_shutdown(csd, APR_SHUTDOWN_WRITE) != APR_SUCCESS) {
apr_socket_close(csd);
apr_pool_clear(cs->p);
apr_socket_t *csd = cs->pfd.desc.s;
if (c->aborted
+ || ap_shutdown_conn(c, 0) != APR_SUCCESS || c->aborted
|| apr_socket_shutdown(csd, APR_SHUTDOWN_WRITE) != APR_SUCCESS) {
apr_socket_close(csd);
apr_pool_clear(cs->p);