MCPcopy Create free account
hub / github.com/apache/trafficserver / start_HttpProxyServer

Function start_HttpProxyServer

src/proxy/http/HttpProxyServerMain.cc:329–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327}
328
329void
330start_HttpProxyServer()
331{
332 static bool called_once = false;
333 HttpProxyPort::Group &proxy_ports = HttpProxyPort::global();
334
335 ///////////////////////////////////
336 // start accepting connections //
337 ///////////////////////////////////
338
339 ink_assert(!called_once);
340 ink_assert(proxy_ports.size() == HttpProxyAcceptors.size());
341
342 for (int i = 0, n = proxy_ports.size(); i < n; ++i) {
343 HttpProxyAcceptor &acceptor = HttpProxyAcceptors[i];
344 HttpProxyPort &port = proxy_ports[i];
345 if (port.isSSL()) {
346 if (nullptr == sslNetProcessor.main_accept(acceptor._accept, port.m_fd, acceptor._net_opt)) {
347 return;
348 }
349#if TS_USE_QUIC == 1
350 } else if (port.isQUIC()) {
351 if (nullptr == quic_NetProcessor.main_accept(acceptor._accept, port.m_fd, acceptor._net_opt)) {
352 return;
353 }
354#endif
355 } else if (!port.isPlugin()) {
356 if (nullptr == netProcessor.main_accept(acceptor._accept, port.m_fd, acceptor._net_opt)) {
357 return;
358 }
359 }
360 // XXX although we make a good pretence here, I don't believe that NetProcessor::main_accept() ever actually returns
361 // NULL. It would be useful to be able to detect errors and spew them here though.
362 }
363
364 // Alert plugins that connections will be accepted.
365 APIHook *hook = g_lifecycle_hooks->get(TS_LIFECYCLE_PORTS_READY_HOOK);
366 while (hook) {
367 hook->invoke(TS_EVENT_LIFECYCLE_PORTS_READY, nullptr);
368 hook = hook->next();
369 }
370
371 prewarmManager.start();
372}
373
374void
375stop_HttpProxyServer()

Callers 2

CB_After_Cache_InitFunction · 0.85
mainFunction · 0.85

Calls 9

isSSLMethod · 0.80
isQUICMethod · 0.80
isPluginMethod · 0.80
sizeMethod · 0.45
main_acceptMethod · 0.45
getMethod · 0.45
invokeMethod · 0.45
nextMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected