A brief file description. More...
#include "ink_config.h"
#include "P_Net.h"
#include "Main.h"
#include "Error.h"
#include "HttpConfig.h"
#include "HttpSessionAccept.h"
#include "ReverseProxy.h"
#include "HttpSessionManager.h"
#include "HttpUpdateSM.h"
#include "HttpClientSession.h"
#include "HttpPages.h"
#include "HttpTunnel.h"
#include "Tokenizer.h"
#include "P_SSLNextProtocolAccept.h"
#include "ProtocolProbeSessionAccept.h"
#include "SpdySessionAccept.h"
#include "http2/Http2SessionAccept.h"
Go to the source code of this file.
Data Structures | |
struct | HttpProxyAcceptor |
Data about an acceptor. More... | |
Functions | |
bool | ssl_register_protocol (const char *protocol, Continuation *contp) |
bool | ssl_unregister_protocol (const char *protocol, Continuation *contp) |
NetProcessor::AcceptOptions | make_net_accept_options (const HttpProxyPort &port, unsigned nthreads) |
static void | MakeHttpProxyAcceptor (HttpProxyAcceptor &acceptor, HttpProxyPort &port, unsigned nthreads) |
void | init_HttpProxyServer (int n_accept_threads) |
Set up all the accepts and sockets. | |
void | start_HttpProxyServer () |
Start the proxy server. | |
void | start_HttpProxyServerBackDoor (int port, int accept_threads) |
Variables | |
HttpSessionAccept * | plugin_http_accept = NULL |
HttpSessionAccept * | plugin_http_transparent_accept = 0 |
static SLL< SSLNextProtocolAccept > | ssl_plugin_acceptors |
static ink_mutex | ssl_plugin_mutex = PTHREAD_MUTEX_INITIALIZER |
Vec< HttpProxyAcceptor > | HttpProxyAcceptors |
Global acceptors. |
A brief file description.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file HttpProxyServerMain.cc.
void init_HttpProxyServer | ( | int | n_accept_threads | ) |
Set up all the accepts and sockets.
Initialize all HTTP proxy port data structures needed to run.
Definition at line 239 of file HttpProxyServerMain.cc.
References Vec< C, A, S >::add(), debug_cs_list_mutex, debug_sm_list_mutex, HttpProxyPort::global(), http_pages_init(), httpSessionManager, icp_dynamic_enabled, HttpSessionManager::init(), init_reverse_proxy(), ink_mutex_init(), Vec< C, A, S >::length(), MakeHttpProxyAcceptor(), Continuation::mutex, new_ProxyMutex(), detail::HttpSessionAcceptOptions::setOutboundTransparent(), and ssl_plugin_mutex.
Referenced by main().
NetProcessor::AcceptOptions make_net_accept_options | ( | const HttpProxyPort & | port, | |
unsigned | nthreads | |||
) |
Definition at line 116 of file HttpProxyServerMain.cc.
References NetProcessor::AcceptOptions::accept_threads, NetProcessor::AcceptOptions::f_inbound_transparent, HttpConfigParams::inbound_ip4, HttpConfigParams::inbound_ip6, NetProcessor::AcceptOptions::ip_family, IpAddr::isIp4(), IpAddr::isIp6(), IpAddr::isValid(), NetProcessor::AcceptOptions::local_ip, NetProcessor::AcceptOptions::local_port, HttpProxyPort::m_family, HttpProxyPort::m_inbound_ip, HttpProxyPort::m_inbound_transparent_p, HttpConfig::m_master, and HttpProxyPort::m_port.
Referenced by MakeHttpProxyAcceptor(), TSPluginDescriptorAccept(), and TSPortDescriptorAccept().
static void MakeHttpProxyAcceptor | ( | HttpProxyAcceptor & | acceptor, | |
HttpProxyPort & | port, | |||
unsigned | nthreads | |||
) | [static] |
Definition at line 138 of file HttpProxyServerMain.cc.
References HttpProxyAcceptor::_accept, HttpProxyAcceptor::_net_opt, SessionProtocolSet::contains(), detail::HttpSessionAcceptOptions::f_outbound_transparent, HTTP2_PROTOCOL_SET, HTTP_PROTOCOL_SET, SessionProtocolSet::intersects(), HttpProxyPort::isSSL(), IpAddr::isValid(), HttpProxyPort::m_host_res_preference, HttpConfig::m_master, HttpProxyPort::m_outbound_ip4, HttpProxyPort::m_outbound_ip6, HttpProxyPort::m_outbound_transparent_p, HttpProxyPort::m_session_protocol_preference, HttpProxyPort::m_transparent_passthrough, HttpProxyPort::m_type, make_net_accept_options(), HttpConfigParams::outbound_ip4, detail::HttpSessionAcceptOptions::outbound_ip4, HttpConfigParams::outbound_ip6, detail::HttpSessionAcceptOptions::outbound_ip6, NetProcessor::AcceptOptions::packet_mark, NetProcessor::AcceptOptions::packet_tos, probe(), ProtocolProbeSessionAcceptEnums::PROTO_HTTP, ProtocolProbeSessionAcceptEnums::PROTO_HTTP2, ProtocolProbeSessionAcceptEnums::PROTO_SPDY, SLL< C, L >::push(), REC_ReadConfigInteger, NetProcessor::AcceptOptions::recv_bufsize, SSLNextProtocolAccept::registerEndpoint(), ProtocolProbeSessionAccept::registerEndpoint(), NetProcessor::AcceptOptions::send_bufsize, spdy::SESSION_VERSION_3, spdy::SESSION_VERSION_3_1, detail::HttpSessionAcceptOptions::setHostResPreference(), detail::HttpSessionAcceptOptions::setSessionProtocolPreference(), detail::HttpSessionAcceptOptions::setTransparentPassthrough(), SPDY_PROTOCOL_SET, ssl_plugin_mutex, detail::HttpSessionAcceptOptions::transport_type, TS_NPN_PROTOCOL_HTTP_1_0, TS_NPN_PROTOCOL_HTTP_1_1, TS_NPN_PROTOCOL_HTTP_2_0, TS_NPN_PROTOCOL_INDEX_HTTP_1_0, TS_NPN_PROTOCOL_INDEX_HTTP_1_1, TS_NPN_PROTOCOL_INDEX_HTTP_2_0, TS_NPN_PROTOCOL_INDEX_SPDY_3, TS_NPN_PROTOCOL_INDEX_SPDY_3_1, TS_NPN_PROTOCOL_SPDY_3, and TS_NPN_PROTOCOL_SPDY_3_1.
Referenced by init_HttpProxyServer().
bool ssl_register_protocol | ( | const char * | protocol, | |
Continuation * | contp | |||
) |
Definition at line 49 of file HttpProxyServerMain.cc.
References SLL< C, L >::head, SLL< C, L >::next(), and ssl_plugin_mutex.
bool ssl_unregister_protocol | ( | const char * | protocol, | |
Continuation * | contp | |||
) |
Definition at line 64 of file HttpProxyServerMain.cc.
References SLL< C, L >::head, SLL< C, L >::next(), and ssl_plugin_mutex.
void start_HttpProxyServer | ( | ) |
Start the proxy server.
The port data should have been created by init_HttpProxyServer()
.
Definition at line 276 of file HttpProxyServerMain.cc.
References HttpProxyAcceptor::_accept, HttpProxyAcceptor::_net_opt, FeatureAPIHooks< ID, N >::get(), HttpProxyPort::global(), init_http_update_test(), ink_assert, APIHook::invoke(), is_action_tag_set, HttpProxyPort::isPlugin(), HttpProxyPort::isSSL(), Vec< C, A, S >::length(), lifecycle_hooks, HttpProxyPort::m_fd, NetProcessor::main_accept(), netProcessor, APIHook::next(), sslNetProcessor, TS_EVENT_LIFECYCLE_PORTS_READY, and TS_LIFECYCLE_PORTS_READY_HOOK.
Referenced by CB_After_Cache_Init(), and main().
void start_HttpProxyServerBackDoor | ( | int | port, | |
int | accept_threads | |||
) |
Definition at line 318 of file HttpProxyServerMain.cc.
References NetProcessor::AcceptOptions::accept_threads, NetProcessor::AcceptOptions::backdoor, detail::HttpSessionAcceptOptions::backdoor, NetProcessor::AcceptOptions::local_port, NetProcessor::AcceptOptions::localhost_only, NetProcessor::main_accept(), netProcessor, and NO_FD.
Referenced by main().
Global acceptors.
This is parallel to HttpProxyPort::global()
, each generated from the corresponding port descriptor.
Definition at line 112 of file HttpProxyServerMain.cc.
HttpSessionAccept* plugin_http_accept = NULL |
Definition at line 42 of file HttpProxyServerMain.cc.
Definition at line 43 of file HttpProxyServerMain.cc.
SLL<SSLNextProtocolAccept> ssl_plugin_acceptors [static] |
Definition at line 45 of file HttpProxyServerMain.cc.
ink_mutex ssl_plugin_mutex = PTHREAD_MUTEX_INITIALIZER [static] |
Definition at line 46 of file HttpProxyServerMain.cc.
Referenced by init_HttpProxyServer(), MakeHttpProxyAcceptor(), ssl_register_protocol(), and ssl_unregister_protocol().