#include "squid.h"

Go to the source code of this file.
Classes | |
struct | _f |
struct | _request |
Macros | |
#define | CHANGE_FD_SETSIZE 1 |
#define | PROXY_PORT 3128 |
#define | PROXY_ADDR "127.0.0.1" |
#define | READ_BUF_SZ 4096 |
#define | RFC1123_STRFTIME "%a, %d %b %Y %H:%M:%S GMT" |
Typedefs | |
typedef void() | CB(int, void *) |
Functions | |
static void | free_request (struct _request *r) |
char * | mkrfc1123 (time_t *t) |
void | fd_close (int fd) |
void | fd_open (int fd, CB *cb, void *data, CB *ccb) |
void | sig_intr (int sig) |
void | read_reply (int fd, void *data) |
void | reply_done (int fd, void *data) |
struct _request * | request (char *urlin) |
void | read_url (int fd, void *junk) |
void | usage (void) |
int | main (int argc, argv) |
Variables | |
static int | proxy_port = PROXY_PORT |
static char * | proxy_addr = PROXY_ADDR |
static char * | progname |
static int | reqpersec |
static int | nrequests |
static int | opt_ims = 0 |
static int | opt_range = 0 |
static int | opt_accel = 0 |
static int | max_connections = 64 |
static time_t | lifetime = 60 |
static time_t | process_lifetime = 86400 |
static struct timeval | now |
static long long | total_bytes_written = 0 |
static long long | total_bytes_read = 0 |
static int | opt_checksum = 0 |
static char * | custom_header = NULL |
FILE * | trace_file = NULL |
struct _f | FD [SQUID_MAXFD] |
int | nfds = 0 |
int | maxfd = 0 |
Macro Definition Documentation
◆ CHANGE_FD_SETSIZE
#define CHANGE_FD_SETSIZE 1 |
Definition at line 17 of file tcp-banger2.c.
◆ PROXY_ADDR
#define PROXY_ADDR "127.0.0.1" |
Definition at line 83 of file tcp-banger2.c.
◆ PROXY_PORT
#define PROXY_PORT 3128 |
Definition at line 82 of file tcp-banger2.c.
◆ READ_BUF_SZ
#define READ_BUF_SZ 4096 |
Definition at line 84 of file tcp-banger2.c.
◆ RFC1123_STRFTIME
#define RFC1123_STRFTIME "%a, %d %b %Y %H:%M:%S GMT" |
Definition at line 140 of file tcp-banger2.c.
Typedef Documentation
◆ CB
typedef void() CB(int, void *) |
Definition at line 104 of file tcp-banger2.c.
Function Documentation
◆ fd_close()
void fd_close | ( | int | fd | ) |
Definition at line 153 of file tcp-banger2.c.
References _f::cb, _f::ccb, _f::data, FD, maxfd, nfds, and NULL.
Referenced by main(), read_reply(), read_url(), and sig_intr().
◆ fd_open()
◆ free_request()
|
static |
Definition at line 133 of file tcp-banger2.c.
References _request::url.
Referenced by reply_done(), and request().
◆ main()
Definition at line 474 of file tcp-banger2.c.
References assert, _f::cb, custom_header, FD, fd_close(), fd_open(), getopt(), int, last, lifetime, max_connections, maxfd, nfds, now, nrequests, NULL, opt_accel, opt_checksum, opt_ims, opt_range, optarg, process_lifetime, progname, proxy_addr, proxy_port, read_url(), reqpersec, sig_intr(), _f::start, total_bytes_read, trace_file, usage(), and xstrdup.
◆ mkrfc1123()
char* mkrfc1123 | ( | time_t * | t | ) |
Definition at line 142 of file tcp-banger2.c.
References RFC1123_STRFTIME.
◆ read_reply()
void read_reply | ( | int | fd, |
void * | data | ||
) |
Definition at line 192 of file tcp-banger2.c.
References assert, _request::bodysize, _request::buf, _request::content_length, _request::fd, fd_close(), _request::headfound, nrequests, NULL, opt_checksum, READ_BUF_SZ, reqpersec, _request::status, _request::sum, total_bytes_read, and _request::url.
Referenced by read_url().
◆ read_url()
void read_url | ( | int | fd, |
void * | junk | ||
) |
Definition at line 436 of file tcp-banger2.c.
References _request::buf, _request::fd, fd_close(), fd_open(), max_connections, nfds, NULL, read_reply(), reply_done(), and request().
Referenced by main().
◆ reply_done()
void reply_done | ( | int | fd, |
void * | data | ||
) |
Definition at line 259 of file tcp-banger2.c.
References _request::bodysize, _request::content_length, free_request(), _request::method, opt_checksum, opt_range, _request::requestbodyfile, _request::status, _request::sum, trace_file, _request::url, _request::validsize, _request::validstatus, and _request::validsum.
Referenced by read_url().
◆ request()
struct _request* request | ( | char * | urlin | ) |
Definition at line 291 of file tcp-banger2.c.
References assert, _request::buf, _request::content_length, custom_header, _request::fd, free_request(), int, _request::method, mkrfc850(), NULL, opt_accel, opt_ims, opt_range, proxy_addr, proxy_port, _request::requestbodyfile, size, _request::status, total_bytes_written, _request::url, _request::validsize, _request::validstatus, _request::validsum, and xstrdup.
Referenced by Ipc::Forwarder::~Forwarder(), Adaptation::ServiceFilter::~ServiceFilter(), Auth::UserRequest::AddReplyAuthHeader(), StoreEntry::adjustVary(), Ftp::Gateway::appendSuccessHeader(), assembleVaryKey(), Auth::UserRequest::authenticate(), AuthenticateAcl(), authenticateAuthenticateUser(), authTryGetUser(), Http::Tunneler::bailOnResponseError(), ConnStateData::BorrowPinnedConnection(), ConnStateData::borrowPinnedConnection(), ConnStateData::buildFakeRequest(), Http::One::Server::buildHttpRequest(), Http::Stream::buildRangeHeader(), clientReplyContext::buildReplyHeader(), Downloader::buildRequest(), Ftp::Gateway::buildTitleUrl(), HttpReply::calcMaxBodySize(), carpSelectParent(), Security::PeerConnector::certDownloadNestingLevel(), Ftp::Gateway::checkAuth(), Ssl::PeekingPeerConnector::checkForPeekAndSplice(), Ssl::PeekingPeerConnector::checkForPeekAndSpliceGuess(), Ssl::PeekingPeerConnector::checkForPeekAndSpliceMatched(), Ftp::Gateway::checkUrlpath(), Adaptation::Icap::ModXact::clearError(), clientBeginRequest(), clientBuildError(), clientCheckPinning(), clientFollowXForwardedForCheck(), clientHierarchical(), clientInterpretRequestHeaders(), Adaptation::Ecap::XactionRep::clientIpValue(), clientProcessRequest(), clientProcessRequestFinished(), clientSetKeepaliveFlag(), Security::PeerConnector::commCloseHandler(), Security::PeerConnector::commTimeoutHandler(), Ftp::Gateway::completedListing(), copyOneHeaderFromClientsideRequestToUpstreamRequest(), Ipc::Forwarder::DequeueRequest(), Ipc::Inquirer::DequeueRequest(), Adaptation::Icap::ModXact::detailError(), Ipc::Forwarder::doneAll(), Ftp::Server::doProcessRequest(), HttpReply::expectedBodyTooLarge(), ConnStateData::fakeAConnectRequest(), Security::PeerConnector::fillChecklist(), FindGoodListeningPortAddress(), Ftp::Relay::forwardPreliminaryReply(), Ftp::Gateway::ftpAuthRequired(), Ftp::Gateway::ftpRealm(), get_url(), getDefaultParent(), Ssl::ErrorDetailsManager::getErrorDetail(), getFirstUpParent(), GetMarkingsToServer(), GetNfmarkToServer(), getOutgoingAddress(), getRoundRobinParent(), GetTosToServer(), getWeightedRoundRobinParent(), gopher_request_parse(), Ipc::Coordinator::handleCacheMgrRequest(), Ipc::Strand::handleCacheMgrRequest(), Http::Tunneler::handleConnectionClosure(), Ftp::Relay::handleControlReply(), Ssl::HandleGeneratorReply(), Rock::IoState::handleReadCompletion(), Http::Tunneler::handleReadyRead(), Ipc::Forwarder::handleRemoteAck(), Ipc::Inquirer::handleRemoteAck(), Ftp::Server::handleRequest(), Http::Tunneler::handleResponse(), Ipc::Coordinator::handleSearchRequest(), Ssl::PeekingPeerConnector::handleServerCertificate(), Ipc::Coordinator::handleSharedListenRequest(), Ipc::Coordinator::handleSnmpRequest(), Ipc::Strand::handleSnmpRequest(), Http::Tunneler::handleTimeout(), Ftp::Server::handleUploadRequest(), Rock::SwapDir::handleWriteCompletionProblem(), Rock::SwapDir::handleWriteCompletionSuccess(), Http::Tunneler::handleWrittenRequest(), StoreEntry::hasIfMatchEtag(), StoreEntry::hasIfNoneMatchEtag(), Auth::UserRequest::helperRequestKeyExtras(), htcpClrStore(), httpFixupAuthentication(), httpHdrAdd(), httpHdrMangle(), httpHdrMangleList(), httpHeaderInitModule(), httpMakeVaryMark(), httpRequestPack(), Security::BlindPeerConnector::initialize(), Security::PeerConnector::initialize(), Ssl::PeekingPeerConnector::initialize(), ConnStateData::initiateTunneledRequest(), Ipc::Inquirer::inquire(), internalStart(), Auth::SchemeConfig::isCP1251EncodingAllowed(), TemplateFile::loadFor(), main(), Adaptation::Icap::ModXact::makeRequestHeaders(), Adaptation::Icap::ModXact::makeUsernameHeader(), Adaptation::Ecap::XactionRep::masterxSharedValue(), ACLAnnotateClientStrategy::match(), ACLAnnotateTransactionStrategy::match(), ACLNoteStrategy::match(), ACLAdaptationServiceStrategy::match(), Note::match(), Adaptation::Ecap::XactionRep::metaValue(), neighborsDigestSelect(), neighborsUdpPing(), netdbClosestParent(), Ssl::PeekingPeerConnector::noteNegotiationDone(), Security::PeerConnector::noteNegotiationError(), Ftp::Server::notePeerConnection(), Ipc::Coordinator::notifySearcher(), IpcIoFile::open(), Ipc::Coordinator::openListenSocket(), Adaptation::ServiceFilter::operator=(), CacheManager::ParseHeaders(), Adaptation::Icap::ModXact::parseIcapHead(), Ftp::Server::parseOneRequest(), ConnStateData::parseTlsHandshake(), peerAllowedToUse(), peerDigestLookup(), peerNoteDigestLookup(), peerSelect(), peerSelectIcpPing(), peerSourceHashSelectParent(), peerUserHashSelectParent(), peerWouldBePinged(), ConnStateData::pinBusyConnection(), ConnStateData::pinConnection(), Http::One::Server::pipelinePrefetchMax(), ConnStateData::postHttpsAccept(), prepareLogWithRequestDetails(), Http::One::Server::processParsedRequest(), Ftp::Gateway::processReplyBody(), ConnStateData::quitAfterError(), DiskThreadsDiskFile::read(), Rock::IoState::read_(), read_url(), Rock::SwapDir::readCompleted(), DiskThreadsDiskFile::readDone(), HttpReply::receivedBodyTooLarge(), refreshCheck(), refreshCheckHTCP(), refreshCheckHTTP(), refreshCheckICP(), Ipc::Inquirer::requestTimedOut(), ResetMarkingsToServer(), Mgr::Action::respond(), Mgr::FunAction::respond(), Mgr::InfoAction::respond(), Ftp::Gateway::restartable(), schemesConfig(), SendSharedListenRequest(), ConnStateData::serveDelayedError(), Ssl::PeekingPeerConnector::serverCertificateVerified(), Ftp::Server::setDataCommand(), Http::One::Server::setReplyError(), ConnStateData::splice(), squidaio_cancel(), squidaio_debug(), squidaio_poll_done(), squidaio_queue_request(), squidaio_thread_loop(), Security::PeerConnector::sslCrtvdCheckForErrors(), Security::PeerConnector::sslCrtvdHandleReply(), Security::PeerConnector::sslFinalized(), Adaptation::Ecap::XactionRep::start(), Adaptation::Iterator::start(), Ftp::Gateway::start(), Http::Tunneler::start(), Ipc::Forwarder::start(), Ipc::Inquirer::start(), Security::PeerConnector::start(), CacheManager::start(), Auth::UserRequest::start(), PeerSelectionInitiator::startSelectingDestinations(), Ssl::PeekingPeerConnector::startTunneling(), Ipc::Inquirer::status(), Adaptation::Iterator::step(), storeKeyPublicByRequest(), storeKeyPublicByRequestMethod(), Ssl::Helper::Submit(), Ssl::CertValidationHelper::Submit(), Adaptation::Ecap::XactionRep::swanSong(), Http::Tunneler::swanSong(), Ipc::Forwarder::swanSong(), Ipc::Inquirer::swanSong(), Security::PeerConnector::swanSong(), ConnStateData::switchToHttps(), Auth::UserRequest::tryToAuthenticateAndSetAuthUser(), ConnStateData::tunnelOnError(), Adaptation::Ecap::XactionRep::updateHistory(), UpdateRequestNotes(), Adaptation::Ecap::XactionRep::updateSources(), urlCanonicalFakeHttps(), Ftp::UrlWith2f(), Adaptation::Ecap::XactionRep::usernameValue(), varyEvaluateMatch(), Security::ErrorDetail::verbose(), Adaptation::Icap::ModXact::virginRequest(), Adaptation::Ecap::XactionRep::visitEachMetaHeader(), Rock::SwapDir::writeCompleted(), DiskThreadsDiskFile::writeDone(), Ftp::Server::writeErrorReply(), and Http::Tunneler::writeRequest().
◆ sig_intr()
void sig_intr | ( | int | sig | ) |
Definition at line 183 of file tcp-banger2.c.
References fd_close(), and nfds.
Referenced by main().
◆ usage()
void usage | ( | void | ) |
Variable Documentation
◆ custom_header
|
static |
Definition at line 101 of file tcp-banger2.c.
◆ FD
struct _f FD[SQUID_MAXFD] |
Definition at line 104 of file tcp-banger2.c.
Referenced by fd_close(), fd_open(), and main().
◆ lifetime
|
static |
Definition at line 95 of file tcp-banger2.c.
Referenced by main().
◆ max_connections
|
static |
Definition at line 94 of file tcp-banger2.c.
Referenced by Adaptation::Icap::Options::configure(), main(), and read_url().
◆ maxfd
int maxfd = 0 |
Definition at line 130 of file tcp-banger2.c.
Referenced by comm_check_incoming_select_handlers(), fd_close(), fd_open(), and main().
◆ nfds
int nfds = 0 |
Definition at line 129 of file tcp-banger2.c.
Referenced by comm_check_incoming_poll_handlers(), comm_check_incoming_select_handlers(), comm_poll_dns_incoming(), comm_poll_tcp_incoming(), comm_poll_udp_incoming(), comm_select_dns_incoming(), comm_select_tcp_incoming(), comm_select_udp_incoming(), fd_close(), fd_open(), main(), read_url(), and sig_intr().
◆ now
|
static |
Definition at line 96 of file tcp-banger2.c.
Referenced by ConservativeTimer::expired(), fd_open(), LogTime(), main(), main_loop(), processActivity(), Icmp4::Recv(), Icmp6::Recv(), session_login(), time_since(), and vlog().
◆ nrequests
|
static |
Definition at line 90 of file tcp-banger2.c.
Referenced by main(), main_loop(), and read_reply().
◆ opt_accel
|
static |
Definition at line 93 of file tcp-banger2.c.
◆ opt_checksum
|
static |
Definition at line 100 of file tcp-banger2.c.
Referenced by main(), read_reply(), and reply_done().
◆ opt_ims
|
static |
Definition at line 91 of file tcp-banger2.c.
◆ opt_range
|
static |
Definition at line 92 of file tcp-banger2.c.
Referenced by main(), reply_done(), and request().
◆ process_lifetime
|
static |
Definition at line 96 of file tcp-banger2.c.
Referenced by main().
◆ progname
|
static |
Definition at line 88 of file tcp-banger2.c.
◆ proxy_addr
|
static |
Definition at line 87 of file tcp-banger2.c.
◆ proxy_port
|
static |
Definition at line 86 of file tcp-banger2.c.
◆ reqpersec
|
static |
Definition at line 89 of file tcp-banger2.c.
Referenced by main(), main_loop(), and read_reply().
◆ total_bytes_read
|
static |
Definition at line 99 of file tcp-banger2.c.
Referenced by main(), and read_reply().
◆ total_bytes_written
|
static |
Definition at line 98 of file tcp-banger2.c.
Referenced by request().
◆ trace_file
FILE* trace_file = NULL |
Definition at line 102 of file tcp-banger2.c.
Referenced by main(), and reply_done().