Changes to squid-3.3.0.2 (03 Dec 2012):
- Support matching empty header field values using req_header and rep_header
- - ... and some minor code polish and input vaidations
+ - ... and some minor code polish and input validation
- ... and all changes from squid 3.2.4
Changes to squid-3.3.0.1 (21 Oct 2012):
fi
# Fixup autoconf recursion using --silent/--quiet option
-# autoconf should inherit this option whe recursing into subdirectories
+# autoconf should inherit this option when recursing into subdirectories
# but it currently doesn't for some reason.
if ! grep "configure_args --quiet" configure >/dev/null; then
echo "Fixing configure recursion"
\par Wrappers
Sometimes common and useful library functions are not always as safe as they could be.
An alternative which wraps the original in extra safety checks is provided under the
-same name with an 'x' pre-pended. Currently these extra protections are added on string
+same name with an 'x' prepended. Currently these extra protections are added on string
handling and memory allocation.
#define open _open /* Needed in win32lib.c */
#endif /* #ifdef __cplusplus */
-/* provide missing definitions from resoruce.h */
+/* provide missing definitions from resource.h */
/* NP: sys/resource.h and sys/time.h are apparently order-dependant. */
#if HAVE_SYS_TIME_H
#include <sys/time.h>
#endif /* HAVE_SHM */
-/// Determines whether segment names are iterpreted as full file paths.
+/// Determines whether segment names are interpreted as full file paths.
bool shm_portable_segment_name_is_path();
#endif /* SQUID_COMPAT_SHM_H */
/*
* Remove the last node in HP. Frees the heap internal structure and
- * returns the data pointes to by the last node.
+ * returns the data pointed to by the last node.
*/
heap_t
heap_extractlast(heap * hp)
typedef struct RFCNB_Con {
- int fd; /* File descripter for TCP/IP connection */
+ int fd; /* File descriptor for TCP/IP connection */
int errn; /* last error */
int timeout; /* How many milli-secs before IO times out */
int redirects; /* How many times we were redirected */
}
-If we wnat to find out the protocol that was negotiated then we can do the
+If we want to find out the protocol that was negotiated then we can do the
following:
protocol = SMB_Get_Protocol_IDX(con);
Portions\s
}xi;
-# We have persmission to move these frequent claims to CONTRIBUTORS.
+# We have permission to move these frequent claims to CONTRIBUTORS.
my $reClaimsOkToMove = qr{
Robert.Collins|<robertc\@squid-cache.org>|<rbtcollins\@hotmail.com>|
-actuall
-agains
-aline
+afile
alloced
+anfd
anid
ans
aparent
backwords
cachable
cas
+checkin
childs
-commend
+clen
+coexistance
crypted
dont
+eference
fo
followings
-formater
hight
hist
iff
-inactivate
-initate
+implementor
+inout
nd
-neeed
nnumber
normall
othere
pasttime
performes
pevents
-pointes
preceed
querys
readed
referer
-retuned
-sence
-sheme
+requestor
+requestors
+rin
+servent
+stylessheet
tage
te
tha
ue
uint
upto
-vaid
-valuse
-whan
whats
whe
wil
-wnat
// lower-level interface used by Checkout
MemBuf &checkOut(); // obtain raw buffer
void checkIn(Checkout &checkout); // return updated raw buffer
- void undoCheckOut(Checkout &checkout); // undo checkout efffect
+ void undoCheckOut(Checkout &checkout); // undo checkout effect
void scheduleBodyDataNotification();
void scheduleBodyEndNotification();
bool hasQueue(const CommQuotaQueue*) const; ///< has a given queue
unsigned int quotaEnqueue(int fd); ///< client starts waiting in queue; create the queue if necessary
int quotaPeekFd() const; ///< returns the next fd reservation
- unsigned int quotaPeekReserv() const; ///< returns the next reserv. to pop
+ unsigned int quotaPeekReserv() const; ///< returns the next reservation to pop
void quotaDequeue(); ///< pops queue head from queue
void kickQuotaQueue(); ///< schedule commHandleWriteHelper call
/// either selects the head descriptor for writing or calls quotaDequeue()
static bool AllowMacros_;
static bool ParseQuotedOrToEol_; ///< The next tokens will be handled as quoted or to_eol token
static bool RecognizeQuotedPair_; ///< The next tokens may contain quoted-pair (\-escaped) characters
- static bool PreviewMode_; ///< The next token will not popped from cfg files, will just previewd.
+ static bool PreviewMode_; ///< \copydoc PeekAtToken()
static bool ParseKvPair_; ///<The next token will be handled as kv-pair token
static enum ParsingStates {atParseKey, atParseValue} KvPairState_; ///< Parsing state while parsing kv-pair tokens
};
DiskdIOStrategy::load()
{
/* Calculate the storedir load relative to magic2 on a scale of 0 .. 1000 */
- /* the parse function guarantees magic2 is positivie */
+ /* the parse function guarantees magic2 is positive */
return away * 1000 / magic2;
}
spec->length = size_diff(last_pos + 1, spec->offset);
- /* we managed to parse, check if the result makes sence */
+ /* we managed to parse, check if the result makes sense */
if (spec->length <= 0) {
debugs(68, 2, "invalid range (" << spec->offset << " += " <<
(long int) spec->length << ") in resp-range-spec near: '" << field << "'");
int aliveCount; /* created but not destroyed (count) */
int seenCount; /* number of fields we've seen */
int parsCount; /* number of parsing attempts */
- int errCount; /* number of pasring errors */
- int repCount; /* number of repetitons */
+ int errCount; /* number of parsing errors */
+ int repCount; /* number of repetitions */
};
#endif /* SQUID_SRC_HTTPHEADERFIELDSTAT_H */
#include <cerrno>
-/* To support concurrent PID files, convert local statics into PidFile class */
+/* To support concurrent PID files, convert local static variables into PidFile class */
/// Describes the (last) instance PID file being processed.
/// This hack shortens reporting code while keeping its messages consistent.
/** Import values from another histogram
*
- * \note: the two histograms MUST have the same capicity, min and max or
+ * \note: the two histograms MUST have the same capacity, min and max or
* an exception will be raised
*/
StatHist &operator += (const StatHist &B);
// may use a mixture of fastCheck(void) and fastCheck(list) calls.
const auto savedList = swapAcl(list);
- // assume DENY/ALLOW on mis/matches due to action-free accessList
+ // assume DENY/ALLOW on mismatches/matches due to action-free accessList
// matchAndFinish() takes care of the ALLOW case
if (accessList)
matchAndFinish(); // calls markFinished() on success
if (strncmp(t, "^.*", 3) == 0)
t += 3;
- /* NOTE: an initial '.' might seem unnessary but is not;
+ /* NOTE: an initial '.' might seem unnecessary but is not;
* it can be a valid requirement that cannot be optimised
*/
while (*t == '.' && *(t+1) == '*') {
/*
* SearchLDAP() - <edui_ldap_t> <scope> <filter> <attrib>
*
- * Initate LDAP query, under <scope> levels, filtering matches with <filter> and optionally <attrib>
+ * Initiate LDAP query, under <scope> levels, filtering matches with <filter> and optionally <attrib>
* <attrib> will generally be networkAddress ...
*
*/
#include "base/CbcPointer.h"
/*
- * The ICAP Initiator is an ICAP vectoring point that initates ICAP
+ * The ICAP Initiator is an ICAP vectoring point that initiates ICAP
* transactions. This interface exists to allow ICAP transactions to
* signal their initiators that they have the answer from the ICAP server
* or that the ICAP query has aborted and there will be no answer. It
// Store received meta headers for adapt::<last_h logformat code use.
// If we already have stored headers from a previous adaptation transaction
- // related to the same master transction, they will be replaced.
+ // related to the same master transaction, they will be replaced.
Adaptation::History::Pointer ah = request->adaptLogHistory();
if (ah != nullptr) {
HttpHeader meta(hoReply);
size_t Adaptation::Icap::ModXact::virginContentSize(const Adaptation::Icap::VirginBodyAct &act) const
{
Must(act.active());
- // asbolute start of unprocessed data
+ // absolute start of unprocessed data
const uint64_t dataStart = act.offset();
// absolute end of buffered data
const uint64_t dataEnd = virginConsumed + virgin.body_pipe->buf().contentSize();
Adaptation::Icap::Preview::Preview(): theWritten(0), theAd(0), theState(stDisabled)
{}
-void Adaptation::Icap::Preview::enable(size_t anAd)
+void Adaptation::Icap::Preview::enable(size_t anAdvertisedSize)
{
- // TODO: check for anAd not exceeding preview size limit
+ // TODO: check for anAdvertisedSize not exceeding preview size limit
Must(!enabled());
- theAd = anAd;
+ theAd = anAdvertisedSize;
theState = stWriting;
}
/*
* ICAPModXact implements ICAP REQMOD and RESPMOD transaction using
* ICAPXaction as the base. The ICAPModXact receives a virgin HTTP message
- * from an ICAP vecoring point, (a.k.a., initiator), communicates with the
+ * from an ICAP vectoring point, (a.k.a. initiator), communicates with the
* ICAP server, and sends the adapted HTTP message headers back.
- * Virgin/adapted HTTP message body is reveived/sent using BodyPipe
+ * Virgin/adapted HTTP message body is received/sent using BodyPipe
* interface. The initiator (or its associate) is expected to send and/or
* receive the HTTP body.
*/
public:
Preview(); // disabled
- void enable(size_t anAd); // enabled with advertised size
+ void enable(size_t anAdvertisedSize); // enabled with advertised size
bool enabled() const;
/* other members can be accessed iff enabled() */
TransferKind kind; // to simplify caller's life
};
- // varios Transfer-* lists
+ // various Transfer-* lists
struct Transfers {
TransferList preview;
TransferList ignore;
void Adaptation::Icap::ServiceRep::noteConnectionUse(const Comm::ConnectionPointer &conn)
{
Must(Comm::IsConnOpen(conn));
- fd_table[conn->fd].noteUse(); // pconn re-use, albeit not via PconnPool API
+ fd_table[conn->fd].noteUse(); // pconn reuse, albeit not via PconnPool API
}
void Adaptation::Icap::ServiceRep::noteConnectionFailed(const char *comment)
If an ICAP service with the routing=1 option in squid.conf returns an ICAP
X-Next-Services response header during a successful REQMOD or RESPMOD
-transaction, Squid abandones the original adaptation plan and forms a new
+transaction, Squid abandons the original adaptation plan and forms a new
adaptation chain consisting of services identified in the X-Next-Services
header value (using a comma-separated list of adaptation service names from
squid.conf). The dynamically created chain is destroyed once the new plan is
* After this all schemes will appear completely unsupported
* until a call to InitAuthModules().
* Release the Auth::TheConfig handles instead to disable authentication
- * without terminiating all support.
+ * without terminating all support.
*/
static void FreeAll();
/**
* Check a auth_user pointer for validity.
- * Does not check passwords, just data sensability. Broken or Unknown auth_types are not valid for use...
+ * Does not check passwords, just data validity. Broken or Unknown auth_types are not valid for use...
*
* \retval false User credentials are missing.
* \retval false User credentials use an unknown scheme type.
return 0;
while (p[0] && p[1]) {
if (xisspace(p[0])) {
- /* More than one consequitive space? */
+ /* More than one consecutive space? */
if (xisspace(p[1]))
return 0;
/* or odd space type character used? */
* A simple "conversation" function returning the supplied password.
* Has a bit to much error control, but this is my first PAM application
* so I'd rather check everything than make any mistakes. The function
- * expects a single converstation message of type PAM_PROMPT_ECHO_OFF.
+ * expects a single conversation message of type PAM_PROMPT_ECHO_OFF.
*/
int
password_conversation(int num_msg, PAM_CONV_FUNC_CONST_PARM struct pam_message **msg, struct pam_response **resp, void *appdata_ptr)
{
if (num_msg != 1 || msg[0]->msg_style != PAM_PROMPT_ECHO_OFF) {
- debug("ERROR: Unexpected PAM converstaion '%d/%s'\n", msg[0]->msg_style, msg[0]->msg);
+ debug("ERROR: Unexpected PAM conversation '%d/%s'\n", msg[0]->msg_style, msg[0]->msg);
return PAM_CONV_ERR;
}
#if _SQUID_SOLARIS_
*
* basic_radius_auth-1.0 is based on modules from the Cistron-radiusd-1.5.4.
*
- * Currently you should only start 1 authentificator at a time because the
+ * Currently you should only start 1 authenticator at a time because the
* the ID's of the different programs can start to conflict. I'm not sure it
* would help anyway. I think the RADIUS server is close by and I don't think
* it will handle requests in parallel anyway (correct me if I'm wrong here)
forced to lower case before user credentials are checked or stored.
Most user databases are case insensitive, allowing the same username to be
- spelled using both lower and upper case letters. For such databases, any
- casesenstive setting should work, but forcing usernames to lower case may
+ spelled using both lower and upper case letters. For such databases,
+ either setting should work, but forcing usernames to lower case may
still make a big difference for Squid internal caches like those used by
an external ACL with %un logformat code in FORMAT and a user_max_ip ACL.
Place: the filename and path to be written.
daemon Very similar to stdio. But instead of writing to disk the log
- line is passed to a daemon helper for asychronous handling instead.
+ line is passed to a daemon helper for asynchronous handling instead.
Place: varies depending on the daemon.
log_file_daemon Place: the file name and path to be written.
/** returns expected content length for multi-range replies
* note: assumes that httpHdrRangeCanonize has already been called
* warning: assumes that HTTP headers for individual ranges at the
- * time of the actuall assembly will be exactly the same as
+ * time of the actual assembly will be exactly the same as
* the headers when clientMRangeCLen() is called */
int64_t
ClientHttpRequest::mRangeCLen() const
/* BUG: Squid cannot deal with '*' URLs (RFC2616 5.1.2) */
- // XXX: re-use proper URL parser for this
+ // XXX: reuse proper URL parser for this
SBuf url = hp->requestUri(); // use full provided URI if we abort
do { // use a loop so we can break out of it
::Parser::Tokenizer tok(url);
* Just close the connection to not confuse browsers
* using persistent connections. Some browsers open
* a connection and then do not use it until much
- * later (presumeably because the request triggering
+ * later (presumably because the request triggering
* the open has already been completed on another
* connection)
*/
#elif (ALLOW_ALWAYS_SSL_SESSION_DETAIL == 1)
/* When using gcc 3.3.x and OpenSSL 0.9.7x sometimes a compile error can occur here.
- * This is caused by an unpredicatble gcc behaviour on a cast of the first argument
+ * This is caused by an unpredictable gcc behaviour on a cast of the first argument
* of PEM_ASN1_write(). For this reason this code section is disabled. To enable it,
* define ALLOW_ALWAYS_SSL_SESSION_DETAIL=1.
* Because there are two possible usable cast, if you get an error here, try the other
else if (ca->alg == Ssl::algSetValidBefore)
certProperties.setValidBefore = true;
- debugs(33, 5, "Matches certificate adaptation aglorithm: " <<
+ debugs(33, 5, "Matches certificate adaptation algorithm: " <<
alg << " param: " << (param ? param : "-"));
}
}
// Fix timeout to request_start_timeout
resetReadTimeout(Config.Timeout.request_start_timeout);
// Also reset receivedFirstByte_ flag to allow this timeout work in the case we have
- // a bumbed "connect" request on non transparent port.
+ // a bumped "connect" request on non transparent port.
receivedFirstByte_ = false;
// Get more data to peek at Tls
parsingTlsHandshake = true;
/*
* Handle STORE_OK objects.
- * objectLen(entry) will be set proprely.
+ * objectLen(entry) will be set properly.
* RC: Does objectLen(entry) include the Headers?
* RC: Yes.
*/
/* XXX: This is suboptimal. We should give the stream the range set,
* and thereby let the top of the stream set the offset when the
* size becomes known. As it is, we will end up requesting from 0
- * for evey -X range specification.
+ * for every -X range specification.
* RBC - this may be somewhat wrong. We should probably set the range
* iter up at this point.
*/
return requestBodySource->getMoreData(buf);
}
-// Compares hosts in urls, returns false if different, no sheme, or no host.
+// Compares hosts in urls, returns false if different, no scheme, or no host.
static bool
sameUrlHosts(const char *url1, const char *url2)
{
// TODO: Should we check receivedBodyTooLarge as well?
if (!group) {
- debugs(11,3, "no adapation needed");
+ debugs(11, 3, "no adaptation needed");
setFinalReply(virginReply());
processReplyBody();
return;
/**
* Translate FTP login failure into HTTP error
- * this is an attmpt to get the 407 message to show up outside Squid.
+ * this is an attempt to get the 407 message to show up outside Squid.
* its NOT a general failure. But a correct FTP response type.
*/
void
}
failed(ERR_NONE, ctrl.replycode, err);
- // any other problems are general falures.
+ // any other problems are general failures.
HttpReply *newrep = err->BuildHttpReply();
delete err;
* I spend the day chasing this core dump that occurs when both the client
* and the server side of a cache fetch simultaneoulsy abort the
* connection. While I haven't really studied the code to figure out how
- * it happens, the snippet below may prevent the cache from exitting:
+ * it happens, the snippet below may prevent the cache from exiting:
*
* Call this from where the select loop fails.
*/
#define EBIT_CLR(flag, bit) ((void)((flag) &= ~((1L<<(bit)))))
#define EBIT_TEST(flag, bit) ((flag) & ((1L<<(bit))))
-/* bit opearations on a char[] mask of unlimited length */
+/* bit operations on a char[] mask of unlimited length */
#define CBIT_BIT(bit) (1<<((bit)%8))
#define CBIT_BIN(mask, bit) (mask)[(bit)>>3]
#define CBIT_SET(mask, bit) ((void)(CBIT_BIN(mask, bit) |= CBIT_BIT(bit)))
* of the rfc1035_message structure.
*
* Updates the buffer offset, which is the same as number of
- * octects unpacked since the header starts at offset 0.
+ * octets unpacked since the header starts at offset 0.
*
* Returns 0 (success) or 1 (error)
*/
// sockets and server listening sockets) and the reconfigure completing
// (Runner syncConfig() being run). Transactions which loose this race will
// produce DNS timeouts (or whatever the caller set) as their queries never
- // get queued to be re-tried after the DNS socekts are re-opened.
+ // get queued to be re-tried after the DNS sockets are re-opened.
if (DnsSocketA < 0 && DnsSocketB < 0) {
debugs(78, DBG_IMPORTANT, "WARNING: idnsSendQuery: Can't send query, no DNS socket!");
state->queue = oldstate->queue;
oldstate->queue = state;
} else {
- /* No pending lookup found. Sumbit to helper */
+ /* No pending lookup found. Submit to helper */
MemBuf buf;
buf.init();
return freeSlots != nullptr && !freeSlots->size();
}
-// storeSwapOutFileClosed calls this nethod on DISK_NO_SPACE_LEFT,
+// storeSwapOutFileClosed calls this method on DISK_NO_SPACE_LEFT,
// but it should not happen for us
void
Rock::SwapDir::diskFull()
/// Create an internal HttpReply structure to house FTP control response info.
HttpReply *HttpReplyWrapper(const int ftpStatus, const char *ftpReason, const Http::StatusCode httpStatus, const int64_t clen);
-/* FTP Commands used by Squid. ALLCAPS case. Safe for static initializaton. */
+/* FTP Commands used by Squid. ALLCAPS case. Safe for static initialization. */
const SBuf &cmdAppe();
const SBuf &cmdAuth();
const SBuf &cmdCwd();
/** HTTP/1.x protocol parser
*
* Works on a raw character I/O buffer and tokenizes the content into
- * the major CRLF delimited segments of an HTTP/1 procotol message:
+ * the major CRLF delimited segments of an HTTP/1 protocol message:
*
* \li first-line (request-line / simple-request / status-line)
* \li mime-header 0*( header-name ':' SP field-value CRLF)
* upgrading HTTP/0.9 syntax responses to HTTP/1.1
*
* Works on a raw character I/O buffer and tokenizes the content into
- * the major CRLF delimited segments of an HTTP/1 respone message:
+ * the major CRLF delimited segments of an HTTP/1 response message:
*
- * \li status-line (version SP status SP reash-phrase)
+ * \li status-line (version SP status SP reason-phrase)
* \li mime-header (set of RFC2616 syntax header fields)
*/
class ResponseParser : public Http1::Parser
Http1::Parser::size_type firstLineSize() const override;
bool parse(const SBuf &aBuf) override;
- /* respone specific fields, read-only */
+ /* response specific fields, read-only */
Http::StatusCode messageStatus() const { return statusCode_;}
SBuf reasonPhrase() const { return reasonPhrase_;}
#include "IcmpPinger.h"
#include "time/gadgets.h"
-// Some system headers are only neeed internally here.
+// Some system headers are only needed internally here.
// They should not be included via the header.
#if HAVE_NETINET_IP6_H
/* We have to keep a local list of CachePeer names. The Peers structure
* gets freed during a reconfigure. We want this database to
- * remain persisitent, so _net_db_peer->peername points into this
+ * remain persistent, so _net_db_peer->peername points into this
* linked list */
static wordlist *peer_names = nullptr;
void getAddrInfo(struct addrinfo *&ai, int force = AF_UNSPEC) const;
/**
- * Equivalent to the sysem call freeaddrinfo() but for Ip::Address allocated data
+ * Equivalent to the system call freeaddrinfo() but for Ip::Address allocated data
*/
static void FreeAddr(struct addrinfo *&ai);
* when moving from converted code to unconverted
* these functions can be used to convert this object
* and pull out the data needed by the unconverted code
- * they are intentionaly hard to use, use getAddrInfo() instead.
+ * they are intentionally hard to use, use getAddrInfo() instead.
* these functions WILL NOT be in the final public API after transition.
*/
\par
* There is no formal state-machine for transparency and interception
* instead there is this neutral API which other connection state machines
- * and the comm layer use to co-ordinate their own state for transparency.
+ * and the comm layer use to coordinate their own state for transparency.
*/
class Intercept
{
/// an atomic readers-writer or shared-exclusive lock suitable for maps/tables
/// Also supports reading-while-appending mode when readers and writer are
-/// allowed to access the same locked object because the writer promisses
+/// allowed to access the same locked object because the writer promises
/// to only append new data and all size-related object properties are atomic.
class ReadWriteLock
{
case 'C':
/** \par C
- * Unset/disabel global option for catchign signals. opt_catch_signals */
+ * Unset/disable global option for catchign signals. opt_catch_signals */
opt_catch_signals = 0;
break;
if (geteuid() == 0) {
debugs(0, DBG_CRITICAL, "Squid is not safe to run as root! If you must");
debugs(0, DBG_CRITICAL, "start Squid as root, then you must configure");
- debugs(0, DBG_CRITICAL, "it to run as a non-priveledged user with the");
+ debugs(0, DBG_CRITICAL, "it to run as a non-privileged user with the");
debugs(0, DBG_CRITICAL, "'cache_effective_user' option in the config file.");
fatal("Don't run Squid as root, set 'cache_effective_user'!");
}
new_pool_limit = Config.MemPools.limit;
else {
if (Config.MemPools.limit == 0)
- debugs(13, DBG_IMPORTANT, "memory_pools_limit 0 has been chagned to memory_pools_limit none. Please update your config");
+ debugs(13, DBG_IMPORTANT, "memory_pools_limit 0 has been changed to memory_pools_limit none. Please update your config");
new_pool_limit = -1;
}
continue;
// our connection timeout handler is scheduled to run already. unsafe for now.
- // TODO: cancel the pending timeout callback and allow re-use of the conn.
+ // TODO: cancel the pending timeout callback and allow reuse of the conn.
if (fd_table[theList_[i]->fd].timeoutHandler == nullptr)
continue;
continue;
// our connection timeout handler is scheduled to run already. unsafe for now.
- // TODO: cancel the pending timeout callback and allow re-use of the conn.
+ // TODO: cancel the pending timeout callback and allow reuse of the conn.
if (fd_table[theList_[i]->fd].timeoutHandler == nullptr)
continue;
/* XXX: ugly condition, but how? */
if (fetch->entry->store_status == STORE_OK)
- debugs(72, 2, "re-used old digest from " << host);
+ debugs(72, 2, "reused old digest from " << host);
else
debugs(72, 2, "received valid digest from " << host);
}
size_t replySize = 0;
if (const char *t = strchr(res, ' ')) {
static int warn = 0;
- debugs(61, (!(warn++%50)? DBG_CRITICAL:2), "WARNING: UPGRADE: URL rewriter reponded with garbage '" << t <<
+ debugs(61, (!(warn++%50)? DBG_CRITICAL:2), "WARNING: UPGRADE: URL rewriter responded with garbage '" << t <<
"'. Future Squid will treat this as part of the URL.");
replySize = t - res;
} else
SBufCaseSensitive sensitivity_;
};
-/** SBuf size addition accumulator for STL contaniners
+/** SBuf size addition accumulator for STL containers
*
* Equivalent to prefix_length + SBuf.length() + separator.length()
*/
/** Extract a part of the current SBuf.
*
* Return a fresh a fresh copy of a portion the current SBuf, which is
- * left untouched. The same parameter convetions apply as for chop.
+ * left untouched. The same parameter conventions apply as for chop.
* \see trim, chop
*/
SBuf substr(size_type pos, size_type n = npos) const;
/// Called after each negotiation step to handle the result
void handleNegotiationResult(const Security::IoResult &);
- /// Called when the openSSL SSL_connect fnction request more data from
+ /// Called when the openSSL SSL_connect function request more data from
/// the remote SSL server. Sets the read timeout and sets the
/// Squid COMM_SELECT_READ handler.
void noteWantRead();
// TODO: Add connect timeout for passive connections listener?
// TODO: Remember server response so that we can forward it?
} else {
- // Either the connection was establised and closed after the
+ // Either the connection was established and closed after the
// data was transferred OR we failed to establish an active
// data connection and already sent the error to the client.
// In either case, there is nothing more to do.
// server IP the client is connecting to, it can be spoofed by Squid.
//
// In both cases some clients may refuse to accept data connections if
- // these control connectin local-IP's are not used.
+ // these control connection local-IP's are not used.
conn->setAddrs(clientConnection->local, cltAddr);
// Using non-local addresses in TPROXY mode requires appropriate socket option.
//Try to retrieve from cache
size_t pos = 0;
char lang[256];
- // Get the first ellement of the Accept-Language header
+ // Get the first element of the Accept-Language header
strHdrAcptLangGetItem(hdr, lang, 256, pos);
errDetails = getCachedDetails(lang); // search in cache
if (addKeyId) {
X509_EXTENSION *ext;
// Check if the issuer has the Subject Key Identifier extension
- const int indx = X509_get_ext_by_NID(issuerCert.get(), NID_subject_key_identifier, -1);
- if (indx >= 0 && (ext = X509_get_ext(issuerCert.get(), indx))) {
+ const int index = X509_get_ext_by_NID(issuerCert.get(), NID_subject_key_identifier, -1);
+ if (index >= 0 && (ext = X509_get_ext(issuerCert.get(), index))) {
issuerKeyId.reset((ASN1_OCTET_STRING *)X509V3_EXT_d2i(ext));
}
}
return std::nullopt;
}
-/// Adds a new subjectAltName extension contining Subject CN or returns false
+/// Adds a new subjectAltName extension containing Subject CN or returns false
/// expects the caller to check for the existing subjectAltName extension
static bool
addAltNameWithSubjectCn(Security::CertPointer &cert)
return false;
if (!peer.sslCipher.isEmpty()) {
- debugs(83, 5, "Using chiper suite " << peer.sslCipher << ".");
+ debugs(83, 5, "Using cipher suite " << peer.sslCipher << ".");
const char *cipher = peer.sslCipher.c_str();
if (!SSL_CTX_set_cipher_list(ctx.get(), cipher)) {
/*
* This may look inefficient as CPU wise it is more efficient to do this
- * sequentially, but I/O wise the parallellism helps as it allows more
+ * sequentially, but I/O wise the parallelism helps as it allows more
* hdd spindles to be active.
*/
while (notdone) {
} RawAccessLogEntry;
typedef enum {
- frError = -2, frMore = -1, frEof = 0, frOk = 1
+ frError = -2, frMore = -1, frEof = 0, frSuccess = 1
} fr_result;
typedef struct _FileIterator FileIterator;
exit(-3);
}
- return frOk;
+ return frSuccess;
}
static fr_result
/*fprintf(stdout, "%s:%d: %s %s %s %s\n",
* fname, count, method, storeKeyText(entry->key), url, hier); */
- return frOk;
+ return frSuccess;
}
static void
/* we want a maximum of one, and strict to be true */
CPPUNIT_ASSERT_EQUAL(1, maxUserIpACL->getMaximum());
CPPUNIT_ASSERT_EQUAL(true, static_cast<bool>(maxUserIpACL->beStrict));
- /* the acl must be vaid */
+ /* the acl must be valid */
CPPUNIT_ASSERT_EQUAL(true, maxUserIpACL->valid());
}
Acl::FreeNamedAcls(&Config.namedAcls);
CPPUNIT_ASSERT(s1 < s2);
// specifying the max-length and overhanging size
CPPUNIT_ASSERT_EQUAL(1,SBuf("foolong").caseCmp(SBuf("foo"), 5));
- // case-insensive comaprison
+ // case-insensive comparison
s1 = "foo";
s2 = "fOo";
CPPUNIT_ASSERT_EQUAL(0,s1.caseCmp(s2));
for (SBuf::size_type filled = 0; filled < requirements.maxCapacity +5; ++filled) {
CPPUNIT_ASSERT_EQUAL(b.length(), min(filled, requirements.maxCapacity));
auto x = b.reserve(requirements);
- // the amount of space advertized must not cause users to exceed capacity
+ // the amount of space advertised must not cause users to exceed capacity
CPPUNIT_ASSERT(x <= requirements.maxCapacity - filled);
CPPUNIT_ASSERT(b.spaceSize() <= requirements.maxCapacity - filled);
// the total size of buffer must not cause users to exceed capacity
{
TunnelStateData *tunnelState = static_cast<TunnelStateData *>(io.data);
debugs(26, 3, io.conn);
- /* Temporary lock to protect our own feets (comm_close -> tunnelClientClosed -> Free) */
+ /* Temporary lock to protect our own feet (comm_close -> tunnelClientClosed -> Free) */
CbcPointer<TunnelStateData> safetyLock(tunnelState);
tunnelState->closeConnections();
TunnelStateData *tunnelState = (TunnelStateData *)data;
debugs(26, 3, "FD " << fd);
assert(tunnelState != nullptr);
- /* temporary lock to save our own feets (comm_close -> tunnelClientClosed -> Free) */
+ /* temporary lock to save our own feet (comm_close -> tunnelClientClosed -> Free) */
CbcPointer<TunnelStateData> safetyLock(tunnelState);
if (Comm::IsConnOpen(tunnelState->client.conn))
#define WCCP2_NUMPORTS 8
#define WCCP2_PASSWORD_LEN 8 + 1 /* + 1 for C-string NUL terminator */
-/* WCCPv2 Pakcet format structures */
+/* WCCPv2 Packet format structures */
/* Defined in draft-wilson-wccp-v2-12-oct-2001.txt */
/** \interface WCCPv2_Protocol