1
/* Copyright 2012 Google Inc.
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at
7
* http://www.apache.org/licenses/LICENSE-2.0
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
16
/* This is a public header file, to be used by other Apache modules. So,
17
* identifiers declared here should follow Apache module naming conventions
18
* (specifically, identifiers should be lowercase_with_underscores, and our
19
* identifiers should start with the spdy_ prefix), and this header file must
20
* be valid in old-school C (not just C++). */
22
#ifndef MOD_SPDY_APACHE_SLAVE_CONNECTION_API_H_
23
#define MOD_SPDY_APACHE_SLAVE_CONNECTION_API_H_
26
#include "apr_optional.h"
32
struct ap_filter_rec_t;
34
struct spdy_slave_connection_factory;
35
struct spdy_slave_connection;
37
/** Creates a factory object that can be used to make in-process pseudo-fetches
38
* with the same origin and target hosts as in master_connection
40
APR_DECLARE_OPTIONAL_FN(
41
struct spdy_slave_connection_factory*,
42
spdy_create_slave_connection_factory, (conn_rec* master_connection));
44
/** Destroys a factory object. */
45
APR_DECLARE_OPTIONAL_FN(
46
void, spdy_destroy_slave_connection_factory,
47
(struct spdy_slave_connection_factory* factory));
49
/** Asks mod_spdy to help with fetching a request on a slave connection.
50
* The input_filter must produce the request, and output_filter must
51
* handle the response. May return NULL if functionality is not available.
52
* The request will not be run until spdy_run_slave_connection() is invoked.
54
APR_DECLARE_OPTIONAL_FN(
55
struct spdy_slave_connection*,
56
spdy_create_slave_connection, (
57
struct spdy_slave_connection_factory* factory,
58
struct ap_filter_rec_t* input_filter,
59
void* input_filter_ctx,
60
struct ap_filter_rec_t* output_filter,
61
void* output_filter_ctx));
63
/** Actually performs the fetch on the object. Blocks, perhaps for a significant
65
APR_DECLARE_OPTIONAL_FN(
66
void, spdy_run_slave_connection, (struct spdy_slave_connection* conn));
68
/** Cleans up the connection object. Must not be in active use. */
69
APR_DECLARE_OPTIONAL_FN(
70
void, spdy_destroy_slave_connection, (struct spdy_slave_connection*));
72
/* Used by mod_spdy to setup the exports. Not exported itself */
73
void ModSpdyExportSlaveConnectionFunctions(void);
79
#endif /* MOD_SPDY_APACHE_SLAVE_CONNECTION_API_H_ */