|
Squid Web Cache master
|
#include "squid.h"#include "acl/FilledChecklist.h"#include "base/AsyncCallbacks.h"#include "base/CbcPointer.h"#include "base/JobWait.h"#include "base/Raw.h"#include "CachePeer.h"#include "cbdata.h"#include "client_side.h"#include "client_side_request.h"#include "clients/HttpTunneler.h"#include "comm.h"#include "comm/Connection.h"#include "comm/ConnOpener.h"#include "comm/Read.h"#include "comm/Write.h"#include "errorpage.h"#include "fd.h"#include "fde.h"#include "FwdState.h"#include "globals.h"#include "HappyConnOpener.h"#include "http.h"#include "http/StatusCode.h"#include "http/Stream.h"#include "HttpRequest.h"#include "icmp/net_db.h"#include "ip/QosConfig.h"#include "LogTags.h"#include "MemBuf.h"#include "neighbors.h"#include "PeerSelectState.h"#include "ResolvedPeers.h"#include "sbuf/SBuf.h"#include "security/BlindPeerConnector.h"#include "SquidConfig.h"#include "StatCounters.h"#include "ssl/bio.h"#include "ssl/ServerBump.h"#include "tools.h"#include "tunnel.h"#include "DelayId.h"#include <climits>#include <cerrno>Go to the source code of this file.
Classes | |
| class | TunnelStateData |
| class | TunnelStateData::Connection |
Variables | |
| static ERCB | tunnelErrorComplete |
| static CLCB | tunnelServerClosed |
| static CLCB | tunnelClientClosed |
| static CTCB | tunnelTimeout |
| static EVH | tunnelDelayedClientRead |
| static EVH | tunnelDelayedServerRead |
|
static |
Definition at line 431 of file tunnel.cc.
References Assure, and ClientHttpRequest::request.
|
static |
Definition at line 310 of file tunnel.cc.
References TunnelStateData::Connection::conn, TunnelStateData::Connection::delayedLoops, TunnelStateData::Connection::dirty, Comm::Connection::id, TunnelStateData::Connection::len, TunnelStateData::Connection::readPending, TunnelStateData::Connection::receivedEof, TunnelStateData::Connection::side, and TunnelStateData::Connection::writer.
| void switchToTunnel | ( | HttpRequest * | request, |
| const Comm::ConnectionPointer & | clientConn, | ||
| const Comm::ConnectionPointer & | srvConn, | ||
| const SBuf & | preReadServerData | ||
| ) |
Sets up a TCP tunnel through Squid and starts shoveling traffic.
| request | the request that initiated/caused this tunnel |
| clientConn | the already accepted client-to-Squid TCP connection |
| srvConn | the already established Squid-to-server TCP connection |
| preReadServerData | server-sent bytes to be forwarded to the client |
Definition at line 1615 of file tunnel.cc.
References StatCounters::all, HttpRequest::clientConnectionManager, TunnelStateData::commitToServer(), debugs, DelayId::DelayClient(), Comm::Connection::fd, CbcPointer< Cbc >::get(), TunnelStateData::getHost(), Comm::Connection::getPeer(), HttpRequest::hier, Http::Message::http_ver, Comm::IsConnOpen(), HttpRequest::method, Must, CachePeer::no_delay, CachePeer::options, StatCounters::other, HttpRequest::prepForDirect(), HttpRequest::prepForPeering(), TunnelStateData::preReadServerData, TunnelStateData::request, StatCounters::requests, HierarchyLogEntry::resetPeerNotes(), StatCounters::server, TunnelStateData::server, TunnelStateData::Connection::setDelayId(), statCounter, and tunnelStartShoveling().
Referenced by Http::One::Server::noteTakeServerConnectionControl(), and Ssl::PeekingPeerConnector::startTunneling().
|
static |
Definition at line 359 of file tunnel.cc.
References TunnelStateData::clientClosed(), and CommCommonCbParams::data.
|
static |
All the pieces we need to write to client and/or server connection have been written. Call the tunnelStartShoveling to start the blind pump.
Definition at line 1080 of file tunnel.cc.
References TunnelStateData::client, debugs, Comm::Connection::fd, CbcPointer< Cbc >::get(), ClientHttpRequest::Out::headers_sz, TunnelStateData::http, Comm::OK, ClientHttpRequest::out, Http::scInternalServerError, ClientHttpRequest::Out::size, TunnelStateData::status_ptr, tunnelErrorComplete, tunnelStartShoveling(), and TunnelStateData::Connection::writer.
Referenced by TunnelStateData::notePeerReadyToShovel().
|
static |
Definition at line 952 of file tunnel.cc.
References TunnelStateData::client, TunnelStateData::codeContext, TunnelStateData::copyRead(), CodeContext::Current(), debugs, TunnelStateData::ReadClient(), TunnelStateData::Connection::readPending, CodeContext::Reset(), and TunnelStateData::server.
|
static |
Definition at line 968 of file tunnel.cc.
References TunnelStateData::client, TunnelStateData::codeContext, TunnelStateData::copyRead(), CodeContext::Current(), debugs, TunnelStateData::Connection::readPending, TunnelStateData::ReadServer(), CodeContext::Reset(), and TunnelStateData::server.
Definition at line 1172 of file tunnel.cc.
References assert, TunnelStateData::client, Comm::Connection::close(), TunnelStateData::Connection::conn, debugs, Comm::IsConnOpen(), and TunnelStateData::server.
|
static |
Definition at line 341 of file tunnel.cc.
References CommCommonCbParams::data, and TunnelStateData::serverClosed().
| void tunnelStart | ( | ClientHttpRequest * | http | ) |
Definition at line 1259 of file tunnel.cc.
References SquidConfig::accessList, ACLFilledChecklist::al, ClientHttpRequest::al, StatCounters::all, HttpRequest::client_addr, Server::clientConnection, AccessLogEntry::HttpDetails::code, Config, debugs, DelayId::DelayClient(), Acl::Answer::denied(), ERR_FORWARDING_DENIED, errorSend(), ACLChecklist::fastCheck(), ClientHttpRequest::getConn(), AccessLogEntry::http, TunnelStateData::http, Http::Message::http_ver, Ip::Address::isNoAddr(), LOG_TCP_TUNNEL, ClientHttpRequest::log_uri, HttpRequest::method, SquidConfig::miss, ACLFilledChecklist::my_addr, HttpRequest::my_addr, MYNAME, StatCounters::other, ClientHttpRequest::request, TunnelStateData::request, StatCounters::requests, Http::scForbidden, StatCounters::server, TunnelStateData::server, TunnelStateData::Connection::setDelayId(), ACLFilledChecklist::src_addr, PeerSelectionInitiator::startSelectingDestinations(), statCounter, ACLFilledChecklist::syncAle(), ClientHttpRequest::updateLoggingTags(), ClientHttpRequest::uri, and TunnelStateData::url.
Referenced by ClientHttpRequest::processRequest().
|
static |
Set the HTTP status for this request and sets the read handlers for client and server side connections.
Definition at line 1042 of file tunnel.cc.
References SBuf::append(), assert, TunnelStateData::Connection::buf, cbdataReferenceValid(), TunnelStateData::client, commCbCall(), commSetConnTimeout(), Config, TunnelStateData::Connection::conn, SBuf::consume(), TunnelStateData::copy(), TunnelStateData::copyClientBytes(), TunnelStateData::copyServerBytes(), DBG_DATA, debugs, TunnelStateData::encryptionWait, ClientHttpRequest::getConn(), TunnelStateData::http, Server::inBuf, SBuf::isEmpty(), TunnelStateData::Connection::len, TunnelStateData::peerWait, TunnelStateData::preReadClientData, SquidConfig::read, Http::scOkay, TunnelStateData::server, TunnelStateData::status_ptr, SquidConfig::Timeout, TunnelStateData::transportWait, tunnelTimeout, CbcPointer< Cbc >::valid(), and TunnelStateData::WriteClientDone().
Referenced by TunnelStateData::notePeerReadyToShovel(), switchToTunnel(), and tunnelConnectedWriteDone().
|
static |
Definition at line 923 of file tunnel.cc.
References TunnelStateData::closeConnections(), CommCommonCbParams::conn, CommCommonCbParams::data, and debugs.
|
static |
Definition at line 305 of file tunnel.cc.
Referenced by TunnelStateData::TunnelStateData().
|
static |
Definition at line 307 of file tunnel.cc.
Referenced by TunnelStateData::TunnelStateData().
|
static |
Definition at line 308 of file tunnel.cc.
Referenced by TunnelStateData::TunnelStateData().
|
static |
Definition at line 303 of file tunnel.cc.
Referenced by TunnelStateData::sendError(), and tunnelConnectedWriteDone().
|
static |
Definition at line 304 of file tunnel.cc.
Referenced by TunnelStateData::commitToServer().
|
static |
Definition at line 306 of file tunnel.cc.
Referenced by TunnelStateData::TunnelStateData(), TunnelStateData::keepGoingAfterRead(), and tunnelStartShoveling().