diff --git a/lib/hash.c b/lib/hash.c index ab3d8cf69..2741da066 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -1,5 +1,5 @@ /** - * Tempesta kernel libarary + * Tempesta kernel library * * Copyright (C) 2015-2018 Tempesta Technologies, INC. * diff --git a/lib/hash.h b/lib/hash.h index dc9818c1e..16a2d19bf 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -1,5 +1,5 @@ /** - * Tempesta kernel libarary + * Tempesta kernel library * * Copyright (C) 2015-2018 Tempesta Technologies, INC. * diff --git a/lib/main.c b/lib/main.c index 1d9bd1096..59a44567d 100644 --- a/lib/main.c +++ b/lib/main.c @@ -1,5 +1,5 @@ /** - * Tempesta kernel libarary + * Tempesta kernel library * * Copyright (C) 2018 Tempesta Technologies, INC. * diff --git a/lib/str.h b/lib/str.h index 0e1dfa987..a31707e76 100644 --- a/lib/str.h +++ b/lib/str.h @@ -1,5 +1,5 @@ /** - * Tempesta kernel libarary + * Tempesta kernel library * * Copyright (C) 2018 Tempesta Technologies, INC. * diff --git a/lib/str_simd.S b/lib/str_simd.S index fc72169e4..8f4599f11 100644 --- a/lib/str_simd.S +++ b/lib/str_simd.S @@ -1,6 +1,6 @@ /** * x86-64 SIMD routines for HTTP strings processing. See the algorithms' - * description and perfomance comparison with other implementations at + * description and performance comparison with other implementations at * http://natsys-lab.blogspot.ru/2016/10/http-strings-processing-using-c-sse42.html * and https://github.com/natsys/blog/tree/master/kstrings . * We have to write the stuff in assembly since GCC sometimes generates not the diff --git a/tempesta_db/core/file.c b/tempesta_db/core/file.c index 9107df17a..b82cab448 100644 --- a/tempesta_db/core/file.c +++ b/tempesta_db/core/file.c @@ -136,7 +136,7 @@ __ma_merge(MArea *left, MArea *right) /** * Free a memory area and merge it with free siblings if possible. - * Never tries to free staticaly allocated MArea. + * Never tries to free statically allocated MArea. */ static void __ma_free(MArea *ma) @@ -218,7 +218,7 @@ tempesta_map_file(struct file *file, unsigned long len, int node) } /** - * Syncronize memory mapping with the file. + * Synchronize memory mapping with the file. * Called from process context. */ static void @@ -285,7 +285,7 @@ tdb_file_open(TDB *db, unsigned long size) return -EBADF; } - /* Allocate continous extents. */ + /* Allocate continuous extents. */ inode = file_inode(filp); sb_start_write(inode->i_sb); ret = filp->f_op->fallocate(filp, 0, 0, size); diff --git a/tempesta_db/core/htrie.c b/tempesta_db/core/htrie.c index 9b959a1b0..17fdff602 100644 --- a/tempesta_db/core/htrie.c +++ b/tempesta_db/core/htrie.c @@ -197,7 +197,7 @@ tdb_alloc_blk(TdbHdr *dbh) if (likely(g_nwb & ~TDB_EXT_MASK)) { /* - * Current extent was already getted. + * Current extent was already got. * Probably we can allocate some memory in this extent. */ rptr = __tdb_alloc_blk_ext(dbh, e); @@ -265,7 +265,7 @@ tdb_htrie_init_bucket(TdbBucket *b) /** * @return byte offset of the allocated data block and sets @len to actually - * available room for writting if @len doesn't fit to block. + * available room for writing if @len doesn't fit to block. * * Return 0 on error. * @@ -486,7 +486,7 @@ do { \ memcpy_fast(TDB_HTRIE_BCKT_1ST_REC(b), r, n); \ nb[k].off = sizeof(*b) + n; \ new_in->shifts[k] = TDB_O2DI(nb[k].b) | TDB_HTRIE_DBIT;\ - /* We copied a record, clear its orignal place. */\ + /* We copied a record, clear its original place. */\ free_nb = free_nb > 0 ? free_nb : -free_nb; \ TDB_DBG("burst: copied rec=%p (len=%lu key=%#lx)"\ " to new dblk=%#lx w/ idx=%#lx\n", \ @@ -540,7 +540,7 @@ do { \ /** * Descend the the tree starting at @node. * - * @retrurn byte offset of data (w/o TDB_HTRIE_DBIT bit) on success + * @return byte offset of data (w/o TDB_HTRIE_DBIT bit) on success * or 0 if key @key was not found. * When function exits @node stores the last index node. * @bits - number of bits (from less significant to most significant) from @@ -648,7 +648,7 @@ tdb_htrie_extend_rec(TdbHdr *dbh, TdbVRec *rec, size_t size) /** * @len returns number of copied data on success. * - * TODO it seems the function can be rewrited w/o RW-lock using transactional + * TODO it seems the function can be rewritten w/o RW-lock using transactional * notation: assemble set of operations to do in double word in shared location * and do CAS on it with comparing the location with zero. * If competing context helps the current trx owner, then we get true lock-free. diff --git a/tempesta_db/core/main.c b/tempesta_db/core/main.c index ba28013c0..e4511b059 100644 --- a/tempesta_db/core/main.c +++ b/tempesta_db/core/main.c @@ -4,7 +4,7 @@ * This is the entry point: initialization functions and public interfaces. * * Copyright (C) 2014 NatSys Lab. (info@natsys-lab.com). - * Copyright (C) 2015 - 2017 Tempesta Technologies, Inc. + * Copyright (C) 2015 - 2018 Tempesta Technologies, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -323,8 +323,8 @@ tdb_exit(void) tdb_if_exit(); /* - * There are no database users, so roughtly close all abandoned - * tables w/o refrence checking and so on. + * There are no database users, so roughly close all abandoned + * tables w/o reference checking and so on. */ tdb_tbl_foreach(__do_close_table); } diff --git a/tempesta_db/core/tdb.h b/tempesta_db/core/tdb.h index 61e1fd192..d9e67b934 100644 --- a/tempesta_db/core/tdb.h +++ b/tempesta_db/core/tdb.h @@ -31,7 +31,7 @@ /** * Per-CPU dynamically allocated data for TDB handler. * Access to the data must be with preemption disabled for reentrance between - * softirq and process cotexts. + * softirq and process contexts. * * @i_wcl, @d_wcl - per-CPU current partially written index and data blocks. * TdbHdr->i_wcl and TdbHdr->d_wcl are the global values for @@ -120,7 +120,7 @@ typedef struct { /** * We use very small index nodes size of only one cache line. - * So overall memory footprint of the index is mininal by a cost of more LLC + * So overall memory footprint of the index is minimal by a cost of more LLC * or main memory transfers. However, smaller memory usage means better TLB * utilization on huge worksets. */ diff --git a/tempesta_db/core/tdb_if.h b/tempesta_db/core/tdb_if.h index 5182db25e..e56ce107f 100644 --- a/tempesta_db/core/tdb_if.h +++ b/tempesta_db/core/tdb_if.h @@ -3,7 +3,7 @@ * * User-space communication interfaces. * - * Copyright (C) 2015 Tempesta Technologies. + * Copyright (C) 2015-2018 Tempesta Technologies. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -48,7 +48,7 @@ enum tdb_msg_type { }; #define TDB_NLF_TYPE_MASK 0x00ff -#define TDB_NLF_RESP_OK 0x0100 /* good reposne status */ +#define TDB_NLF_RESP_OK 0x0100 /* good response status */ #define TDB_NLF_RESP_TRUNC 0x0200 /* response was truncated */ #define TDB_NLF_RESP_END 0x0400 /* end of chunked response */ diff --git a/tempesta_db/libtdb/exception.h b/tempesta_db/libtdb/exception.h index 9bab6d37e..5931dc670 100644 --- a/tempesta_db/libtdb/exception.h +++ b/tempesta_db/libtdb/exception.h @@ -1,9 +1,9 @@ /** - * Tempesta DB User-space Libabry + * Tempesta DB User-space Library * * Error/exceptions handling. * - * Copyright (C) 2015 Tempesta Technologies. + * Copyright (C) 2015-2018 Tempesta Technologies. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by diff --git a/tempesta_db/libtdb/handler.cc b/tempesta_db/libtdb/handler.cc index 3cfe15dce..4d7ecc4d0 100644 --- a/tempesta_db/libtdb/handler.cc +++ b/tempesta_db/libtdb/handler.cc @@ -1,5 +1,5 @@ /** - * Tempesta DB User-space Libabry + * Tempesta DB User-space Library * * Handler for database operations. * @@ -7,7 +7,7 @@ * Update the code when the library support the feature, * track status of https://github.com/thom311/libnl/issues/33. * - * Copyright (C) 2015 Tempesta Technologies. + * Copyright (C) 2015-2018 Tempesta Technologies. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -216,7 +216,7 @@ TdbHndl::trx_begin() } /** - * Send all peding frames. + * Send all pending frames. */ void TdbHndl::trx_commit() @@ -390,7 +390,7 @@ TdbHndl::insert(std::string &tbl_name, size_t klen, size_t vlen, if (trx_.off + sizeof(nlmsghdr) + sizeof(TdbMsgRec) + klen + vlen > NL_FR_SZ) { - // Not enugh space in current frame, alllocate a new one. + // Not enough space in current frame, allocate a new one. advance_frame_offset(tx_fr_off_); alloc_trx_frame(); } diff --git a/tempesta_fw/addr.c b/tempesta_fw/addr.c index eb550c9fe..d5189e951 100644 --- a/tempesta_fw/addr.c +++ b/tempesta_fw/addr.c @@ -4,7 +4,7 @@ * IP address related functions. * * Copyright (C) 2014 NatSys Lab. (info@natsys-lab.com). - * Copyright (C) 2015-2016 Tempesta Technologies, Inc. + * Copyright (C) 2015-2018 Tempesta Technologies, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -143,7 +143,7 @@ tfw_addr_pton_v6(const TfwStr *s, TfwAddr *addr) return -EINVAL; /* * IPv4 mapped address. - * Recalculate the first 2 hexademical octets from to + * Recalculate the first 2 hexadecimal octets from to * 1 decimal octet. */ addr->sin6_family = AF_INET6; @@ -393,7 +393,7 @@ tfw_addr_ifmatch(const TfwAddr *server, const TfwAddr *listener) if (IN_LOOPBACK(ntohl(saddr))) return 1; /* TODO: check if client addr is - * one of interface adresses + * one of interface addresses */ } diff --git a/tempesta_fw/apm.c b/tempesta_fw/apm.c index 1fc9976a6..6afc3af2c 100644 --- a/tempesta_fw/apm.c +++ b/tempesta_fw/apm.c @@ -16,7 +16,7 @@ * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * Prototype for fast precentiles calculation. + * Prototype for fast percentiles calculation. */ #include #include @@ -44,7 +44,7 @@ * 3. Very small overall memory footprint for inexpensive handling of * performance trends of many servers; * - * 4. Buckets must be dynamicaly rearranged since server response times + * 4. Buckets must be dynamically rearranged since server response times * are unknown apriori; * * 5. The adjustments of buckets must be performed in a lock-less fashion @@ -182,7 +182,7 @@ tfw_stats_extend(TfwPcntRanges *rng, unsigned int r_time) * the upper end of the range that the data type could hold. * As the value was extended to the next order it's conceivable * that the new value exceeded the maximum for the data type. - * Consirering that TfwPcntCtl{}->end is of type unsigned int, + * Considering that TfwPcntCtl{}->end is of type unsigned int, * it's totally unimaginable that this situation may ever happen. */ BUG_ON(end >= (1UL << (FIELD_SIZEOF(TfwPcntCtl, end) * 8))); @@ -456,7 +456,7 @@ typedef struct { * @rcount - current count of health monitoring requests (in @hm->tmt); * @jtmstamp - time in jiffies of last @timer call (for procfs); * @timer - timer for sending health monitoring request; - * @rearm - flag for gracefull stopping of @timer; + * @rearm - flag for graceful stopping of @timer; */ typedef struct { TfwApmHM *hm; @@ -514,7 +514,7 @@ typedef struct { } TfwApmRBuf; /* - * The ring buffer contol structure. + * The ring buffer control structure. * * This is a supporting structure. It keeps related data that is useful * in making decisions on the need of recalculation of percentiles. diff --git a/tempesta_fw/cache.c b/tempesta_fw/cache.c index b75236a4f..63f22f24e 100644 --- a/tempesta_fw/cache.c +++ b/tempesta_fw/cache.c @@ -68,7 +68,7 @@ static const TfwStr tfw_cache_raw_headers_304[] = { /* * @trec - Database record descriptor; * @key_len - length of key (URI + Host header); - * @status_len - length of response satus line; + * @status_len - length of response status line; * @hdr_num - number of headers; * @hdr_len - length of whole headers data; * @hdr_len_304 - length of headers data used to build 304 response; @@ -80,7 +80,7 @@ static const TfwStr tfw_cache_raw_headers_304[] = { * @resp_time - the time the response was received; * @lifetime - the cache entry's current lifetime; * @last_modified - the value of response Last-Modified: header field; - * @key - the cache enty key (URI + Host header); + * @key - the cache entry key (URI + Host header); * @status - pointer to status line (with trailing CRLFs); * @hdrs - pointer to list of HTTP headers (with trailing CRLFs); * @body - pointer to response body (with a prepending CRLF); @@ -171,7 +171,7 @@ typedef struct { static CaNode c_nodes[MAX_NUMNODES]; /* - * TODO the thread doesn't do anythng for now, however, kthread_stop() crashes + * TODO the thread doesn't do anything for now, however, kthread_stop() crashes * on restarts, so comment to logic out. */ #if 0 @@ -205,7 +205,7 @@ static TfwStr g_crlf = { .ptr = S_CRLF, .len = SLEN(S_CRLF) }; * The mask of non-cacheable methods per RFC 7231 4.2.3. * Safe methods that do not depend on a current or authoritative response * are defined as cacheable: GET, HEAD, and POST. - * Note: caching of POST method responces is not supported at this time. + * Note: caching of POST method responses is not supported at this time. * Issue #506 describes, which steps must be made to support caching of POST * requests. */ @@ -356,7 +356,7 @@ tfw_cache_employ_req(TfwHttpReq *req) * response is successfully validated." * * We can validate the stored response and serve request from - * cache. This reduses traffic to origin server. + * cache. This reduces traffic to origin server. */ return false; @@ -785,7 +785,7 @@ tfw_cache_dbce_get(TDB *db, TdbIter *iter, TfwHttpReq *req) } /* * Cache may store one or more responses to the effective Request URI. - * Basicaly, it is suffitient to store only the most recent response and + * Basically, it is sufficient to store only the most recent response and * remove other representations from cache. (RFC 7234 4: When more than * one suitable response is stored, a cache MUST use the most recent * response) But there are still some cases when it is needed to store @@ -848,7 +848,7 @@ tfw_cache_str_write_hdr(const TfwStr *str, char *p) * @return number of copied bytes (@src length). * * The function copies part of some large data of length @tot_len, - * so it tries to minimize total number of allocations regardles + * so it tries to minimize total number of allocations regardless * how many chunks are copied. */ static long @@ -1001,12 +1001,12 @@ tfw_cache_copy_hdr(char **p, TdbVRec **trec, TfwStr *src, size_t *tot_len) /** * Fill @ce->etag with entity-tag value. RFC 7232 Section-2.3 doesn't limit * etag size, so can't just have a copy of entity-tag value somewhere in @ce, - * insted fill @ce->etag TfwStr to correct offset in @ce->hdrs. Also set + * instead fill @ce->etag TfwStr to correct offset in @ce->hdrs. Also set * WEAK tag to the first chunk of @ce->etag if applied. This is needed for Range * requests. * * @h_off, @h_trec - supposed offset and record of stored 'ETag:' header; - * @curr_p, @curr_rec - used to store compaund @ce->etag. + * @curr_p, @curr_rec - used to store compound @ce->etag. */ static int __set_etag(TfwCacheEntry *ce, TfwHttpResp *resp, long h_off, TdbVRec *h_trec, @@ -1019,7 +1019,7 @@ __set_etag(TfwCacheEntry *ce, TfwHttpResp *resp, long h_off, TdbVRec *h_trec, if (TFW_STR_EMPTY(h)) return 0; - etag_val = tfw_str_next_str_val(h); /* not emptpy after http parser. */ + etag_val = tfw_str_next_str_val(h); /* not empty after http parser. */ /* Update supposed Etag offset to real value. */ /* FIXME: #803 */ @@ -1070,7 +1070,7 @@ __set_etag(TfwCacheEntry *ce, TfwHttpResp *resp, long h_off, TdbVRec *h_trec, len -= c->len; } - /* Compaund string was allocated in resp->pool, move to cache entry. */ + /* Compound string was allocated in resp->pool, move to cache entry. */ if (!TFW_STR_PLAIN(&ce->etag)) { len = sizeof(TfwStr *) * TFW_STR_CHUNKN(&ce->etag); curr_p = tdb_entry_get_room(node_db(), curr_trec, curr_p, len, @@ -1501,12 +1501,12 @@ tfw_cache_build_resp_body(TDB *db, TfwHttpResp *resp, TdbVRec *trec, * (copy the list of skbs is faster than scan TDB and build TfwHttpResp). * TLS should encrypt the data in already prepared skbs. * - * Basically, skb copy/clonning involves skb creation, so it seems performance + * Basically, skb copy/cloning involves skb creation, so it seems performance * of response body creation won't change since now we just reuse TDB pages. - * Perfromace benchmarks and profiling shows that cache_req_process_node() + * Performance benchmarks and profiling shows that cache_req_process_node() * is the bottleneck, so the problem is either in tfw_cache_dbce_get() or this * function, in headers compilation. - * Also it seems cachig prebuilt responses requires introducing + * Also it seems caching prebuilt responses requires introducing * TfwCacheEntry->resp pointer to avoid additional indexing data structure. * However, the pointer must be zeroed on TDB shutdown and recovery. * @@ -1758,7 +1758,7 @@ tfw_wq_tasklet(unsigned long data) /** * Cache management thread. - * The thread loads and preprcess static Web content using inotify (TODO). + * The thread loads and preprocesses static Web content using inotify (TODO). */ #if 0 static int diff --git a/tempesta_fw/cfg.c b/tempesta_fw/cfg.c index d601ce38f..1d7e4f0f9 100644 --- a/tempesta_fw/cfg.c +++ b/tempesta_fw/cfg.c @@ -1473,7 +1473,7 @@ EXPORT_SYMBOL(tfw_cfg_cleanup_children); * option3; * ... * } - * ...and invokes the TfwCfgSpec->handler which turns out to be this fucntion. + * ...and invokes the TfwCfgSpec->handler which turns out to be this function. * Here we simply continue parsing by recursing to parse_and_handle_cfg_entry(). * * Also, we cheat here: we don't create a new TfwCfgParserState, but rather diff --git a/tempesta_fw/cfg.h b/tempesta_fw/cfg.h index 6bfae54dd..55556b8c8 100644 --- a/tempesta_fw/cfg.h +++ b/tempesta_fw/cfg.h @@ -92,7 +92,7 @@ * following rule: * uri != "static*" -> mark = 1; * - * if parsed, will have following representaion in TfwCfgEntry{}: + * if parsed, will have following representation in TfwCfgEntry{}: * TfwCfgEntry { * .name = "rule", * ... @@ -114,7 +114,7 @@ * rule: * hdr "Referer" == "*example.com" -> mark = 7; * - * will have following representaion: + * will have following representation: * TfwCfgEntry { * .name = "rule", * ... @@ -235,7 +235,7 @@ typedef struct { * * @cleanup is another callback the purpose of which is to free memory * allocated by @handler. It is called when the configuration is unloaded - * (the system is stopped, or an error occured). The callback is invoked + * (the system is stopped, or an error occurred). The callback is invoked * when @handler was called at least once regardless of the handler's * return value. * @@ -380,7 +380,7 @@ tfw_cfg_is_dflt_value(TfwCfgEntry *cfg_entry) * Tempesta strives to support live reconfiguration. New configuration * is loaded, processed and set while Tempesta is running. Ultimately, * directives in configuration file are translated into internal data - * stractures in Tempesta. Internal data structures for data that may + * structures in Tempesta. Internal data structures for data that may * be reconfigured need to have a configuration flags member that will * indicate one of several major actions noted below. Implementation * of each action is specific to configuration entry. diff --git a/tempesta_fw/client.h b/tempesta_fw/client.h index 48de0e7dc..2a0d9deb8 100644 --- a/tempesta_fw/client.h +++ b/tempesta_fw/client.h @@ -33,7 +33,7 @@ * The client is released, when the counter reaches zero: * no connections to the server - no client for us :) * @class_prvt - private client accounting data for classifier module. - * Typically it's large and vastes memory in vain if + * Typically it's large and wastes memory in vain if * no any classification logic is used; */ typedef struct { diff --git a/tempesta_fw/connection.h b/tempesta_fw/connection.h index 20f78ed27..68f515cbd 100644 --- a/tempesta_fw/connection.h +++ b/tempesta_fw/connection.h @@ -4,7 +4,7 @@ * Definitions for generic connection management at OSI level 6 (presentation). * * Copyright (C) 2014 NatSys Lab. (info@natsys-lab.com). - * Copyright (C) 2015-2017 Tempesta Technologies, Inc. + * Copyright (C) 2015-2018 Tempesta Technologies, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -110,7 +110,7 @@ typedef struct { /* * Queues in client and server connections provide support for correct - * handlng of requests and responses. + * handling of requests and responses. * * Incoming requests are put on client connection's @seq_queue in the * order they come in. When responses to these requests come, they're @@ -237,7 +237,7 @@ typedef struct { /* * Called when there are no more users of a connection - * and the connections's resources are finally released. + * and the connection's resources are finally released. */ void (*conn_release)(TfwConn *conn); @@ -392,7 +392,7 @@ tfw_connection_link_to_sk(TfwConn *conn, struct sock *sk) } /* - * Do an oposite to what tfw_connection_link_from_sk() does. + * Do an opposite to what tfw_connection_link_from_sk() does. * Sync Sockets layer is unlinked from Tempesta, so that Tempesta * callbacks are not called anymore on events in the socket. */ diff --git a/tempesta_fw/filter.c b/tempesta_fw/filter.c index 4a5c776ad..48cbe4794 100644 --- a/tempesta_fw/filter.c +++ b/tempesta_fw/filter.c @@ -5,7 +5,7 @@ * - packet classification (e.g. should we pass or block a packet); * - packet action (e.g. drop the packet or close whole TCP connection). * Tempesta classifiers are responsible for the first task while filtering - * modules are responsible for the second one. Different classifiers can emply + * modules are responsible for the second one. Different classifiers can imply * different policies to service/block packets (e.g. QoS), so typically * filtering actions are called by classifiers. * @@ -94,8 +94,8 @@ EXPORT_SYMBOL(tfw_filter_block_ip); /** * Drop early IP layer filtering. - * The check is run agains each ingress packet - if application layer filter - * blocks a client, then the client is totaly blocked and can't send us any + * The check is run against each ingress packet - if application layer filter + * blocks a client, then the client is totally blocked and can't send us any * traffic. */ static int @@ -222,7 +222,7 @@ __ipv6_hdr_check(struct sk_buff *skb) break; case 44 : /* fragment */ /* TODO we do not support fragmented IPv6 yet. */ - default: /* unknoun or unsupported ext. header, skipping */ + default: /* unknown or unsupported ext. header, skipping */ return NULL; } } diff --git a/tempesta_fw/http.c b/tempesta_fw/http.c index 462104202..f7d42582a 100644 --- a/tempesta_fw/http.c +++ b/tempesta_fw/http.c @@ -662,7 +662,7 @@ __tfw_http_send_resp(TfwHttpReq *req, resp_code_t code) * a connection failure. There's no option to prohibit re-sending. * Thus, request's SKB can't be passed to the network layer until * certain changes are implemented. For now there's no choice but - * make a copy of requests's SKBs in SS layer. + * make a copy of request's SKBs in SS layer. * * TODO: Making a copy of each SKB _IS BAD_. See issues #391 and #488. */ @@ -1649,7 +1649,7 @@ tfw_http_req_destruct(void *msg) * to and kept in @fwd_queue of the connection @conn for that server. * If a paired request is not found, then the response must be deleted. * - * If a paired client request is missing, then it seems upsream server + * If a paired client request is missing, then it seems upstream server * is misbehaving, so the caller has to drop the server connection. * * Correct response parsing is only possible when request properties, @@ -1810,13 +1810,13 @@ tfw_http_resp_pair_free(TfwHttpReq *req) /* * Drop client connection's resources. * - * Desintegrate the client connection's @seq_list. Requests without a paired + * Disintegrate the client connection's @seq_list. Requests without a paired * response have not been answered yet. They are held in the lists of server * connections until responses come. A paired response may be in use until * TFW_HTTP_F_RESP_READY flag is not set. Don't free any of those requests. * * If a response comes or gets ready to forward after @seq_list is - * desintegrated, then both the request and the response are dropped at the + * disintegrated, then both the request and the response are dropped at the * sight of an empty list. * * Locking is necessary as @seq_list is constantly probed from server @@ -1835,9 +1835,9 @@ tfw_http_conn_cli_drop(TfwCliConn *cli_conn) return; /* - * Desintegration of the list must be done under the lock. + * Disintegration of the list must be done under the lock. * The list can't be just detached from seq_queue, and then - * be desintegrated without the lock. That would open a race + * be disintegrated without the lock. That would open a race * condition with freeing of a request in tfw_http_resp_fwd(). */ spin_lock(&cli_conn->seq_qlock); @@ -2203,7 +2203,7 @@ tfw_http_adjust_resp(TfwHttpResp *resp) if (resp->flags & TFW_HTTP_F_RESP_STALE) { #define S_WARN_110 "Warning: 110 - Response is stale" - /* TODO: ajust for #215 */ + /* TODO: adjust for #215 */ TfwStr wh = { .ptr = S_WARN_110, .len = SLEN(S_WARN_110), @@ -3295,7 +3295,7 @@ tfw_http_resp_process(TfwConn *conn, const TfwFsmData *data) } /* - * If a non critical error occured in further GFSM processing, + * If a non critical error occurred in further GFSM processing, * then the response and the paired request had been handled. * Keep the server connection open for data exchange. */ diff --git a/tempesta_fw/http.h b/tempesta_fw/http.h index e2778939e..bd7a05fd9 100644 --- a/tempesta_fw/http.h +++ b/tempesta_fw/http.h @@ -77,7 +77,7 @@ enum { /* Whole response is read. */ TFW_HTTP_FSM_RESP_MSG = TFW_GFSM_HTTP_STATE(4), - /* Run just before localy generated response sending. */ + /* Run just before locally generated response sending. */ TFW_HTTP_FSM_LOCAL_RESP_FILTER = TFW_GFSM_HTTP_STATE(5), TFW_HTTP_FSM_RESP_MSG_FWD = TFW_GFSM_HTTP_STATE(6), @@ -177,7 +177,7 @@ typedef struct { * Cookie: singular according to RFC 6265 5.4. * * TODO split the enumeration to separate server and client sets to avoid - * vasting of headers array slots. + * wasting of headers array slots. */ typedef enum { TFW_HTTP_HDR_HOST, @@ -225,7 +225,7 @@ typedef struct { * Adding a header is faster then modify it, so this speeds up headers * adjusting as well as saves cache storage. * - * Headers unconditionaly treated as hop-by-hop must be listed in + * Headers unconditionally treated as hop-by-hop must be listed in * tfw_http_init_parser_req()/tfw_http_init_parser_resp() functions and must be * members of Special headers. * group. diff --git a/tempesta_fw/http_limits.c b/tempesta_fw/http_limits.c index eacc6432d..ed8bb70fb 100644 --- a/tempesta_fw/http_limits.c +++ b/tempesta_fw/http_limits.c @@ -444,11 +444,11 @@ frang_http_uri_len(const TfwHttpReq *req, FrangAcc *ra, unsigned int uri_len) * Check all parsed headers in request headers table. * We observe all headers many times, actually on each data chunk. * However, the check is relatively fast, so that should be Ok. - * It's necessary to run the ckecks on each data chunk to prevent memory - * exhausing DoS attack on many large header fields, since we don't know + * It's necessary to run the checks on each data chunk to prevent memory + * exhausting DoS attack on many large header fields, since we don't know * which headers were read on each data chunk. * - * TODO Probably it's better to embedd a hook to HTTP parser directly to + * TODO Probably it's better to embed a hook to HTTP parser directly to * catch the long headers immediately. */ static int @@ -530,7 +530,7 @@ frang_http_ct_check(const TfwHttpReq *req, FrangAcc *ra, FrangCtVal *ct_vals) * media-type = type "/" subtype *( OWS ";" OWS parameter ) * * FIXME this matching is too permissive, e.g. we can pass - * "text/plain1", which isn't a correct subtipe. Strong FSM processing + * "text/plain1", which isn't a correct subtype. Strong FSM processing * is required. Or HTTP parser must pass only known types and Frang * decides which of them are allowed. * See also comment in frang_set_ct_vals(). @@ -562,7 +562,7 @@ frang_http_ct_check(const TfwHttpReq *req, FrangAcc *ra, FrangCtVal *ct_vals) /** * Require host header in HTTP request (RFC 7230 5.4). - * Block HTTP/1.1 requiests w/o host header, + * Block HTTP/1.1 requests w/o host header, * but just print warning for older HTTP. */ static int @@ -639,7 +639,7 @@ frang_http_host_check(const TfwHttpReq *req, FrangAcc *ra) /** * Monotonically increasing time quantums. The configured @tframe - * is devided by FRANG_FREQ slots to get the quantums granularity. + * is divided by FRANG_FREQ slots to get the quantums granularity. */ static unsigned int frang_resp_quantum(unsigned short tframe) @@ -827,7 +827,7 @@ frang_http_req_process(FrangAcc *ra, TfwConn *conn, const TfwFsmData *data) } } - /* Сheck for chunk count here to account for possible fragmentation + /* Check for chunk count here to account for possible fragmentation * in HTTP status line. The rationale for not making this one of FSM * states is the same as for the code block above. */ @@ -928,7 +928,7 @@ frang_http_req_process(FrangAcc *ra, TfwConn *conn, const TfwFsmData *data) /* * Full HTTP header has been processed, and any possible - * header faields are collected. Run final checks on them. + * header fields are collected. Run final checks on them. */ __FRANG_FSM_STATE(Frang_Req_Hdr_FieldLenFinal) { __FRANG_CFG_VAR(field_len, http_field_len); @@ -981,7 +981,7 @@ frang_http_req_process(FrangAcc *ra, TfwConn *conn, const TfwFsmData *data) __FRANG_FSM_STATE(Frang_Req_Body_Timeout) { /* * Note that this state is skipped on the first data SKB - * with body part as obviously no timeout has occured yet. + * with body part as obviously no timeout has occurred yet. */ __FRANG_CFG_VAR(body_timeout, clnt_body_timeout); if (body_timeout) { @@ -1056,7 +1056,7 @@ frang_http_req_handler(void *obj, const TfwFsmData *data) /* * Check response code and record it if it's listed in the filter. * Called from tfw_http_resp_fwd() by tfw_gfsm_move() - * Always returs TFW_PASS because this handler is needed + * Always returns TFW_PASS because this handler is needed * for collecting purposes only. */ static int diff --git a/tempesta_fw/http_match.c b/tempesta_fw/http_match.c index 202673f40..3f20cce07 100644 --- a/tempesta_fw/http_match.c +++ b/tempesta_fw/http_match.c @@ -17,7 +17,7 @@ * - @arg is the second argument in rule, its type is determined dynamically * depending on the @field (may be number/string/addr/etc); comparison * operator for @field and @arg depends on "==" ("!=") sign and on wildcard - * existance in @arg: + * existence in @arg: * "==": "arg" => eq / "arg*" => eq_prefix / "*arg" => eq_suffix. * "!=": "arg" => non_eq / "arg*" => non_eq_prefix / "*arg" => non_eq_suffix. * - @act is a rule action with appropriate type (examples specified above); @@ -28,7 +28,7 @@ * - @action_val is possible value for specified action; only "mark" action is * allowed to have value (unsigned integer type). * - * So the tfw_http_tbl_scan() threads a HTTP request sequentally across + * So the tfw_http_tbl_scan() threads a HTTP request sequentially across * all rules in all chains in the table and stops on a first matching rule (the * rule is returned). * diff --git a/tempesta_fw/http_match.h b/tempesta_fw/http_match.h index 8506b3b77..239928099 100644 --- a/tempesta_fw/http_match.h +++ b/tempesta_fw/http_match.h @@ -111,7 +111,7 @@ TfwHttpChain *tfw_http_chain_add(const char *name, TfwHttpTable *table); void tfw_http_table_free(TfwHttpTable *table); /** - * Match a HTTP request agains a list of rules in chain. + * Match a HTTP request against a list of rules in chain. * Return a matching rule. */ TfwHttpMatchRule *tfw_http_match_req(const TfwHttpReq *req, diff --git a/tempesta_fw/http_msg.c b/tempesta_fw/http_msg.c index 3dd3105b4..d28e7351d 100644 --- a/tempesta_fw/http_msg.c +++ b/tempesta_fw/http_msg.c @@ -272,7 +272,7 @@ __hdr_is_singular(const TfwStr *hdr) /** * Lookup for the header @hdr in already collected headers table @ht, * i.e. check whether the header is duplicate. - * The lookup is performed untill ':', so header name only is enough in @hdr. + * The lookup is performed until ':', so header name only is enough in @hdr. * @return the header id. */ unsigned int @@ -494,7 +494,7 @@ __hdr_add(TfwHttpMsg *hm, const TfwStr *hdr, unsigned int hid) /* * Initialize the header table item by the iterator chunks. - * While the data references in the item are valid, some convetions + * While the data references in the item are valid, some conventions * (e.g. header name and value are placed in different chunks) aren't * satisfied. So don't consider the header for normal HTTP processing. */ @@ -613,7 +613,7 @@ __hdr_sub(TfwHttpMsg *hm, const TfwStr *hdr, unsigned int hid) /** * Transform HTTP message @hm header with identifier @hid. - * @hdr must be compaund string and contain two or three parts: + * @hdr must be compound string and contain two or three parts: * header name, colon and header value. If @hdr value is empty, * then the header will be deleted from @hm. * If @hm already has the header it will be replaced by the new header @@ -871,7 +871,7 @@ tfw_http_msg_write(TfwMsgIter *it, TfwHttpMsg *hm, const TfwStr *data) if (c_size < f_room) { /* * The chunk fits in the SKB fragment with room - * to spare. Stay in the same SKB fragment, swith + * to spare. Stay in the same SKB fragment, switch * to next chunk of the string. */ c_off = 0; diff --git a/tempesta_fw/http_parser.c b/tempesta_fw/http_parser.c index 3e36fbc58..3379cd06d 100644 --- a/tempesta_fw/http_parser.c +++ b/tempesta_fw/http_parser.c @@ -596,7 +596,7 @@ mark_raw_hbh(TfwHttpMsg *hm, TfwStr *hdr) /** * Lookup for the header @hdr in already collected headers table @ht, - * and mark it as hop-by-hop. The lookup is performed untill ':', so header + * and mark it as hop-by-hop. The lookup is performed until ':', so header * name only is enough in @hdr. * * @return true if @hdr was found and marked as hop-by-hop @@ -609,7 +609,7 @@ __mark_hbh_hdr(TfwHttpMsg *hm, TfwStr *hdr) /* * This function is called before hm->h_tbl is fully parsed, - * if header is epmty, don't touch it + * if header is empty, don't touch it */ if ((hid >= ht->off) || (TFW_STR_EMPTY(&ht->tbl[hid]))) return false; @@ -620,7 +620,7 @@ __mark_hbh_hdr(TfwHttpMsg *hm, TfwStr *hdr) /** * Add header name listed in Connection header to table of raw headers. - * If @last is true then (@data, @len) represnts last chunk of header name and + * If @last is true then (@data, @len) represents last chunk of header name and * chunk with ':' will be added to the end. Otherwize last header in table stays * open to add more data. * @@ -880,7 +880,7 @@ __FSM_STATE(RGen_CRLFCR) { \ * We have HTTP message descriptors and special headers, * however we still need to store full headers (instead of just their values) * as well as store headers which aren't need in further processing - * (e.g. Content-Length which is doubled by TfwHttpMsg.conent_length) + * (e.g. Content-Length which is doubled by TfwHttpMsg.content_length) * to mangle row skb data. */ #define __TFW_HTTP_PARSE_SPECHDR_VAL(st_curr, st_i, hm, func, id, saveval) \ @@ -988,7 +988,7 @@ __FSM_STATE(RGen_HdrOtherN) { \ } \ __FSM_STATE(RGen_HdrOtherV) { \ /* \ - * The header content is opaqueue for us, \ + * The header content is opaque for us, \ * so pass ctext and VCHAR. \ */ \ __FSM_MATCH_MOVE(ctext_vchar, RGen_HdrOtherV); \ @@ -1228,7 +1228,7 @@ __parse_connection(TfwHttpMsg *hm, unsigned char *data, size_t len) * TODO: RFC 6455 WebSocket Protocol * During handshake client sets "Connection: update" and "Update" header. * This headers should be passed to server unchanged to allow - * WebSocket porotol. + * WebSocket protocol. */ __FSM_STATE(I_Conn) { /* Boolean connection tokens */ @@ -2204,7 +2204,7 @@ __req_parse_cookie(TfwHttpMsg *hm, unsigned char *data, size_t len) /* ';' was already matched. */ __FSM_STATE(Req_I_CookieSemicolon) { /* - * Fixup current delimeters chunk and move to next parameter + * Fixup current delimiters chunk and move to next parameter * if we can eat ';' and SP at once. */ if (likely(__data_available(p, 2))) { @@ -2214,7 +2214,7 @@ __req_parse_cookie(TfwHttpMsg *hm, unsigned char *data, size_t len) } /* * Only ';' is available now: fixup ';' as independent chunk, - * SP willbe fixed up at next enter to the FSM. + * SP will be fixed up at next enter to the FSM. */ __FSM_I_MOVE_fixup(Req_I_CookieSP, 1, 0); } @@ -2222,7 +2222,7 @@ __req_parse_cookie(TfwHttpMsg *hm, unsigned char *data, size_t len) __FSM_STATE(Req_I_CookieSP) { if (unlikely(c != ' ')) return CSTR_NEQ; - /* Fixup current delimeters chunk and move to next parameter. */ + /* Fixup current delimiters chunk and move to next parameter. */ __FSM_I_MOVE_fixup(Req_I_CookieStart, 1, 0); } @@ -2249,7 +2249,7 @@ __parse_etag(TfwHttpMsg *hm, unsigned char *data, size_t len) /* * ETag value and closing DQUOTE is placed into separate chunks marked - * with flags TFW_STR_VALUE and TFW_STR_ETAG_WEAK (optionaly). + * with flags TFW_STR_VALUE and TFW_STR_ETAG_WEAK (optionally). * Closing DQUOTE is used to support empty Etags. Opening is not added * to simplify usage of tfw_stricmpspn() * @@ -2441,7 +2441,7 @@ __req_parse_referer(TfwHttpMsg *hm, unsigned char *data, size_t len) * Parse response Expires, RFC 2616 14.21. * * We support only RFC 1123 date as it's most usable by modern software. - * However RFC 2616 reuires that all server and client software MUST support + * However RFC 2616 requires that all server and client software MUST support * all 3 formats specified in 3.3.1 chapter. We leave this for TODO. * * @return number of seconds since epoch in GMT. @@ -3061,7 +3061,7 @@ tfw_http_parse_req(void *req_data, unsigned char *data, size_t len) /* ---------------- Request Line ---------------- */ - /* Parser internal initilizers, must be called once per message. */ + /* Parser internal initializers, must be called once per message. */ __FSM_STATE(Req_0) { if (unlikely(IS_CRLF(c))) __FSM_MOVE_nofixup(Req_0); @@ -3241,7 +3241,7 @@ tfw_http_parse_req(void *req_data, unsigned char *data, size_t len) * RFC 3986 chapter 3.2: authority = [userinfo@]host[:port] * * Authority parsing: it can be "host" or "userinfo@host" (port is - * parsed later). At the begining we don't know, which of variants we + * parsed later). At the beginning we don't know, which of variants we * have. So we fill req->host, and if we get '@', we copy host to * req->userinfo, reset req->host and fill it. */ @@ -3477,7 +3477,7 @@ tfw_http_parse_req(void *req_data, unsigned char *data, size_t len) /* Ensure we have enough data for largest match. */ if (unlikely(!__data_available(p, 14))) __FSM_MOVE(Req_HdrC); - /* Qick switch for HTTP headers with the same prefix. */ + /* Quick switch for HTTP headers with the same prefix. */ switch (TFW_P2LCINT(p + 1)) { case TFW_CHAR4_INT('a', 'c', 'h', 'e'): if (likely(*(p + 5) == '-' @@ -4409,7 +4409,7 @@ tfw_http_parse_terminate(TfwHttpMsg *hm) /* * Set Content-Length header to warn client about end of message. * Other option is to close connection to client. All the situations - * when Content-Length header must not present in responce were + * when Content-Length header must not present in response were * checked earlier. Refer to RFC 7230 3.3.3 */ if (hm->parser.state == Resp_BodyUnlimRead @@ -4483,7 +4483,7 @@ tfw_http_parse_resp(void *resp_data, unsigned char *data, size_t len) /* ---------------- Status Line ---------------- */ - /* Parser internal initilizers, must be called once per message. */ + /* Parser internal initializers, must be called once per message. */ __FSM_STATE(Resp_0) { if (unlikely(IS_CRLF(c))) __FSM_MOVE_nofixup(Resp_0); @@ -4594,7 +4594,7 @@ tfw_http_parse_resp(void *resp_data, unsigned char *data, size_t len) /* Ensure we have enough data for largest match. */ if (unlikely(!__data_available(p, 14))) __FSM_MOVE(Resp_HdrC); - /* Qick switch for HTTP headers with the same prefix. */ + /* Quick switch for HTTP headers with the same prefix. */ switch (TFW_P2LCINT(p + 1)) { case TFW_CHAR4_INT('a', 'c', 'h', 'e'): if (likely(*(p + 5) == '-' diff --git a/tempesta_fw/http_sched_hash.c b/tempesta_fw/http_sched_hash.c index e4deb96ef..a850287bd 100644 --- a/tempesta_fw/http_sched_hash.c +++ b/tempesta_fw/http_sched_hash.c @@ -143,7 +143,7 @@ __is_conn_suitable(TfwSrvConn *conn, bool hmonitor) * The server is chosen based on the hash value of URI/Host fields of the @msg, * so multiple requests to the same resource are mapped to the same server. * - * Higest Random Weight hashing method is involved: for each message we + * Highest Random Weight hashing method is involved: for each message we * calculate randomized weights as follows: (msg_hash ^ srv_conn_hash), * and pick a server/connection with the highest weight. * That sticks messages with certain Host/URI to certain server connection. diff --git a/tempesta_fw/http_sched_ratio.c b/tempesta_fw/http_sched_ratio.c index 8991d36ef..6e91b7194 100644 --- a/tempesta_fw/http_sched_ratio.c +++ b/tempesta_fw/http_sched_ratio.c @@ -858,7 +858,7 @@ tfw_sched_ratio_sched_srv_conn(TfwMsg *msg, TfwServer *srv) /* * Bypass the suspend checking if connection is needed for - * helth monitoring of backend server. + * health monitoring of backend server. */ if (!(((TfwHttpReq *)msg)->flags & TFW_HTTP_F_HMONITOR) && tfw_srv_suspended(srv)) @@ -1014,7 +1014,7 @@ tfw_sched_ratio_del_grp(TfwSrvGroup *sg) * Make sure the timer doesn't re-arms itself. This also ensures * that no more RCU callbacks are created. * - * TODO: check if the memory barriers is redundand here (and in + * TODO: check if the memory barriers is redundant here (and in * several similar places as well as in corresponding timer * callbacks); also it seems that function 'del_timer_sync' * process correctly the situation with reactivation of timer diff --git a/tempesta_fw/http_sess.c b/tempesta_fw/http_sess.c index 106f93c43..cfea0202f 100644 --- a/tempesta_fw/http_sess.c +++ b/tempesta_fw/http_sess.c @@ -12,7 +12,7 @@ * challenge), safe load balancing for session oriented Web apps and so on. * The term 'Client' is actually vague. Different human clients can be behind * shared proxy having the same source IP (i.e. the same TfwClient descriptor). - * The same human client can use differnt browsers, so they send different + * The same human client can use different browsers, so they send different * User-Agent headers and use different sticky cookies. X-Forwarded-For header * value can be used to cope the non anonymous forward proxy problem and * identify real clients. @@ -60,7 +60,7 @@ * @name - name of sticky cookie; * @name_eq - @name plus "=" to make some operations faster; * @sess_lifetime - session lifetime in seconds; - * @max_misses - maximum count of requsts with invalid cookie; + * @max_misses - maximum count of requests with invalid cookie; * @tmt_sec - maximum time (in seconds) to wait the request * with valid cookie; */ @@ -155,7 +155,7 @@ static const unsigned short tfw_cfg_redirect_st_code_dflt = 302; * 'Accept: text/html' and GET method. */ static bool -tfw_http_sticky_redirect_apllied(TfwHttpReq *req) +tfw_http_sticky_redirect_applied(TfwHttpReq *req) { if (!tfw_cfg_js_ch) return true; @@ -221,7 +221,7 @@ tfw_http_sticky_send_redirect(TfwHttpReq *req, StickyVal *sv, RedirMarkVal *mv) * Non-challengeable requests also must be rate limited. */ - if (!tfw_http_sticky_redirect_apllied(req)) + if (!tfw_http_sticky_redirect_applied(req)) return TFW_HTTP_SESS_JS_NOT_SUPPORTED; if (!(resp = tfw_http_msg_alloc_resp_light(req))) @@ -236,8 +236,8 @@ tfw_http_sticky_send_redirect(TfwHttpReq *req, StickyVal *sv, RedirMarkVal *mv) * | HMAC(Secret, User-Agent, timestamp, Client IP) * * Open is required to be able to recalculate secret HMAC. - * Since the secret is unknown for the attacker, they're still unable to - * recalculate HMAC while we don't need to store session information + * Since the secret is unknown for the attackers, they're still unable + * to recalculate HMAC while we don't need to store session information * until we receive correct cookie value. */ bin2hex(c_buf, &ts_be64, sizeof(ts_be64)); @@ -887,7 +887,7 @@ tfw_http_sess_check_jsch(StickyVal *sv, TfwHttpReq* req) if (time_in_range(req->jrxtstamp, min_time, max_time)) return 0; - if (tfw_http_sticky_redirect_apllied(req)) { + if (tfw_http_sticky_redirect_applied(req)) { TFW_DBG("sess: jsch block: request received outside allowed " "time range.\n"); return TFW_HTTP_SESS_VIOLATE; @@ -1056,7 +1056,7 @@ tfw_http_sess_pin_srv(TfwStickyConn *st_conn, TfwSrvConn *srv_conn) } /** - * Find an outgoing connection for client with tempesta sticky cookie. + * Find an outgoing connection for client with Tempesta sticky cookie. * @sess is not null when calling the function. * * Reuse req->sess->st_conn.srv_conn if it is alive. If not, diff --git a/tempesta_fw/http_sess.h b/tempesta_fw/http_sess.h index 97a784b42..a01063e26 100644 --- a/tempesta_fw/http_sess.h +++ b/tempesta_fw/http_sess.h @@ -1,7 +1,7 @@ /* * Tempesta FW * - * Copyright (C) 2017 Tempesta Technologies, Inc. + * Copyright (C) 2017-2018 Tempesta Technologies, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -33,7 +33,7 @@ * scheduling routine to obtain target server and pin the session to it. * * 2. Session pinning is switched to 'disable'. Keep using pinned server until - * session is expired. (Alternative: unpin sesion from a server and use generic + * session is expired. (Alternative: unpin session from a server and use generic * scheduling algorithm.) * * 3. A new server is added to main/backup group. New sessions will be @@ -47,7 +47,7 @@ * 5. Main and backup group is removed from new configuration. Same as p. 4. * * 6. Main and backup group are no more interchangeable; according to the new - * HTTP match rules sessions must be pinned to complitely other server groups. + * HTTP match rules sessions must be pinned to completely other server groups. * This cases cannot be deduced during live reconfiguration, manual session * removing is required. End user should avoid such configurations. * @@ -81,7 +81,7 @@ struct tfw_http_sess_t { enum { /* Internal error, may be any number < 0. */ TFW_HTTP_SESS_FAILURE = -1, - /* Session successfuly obtained. */ + /* Session successfully obtained. */ TFW_HTTP_SESS_SUCCESS = 0, /* Can't obtain session: new client; a redirection message sent. */ TFW_HTTP_SESS_REDIRECT_SENT, diff --git a/tempesta_fw/http_tbl.c b/tempesta_fw/http_tbl.c index b789569ec..9f1c0393a 100644 --- a/tempesta_fw/http_tbl.c +++ b/tempesta_fw/http_tbl.c @@ -5,7 +5,7 @@ * * The goal of this module is to implement HTTP requests routing system based on * HTTP message contents, that is, to provide user a way to route HTTP requests - * to different virtual hosts locations for additional analizing and then - to + * to different virtual hosts locations for additional analyzing and then - to * different back-end server groups depending on HTTP request fields: * Host, URI, headers, etc. * @@ -18,7 +18,7 @@ * scheduler module allows you to reach that. * * We utilize rule-based HTTP matching logic from http_match.c here. - * User defines a namber for chains with lists of pattern-matching rules + * User defines a number for chains with lists of pattern-matching rules * in a configuration file, and we match every request against all rules, * in all linked chains of current HTTP table and the first matching rule * determines a virtual host to which the request is redirected. @@ -346,7 +346,7 @@ tfw_cfgop_http_tbl_chain_finish(TfwCfgSpec *cs) * the list of rules of current chain. * * Syntax: - * +------------------------ First operand of rule's conition part + * +------------------------ First operand of rule's condition part * | (HTTP request field or 'mark'); * | +-------------------- Condition type: equal ('==') or not * | | equal ('!='); @@ -378,7 +378,7 @@ tfw_cfgop_http_rule(TfwCfgSpec *cs, TfwCfgEntry *e) if ((r = tfw_cfg_check_val_n(e, 0))) return r; if (e->attr_n) { - TFW_ERR_NL("Attibutes count must be zero\n"); + TFW_ERR_NL("Attributes count must be zero\n"); return -EINVAL; } diff --git a/tempesta_fw/log.h b/tempesta_fw/log.h index c6e5e063c..d4f2beb11 100644 --- a/tempesta_fw/log.h +++ b/tempesta_fw/log.h @@ -2,7 +2,7 @@ * Tempesta FW * * Copyright (C) 2014 NatSys Lab. (info@natsys-lab.com). - * Copyright (C) 2015-2017 Tempesta Technologies, Inc. + * Copyright (C) 2015-2018 Tempesta Technologies, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -43,7 +43,7 @@ * 2 [SUPPORT] - key events at lower (component) levels (e.g. TDB or SS). * Only events required for technical support should be logged * on this level; - * 3 [DEVELOP] - verbose loging, used for engineer debugging internal + * 3 [DEVELOP] - verbose logging, used for engineer debugging internal * algorithms and so on. Typically for single slow connection * cases. */ diff --git a/tempesta_fw/main.c b/tempesta_fw/main.c index b297d843c..be3f429e9 100644 --- a/tempesta_fw/main.c +++ b/tempesta_fw/main.c @@ -173,7 +173,7 @@ tfw_mods_cfgstart(struct list_head *mod_list) return ret; } } - TFW_LOG("Prepearing for the configuration processing.\n"); + TFW_LOG("Preparing for the configuration processing.\n"); return 0; } diff --git a/tempesta_fw/pool.c b/tempesta_fw/pool.c index 4fc044942..ec89ad2db 100644 --- a/tempesta_fw/pool.c +++ b/tempesta_fw/pool.c @@ -14,7 +14,7 @@ * (b) TfwHttpHdrTbl follows the message descriptor; * (c) many TfwStr's for each HTTP field; * 2. TfwHttpHdrTbl can be rarely reallocated - since it's followed by TfwStr - * allocations we always lose it's memory. The table grows exponentilly + * allocations we always lose it's memory. The table grows exponentially * minimizing number of reallocations and Frang controls number and size * of the reallocations; * 3. TfwStr grows while we're reading it, so this is last allocation when we diff --git a/tempesta_fw/sched.c b/tempesta_fw/sched.c index f3a0eef32..74b49763d 100644 --- a/tempesta_fw/sched.c +++ b/tempesta_fw/sched.c @@ -1,7 +1,7 @@ /** * Tempesta FW * - * Requst schedulers interface. + * Request schedulers interface. * * Copyright (C) 2014 NatSys Lab. (info@natsys-lab.com). * Copyright (C) 2015-2018 Tempesta Technologies, Inc. diff --git a/tempesta_fw/server.c b/tempesta_fw/server.c index a55c27634..dcdc8b7f6 100644 --- a/tempesta_fw/server.c +++ b/tempesta_fw/server.c @@ -59,9 +59,9 @@ static atomic64_t act_sg_n = ATOMIC64_INIT(0); * Lifetime of both TfwServer and TfwSrvGroup is controlled by reference * counters. Note, that TfwSrvGroup stores references to servers while * TfwServer stores back reference to it's server group. Thus servers - * must be removed from a server group to breack the reference loop. + * must be removed from a server group to break the reference loop. * When a server connection is scheduled for connect it increments server's - * reference count and decrements it after inteded disconnect. + * reference count and decrements it after intended disconnect. */ #define TFW_SG_HBITS 10 static DECLARE_HASHTABLE(sg_hash, TFW_SG_HBITS); @@ -404,7 +404,7 @@ __tfw_sg_for_each_srv(TfwSrvGroup *sg, } /** - * Iterate over all the acive server groups and call @cb for each server. + * Iterate over all the active server groups and call @cb for each server. * @cb is called under spin-lock, so can't sleep. * @cb is considered as updater, so write lock is used. */ diff --git a/tempesta_fw/server.h b/tempesta_fw/server.h index d26802b85..c6c8aa352 100644 --- a/tempesta_fw/server.h +++ b/tempesta_fw/server.h @@ -147,7 +147,7 @@ typedef struct { | TFW_SG_F_SCHED_RATIO_DYNAMIC \ | TFW_SG_F_SCHED_RATIO_PREDICT) -#define TFW_SRV_RETRY_NIP 0x0100 /* Retry non-idemporent req. */ +#define TFW_SRV_RETRY_NIP 0x0100 /* Retry non-idempotent req. */ #define TFW_SRV_STICKY 0x0200 /* Use sticky sessions. */ #define TFW_SRV_STICKY_FAILOVER 0x0400 /* Allow failovering. */ #define TFW_SRV_STICKY_FLAGS \ diff --git a/tempesta_fw/sock.c b/tempesta_fw/sock.c index 2f14b5164..7c4de46ad 100644 --- a/tempesta_fw/sock.c +++ b/tempesta_fw/sock.c @@ -68,7 +68,7 @@ typedef struct { /** * Node of close backlog. * - * @ticket - the work ticket used in trurnstile to order items from the + * @ticket - the work ticket used in turnstile to order items from the * backlog with ring-buffer items; * @list - list entry in the backlog; * @sw - work descriptor to perform. @@ -102,7 +102,7 @@ static const char *ss_statename[] = { * Meantime, system shutdown is performed in process context. * So __ss_act_cnt and the constants at the below are used to count number of * upcalls and downcalls on the fly and synchronize shutdown process with the - * calls: the shutdown process must wait untill all the calls finished and + * calls: the shutdown process must wait until all the calls finished and * no new calls can be executed. * * However, softirqs can call SS down- or upcall any time. Moreover, there could @@ -506,7 +506,7 @@ EXPORT_SYMBOL(ss_send); * Note: it used to be called in process context as well, at the time when * Tempesta starts or stops. That's not the case right now, but it may change. * - * TODO In some cases we need to close socket agresively w/o FIN_WAIT_2 state, + * TODO In some cases we need to close socket aggressively w/o FIN_WAIT_2 state, * e.g. by sending RST. So we need to add second parameter to the function * which says how to close the socket. * One of the examples is rcl_req_limit() (it should reset connections). @@ -872,7 +872,7 @@ ss_tcp_data_ready(struct sock *sk) else { /* * Check for URG data. - * TODO shouldn't we do it in th_tcp_process_data()? + * TODO shouldn't we do it in ss_tcp_process_data()? */ struct tcp_sock *tp = tcp_sk(sk); if (tp->urg_data & TCP_URG_VALID) { @@ -989,7 +989,7 @@ ss_tcp_state_change(struct sock *sk) * TCP_ESTABLISHED state to a closing state, we forcefully * close the socket before it can reach the final state. * - * We get here when an error has occured in the connection. + * We get here when an error has occurred in the connection. * It could be that RST was received which may happen for * multiple reasons. Or it could be a case of TCP timeout * where the connection appears to be dead. In all of these @@ -1229,7 +1229,7 @@ ss_connect(struct sock *sk, const TfwAddr *addr, int flags) bh_unlock_sock(sk); /* - * If connect() successfully returns, then the soket is living somewhere + * If connect() successfully returns, then the socket is living somewhere * in TCP code and it will move to established or closed state. * So we decrement __ss_act_cnt when the socket die, no need to do this now. */ @@ -1333,7 +1333,7 @@ ss_tx_action(void) /* * @budget limits the loop to prevent live lock on constantly arriving * new items. We use some small integer as a lower bound to catch just - * ariving items. + * arriving items. */ budget = max(10UL, ss_wq_local_size(wq)); while ((!ss_active() || budget--) && !ss_wq_pop(wq, &sw, &ticket)) { @@ -1446,7 +1446,7 @@ ss_wait_newconn(void) EXPORT_SYMBOL(ss_wait_newconn); /** - * Wait until there are no queued works and no runnign tasklets. + * Wait until there are no queued works and no running tasklets. * The function should be used when all sockets are closed. * SS upcalls are protected with SS_V_ACT_LIVECONN. * Can sleep, so must be called from user-space context. diff --git a/tempesta_fw/sock_clnt.c b/tempesta_fw/sock_clnt.c index 1e9d7ef18..b88389a39 100644 --- a/tempesta_fw/sock_clnt.c +++ b/tempesta_fw/sock_clnt.c @@ -209,7 +209,7 @@ tfw_sock_clnt_new(struct sock *sk) } /** - * Do the same stuff for intetional client connection closing and due to some + * Do the same stuff for intentional client connection closing and due to some * error on TCP socket or application layers. */ static void @@ -268,7 +268,7 @@ static int __cli_conn_close_cb(TfwConn *conn) { /* - * Use assynchronous closing to release peer connection list and + * Use asynchronous closing to release peer connection list and * client hash bucket locks as soon as possible and let softirq * do all the jobs. */ @@ -596,9 +596,9 @@ tfw_sock_clnt_stop(void) /* * Now all listening sockets are closed, so no new connections * can appear. Close all established client connections. - * We're going to acquie client hash bucket and peer connection list - * locks, so disable softiqs to avoid deadlock with the sockets closing - * in softiq context. + * We're going to acquire client hash bucket and peer connection list + * locks, so disable softirq to avoid deadlock with the sockets closing + * in softirq context. */ local_bh_disable(); while (tfw_client_for_each(tfw_cli_conn_close_all)) { diff --git a/tempesta_fw/sock_srv.c b/tempesta_fw/sock_srv.c index 24dcf11df..9ddf27719 100644 --- a/tempesta_fw/sock_srv.c +++ b/tempesta_fw/sock_srv.c @@ -181,7 +181,7 @@ tfw_sock_srv_connect_try(TfwSrvConn *srv_conn) * connection_drop hook from SoftIRQ, there can't be another * socket state change upcall from SS layer due to RSS. * - * Thus we don't need syncronization for ss_connect(). + * Thus we don't need synchronization for ss_connect(). */ TFW_INC_STAT_BH(serv.conn_attempts); r = ss_connect(sk, addr, 0); @@ -385,7 +385,7 @@ tfw_sock_srv_connect_failover(struct sock *sk) TFW_DBG_ADDR("connection error", &srv->addr, TFW_WITH_PORT); /* - * Distiguish connections that go to failover state + * Distinguish connections that go to failover state * from those that are in failover state already. */ if (tfw_connection_live(conn)) { @@ -808,7 +808,7 @@ static struct kmem_cache *tfw_sg_cfg_cache; * not possible. Instead current configuration must be updated step-by-step * to comply the new configuration. * - * Update process is splitted in two stages: + * Update process is split in two stages: * - configuration parsing stage: tfw_sock_srv_cfgstart(), TfwCfgSpec handlers * and tfw_sock_srv_cfgend(). It's normal if an error happens during the * stage since the new configuration is provided by a user and may contain @@ -826,7 +826,7 @@ static struct kmem_cache *tfw_sg_cfg_cache; * * On applying stage changes from @parsed_sg are distributed to @orig_sg if * @orig_sg is available, or @parsed_sg is promoted to active group by - * starting it's connetions otherwize. After that list of server groups + * starting it's connections otherwize. After that list of server groups * available after reconfig replaces list of active groups by * tfw_sg_apply_reconfig() call. * diff --git a/tempesta_fw/ss_skb.c b/tempesta_fw/ss_skb.c index 29ccb934a..7a30f14af 100644 --- a/tempesta_fw/ss_skb.c +++ b/tempesta_fw/ss_skb.c @@ -3,7 +3,7 @@ * * Helpers for Linux socket buffers manipulation. * - * Application protocol handler layers must inplement zero data copy logic + * Application protocol handler layers must implement zero data copy logic * on top on native Linux socket buffers. The helpers provide common and * convenient wrappers for skb processing. * @@ -62,7 +62,7 @@ ss_skb_fmt_src_addr(const struct sk_buff *skb, char *out_buf) /** * Allocate a new skb that can hold @len bytes of data. * - * An SKB is created complely headerless. The linear part of an SKB is + * An SKB is created completely headerless. The linear part of an SKB is * set apart for headers, and stream data is placed in paged fragments. * Lower layers will take care of prepending all required headers. * @@ -1148,7 +1148,7 @@ ss_skb_unroll_slow(struct sk_buff **skb_head, struct sk_buff *skb) * handle frag_list fragments. Such SKBs lose data in frag_list and generally * get malformed. * - * TODO: It's conceiveable that skb_split() can be modified to handle data + * TODO: It's conceivable that skb_split() can be modified to handle data * in frag_list. However a thorough research is required to see if such SKBs * are handled properly in other parts of the kernel's stack. * @@ -1204,7 +1204,7 @@ ss_skb_unroll(struct sk_buff **skb_head, struct sk_buff *skb) * The routine helps you to dump content of any skb. * It's supposed to be used for debugging purpose, so non-limited printing * is used. - * BEWARE: dont' call it too frequetly. + * BEWARE: don't call it too frequently. */ void ss_skb_dump(struct sk_buff *skb) diff --git a/tempesta_fw/str.c b/tempesta_fw/str.c index 921c9fbcd..3ae96ca18 100644 --- a/tempesta_fw/str.c +++ b/tempesta_fw/str.c @@ -226,7 +226,7 @@ tfw_str_add_compound(TfwPool *pool, TfwStr *str) /** * Add place for a new duplicate to string tree @str, - * the string is probably alredy a set of duplicate compound strings. + * the string is probably already a set of duplicate compound strings. */ TfwStr * tfw_str_add_duplicate(TfwPool *pool, TfwStr *str) @@ -718,7 +718,7 @@ tfw_str_eq_cstr_off(const TfwStr *str, ssize_t offset, const char *cstr, EXPORT_SYMBOL(tfw_str_eq_cstr_off); /** - * The function intentionaly breaks zero-copy string design. And should + * The function intentionally breaks zero-copy string design. And should * be used for short-strings only. * * Join all chunks of @str to a single plain C string. @@ -765,11 +765,11 @@ tfw_str_to_cstr(const TfwStr *str, char *out_buf, int buf_size) EXPORT_SYMBOL(tfw_str_to_cstr); /** - * HTTP parser can break strings into several chuncks and mark some of them - * with TFW_STR_VALUE flag. Single string value may oqupie more than one chunk, + * HTTP parser can break strings into several chunks and mark some of them + * with TFW_STR_VALUE flag. Single string value may occupy more than one chunk, * independent string values divided by non-flagged chunks. * - * Return compaund TfwStr starting at next string value. + * Return compound TfwStr starting at next string value. */ TfwStr tfw_str_next_str_val(const TfwStr *str) diff --git a/tempesta_fw/str.h b/tempesta_fw/str.h index 256247bfe..991e3ddef 100644 --- a/tempesta_fw/str.h +++ b/tempesta_fw/str.h @@ -4,10 +4,10 @@ * String handling. * There are few design concepts and properties which make our strings special: * - * 1. the string is designed for zero-copy operations, i.e. it hanles pointer + * 1. the string is designed for zero-copy operations, i.e. it handles pointer * only to actual data stored somewhere else, typically in skb; * - * 2. the string handles possibly chunked data, e.g. splitted among different + * 2. the string handles possibly chunked data, e.g. split among different * skbs. In this case COMPOUND flag is used; * * 3. it is HTTP specific in that sense that the string aggregates duplicate @@ -24,7 +24,7 @@ * so we must keep skb pointers to be able to rewrite underlying packets. * * String can either contain plain data, in which case `ptr` field is used as - * a pointer to a continuos region, or multiple chunks of data, in which case + * a pointer to a continuous region, or multiple chunks of data, in which case * `ptr` points to an array of plain TfwStr's. In other words, a single * indirection is expected. If string have more than one chunk, it's called * a "compound" string. `len` field of a compound string contains total length @@ -33,7 +33,7 @@ * * Another possibility is a so called duplicate string. A duplicate string is * a bunch of strings that describe HTTP fields with the same name. - * For example, an HTTP server can return mulitple Set-Cookie fields; + * For example, an HTTP server can return multiple Set-Cookie fields; * all of those will end up in a duplicate string. Such strings use `ptr` * field as an array of TfwStr's, each of which can be a compound string. * A duplicate string can not itself consist of duplicate strings. @@ -80,7 +80,7 @@ * some other context. Keep in mind that TfwStr uses the functions as well. * * The functions are optimistic for the data of length 64 and more bytes, - * i.e. comapring or matchin long strings you assume that the strings are + * i.e. comparing or matching long strings you assume that the strings are * matched (in case of tfw_match_*) or the same (in case of tfw_stricmp). * 64 and 128 byte subroutines of the functions load and process 2 and 4 * 32-byre registers in parallel utilizing the memory bus and avoiding @@ -183,7 +183,7 @@ size_t tfw_ultoa(unsigned long ai, char *buf, unsigned int len); /* Str is compound from many chunks, use indirect table for the chunks. */ #define __TFW_STR_COMPOUND (~((1U << TFW_STR_FBITS) - 1)) /* - * Str constists from compound or plain strings. + * Str consists from compound or plain strings. * Duplicate strings are also always compound on root level. */ #define TFW_STR_DUPLICATE 0x01 @@ -224,7 +224,7 @@ typedef struct { /* Use this with "%.*s" in printing calls. */ #define PR_TFW_STR(s) (int)min(20UL, (s)->len), (char *)(s)->ptr -/* Numner of chunks in @s. */ +/* Number of chunks in @s. */ #define TFW_STR_CHUNKN(s) ((s)->flags >> TFW_STR_CN_SHIFT) #define TFW_STR_CHUNKN_LIM(s) ((s)->flags >= __TFW_STR_CN_MAX) #define TFW_STR_CHUNKN_ADD(s, n) ((s)->flags += ((n) << TFW_STR_CN_SHIFT)) diff --git a/tempesta_fw/str_simd.c b/tempesta_fw/str_simd.c index 89c1c1800..0551a781c 100644 --- a/tempesta_fw/str_simd.c +++ b/tempesta_fw/str_simd.c @@ -2,7 +2,7 @@ * Tempesta FW * * x86-64 SIMD routines for HTTP strings processing. See the algorithms' - * description and perfomance comparison with other implementations at + * description and performance comparison with other implementations at * http://natsys-lab.blogspot.ru/2016/10/http-strings-processing-using-c-sse42.html * * Copyright (C) 2016-2018 Tempesta Technologies, Inc. @@ -40,12 +40,12 @@ * @D - ASCII 'z' - 'a' + 1 * @LCASE - 0x20 converting upper case character to lower case; * @ARF - ASCII rows factors; - * @LSH - Mask for least sigificant half of bytes; + * @LSH - Mask for least significant half of bytes; * @_uri - ASCII table column bitmaps for HTTP URI abs_path (RFC 3986); * @_token - ASCII table column bitmaps for HTTP token, e.g. header name * (RFC 7230 3.2.6); * @_qetoken - `token` with double quotes and equal sign; - * @_nctl - ASCII VCHAR (RFC RFC 5234, Apendix B.1.) plus SP and HTAB, + * @_nctl - ASCII VCHAR (RFC RFC 5234, Appendix B.1.) plus SP and HTAB, * used to accept HTTP header values; * @_xff - ASCII characters for HTTP X-Forwarded-For header (RFC 7239); * @_cookie - cookie-octet as defined in RFC 6265 4.1.1 plus DQUOTE; @@ -224,7 +224,7 @@ tfw_str_init_const(void) 0xe8, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xf8, 0xf8, 0xf4, 0x54, 0xd0, 0x5c, 0xf4, 0x70); /* - * RFC 7230, Apendix B; RFC 5234, Apendix B.1.: + * RFC 7230, Appendix B; RFC 5234, Appendix B.1.: * * field-value OWS = VCHAR SP HTAB = %x9 %x20-7E * @@ -1613,7 +1613,7 @@ __tfw_match_custom16(const char *str, __m128i *bm128_0, __m128i *bm128_1) } /** - * @return legth of set of custom defined characters in @str. + * @return length of set of custom defined characters in @str. * https://github.com/tempesta-tech/tempesta/issues/628 */ static size_t diff --git a/tempesta_fw/stress.h b/tempesta_fw/stress.h index 826b06e79..51dc64e5e 100644 --- a/tempesta_fw/stress.h +++ b/tempesta_fw/stress.h @@ -2,7 +2,7 @@ * Tempesta FW * * Copyright (C) 2014 NatSys Lab. (info@natsys-lab.com). - * Copyright (C) 2015 Tempesta Technologies, Inc. + * Copyright (C) 2015-2018 Tempesta Technologies, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -42,12 +42,12 @@ typedef struct { */ /* - * Accont and handle back-end server overload. + * Account and handle back-end server overload. * @return true if there is overload and false otherwise. */ bool (*account_srv)(void); /* - * Accont and handle local system overload. + * Account and handle local system overload. * @return true if there is overload and false otherwise. */ bool (*account_sys)(void); diff --git a/tempesta_fw/t/bomber.c b/tempesta_fw/t/bomber.c index b45a59f6b..17d8ccc69 100644 --- a/tempesta_fw/t/bomber.c +++ b/tempesta_fw/t/bomber.c @@ -3,7 +3,7 @@ * * Tempesta Bomber: a tool for HTTP servers stress testing. * - * Copyright (C) 2015-2017 Tempesta Technologies, Inc. + * Copyright (C) 2015-2018 Tempesta Technologies, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -53,10 +53,10 @@ MODULE_PARM_DESC(i, "Number of thread iterations"); MODULE_PARM_DESC(c, "Number of connections"); MODULE_PARM_DESC(m, "Number of messages per connection"); MODULE_PARM_DESC(v, "Verbosity level"); -MODULE_PARM_DESC(s, "Server host address and optional port nunber"); +MODULE_PARM_DESC(s, "Server host address and optional port number"); MODULE_AUTHOR("Tempesta Technologies, Inc"); -MODULE_DESCRIPTION("Tempesta Boomber"); +MODULE_DESCRIPTION("Tempesta Bomber"); MODULE_VERSION("0.2.3"); MODULE_LICENSE("GPL"); @@ -76,7 +76,7 @@ enum { struct tfw_bmb_task_t; /* - * Connection descripton. + * Connection description. */ typedef struct { SsProto proto; @@ -88,7 +88,7 @@ typedef struct { * Bomber task descriptor. * * @conn - connection descriptions - * @conn_compl - number of complate connections + * @conn_compl - number of complete connections * @conn_error - number of error connections * @conn_wq - wait queue on all connections establishing * @ctx - context for fuzzer diff --git a/tempesta_fw/t/sync_sockets/kernel/kserver.c b/tempesta_fw/t/sync_sockets/kernel/kserver.c index a9504003a..8dab1f501 100644 --- a/tempesta_fw/t/sync_sockets/kernel/kserver.c +++ b/tempesta_fw/t/sync_sockets/kernel/kserver.c @@ -4,6 +4,7 @@ * The code is mostly inspired by Oracle RDS (linux/net/rds). * * Copyright (C) 2014 NatSys Lab. (info@natsys-lab.com). + * Copyright (C) 2018 Tempesta Technologies, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -69,7 +70,7 @@ stat_update(int events) if (last_ts == jiffies / HZ) { pps_curr += events; } else { - // recahrge + // recharge if (pps_curr > pps_max) pps_max = pps_curr; pps_curr = events; diff --git a/tempesta_fw/t/sync_sockets/kernel/sync_kclient.c b/tempesta_fw/t/sync_sockets/kernel/sync_kclient.c index df000db21..fb04661a7 100644 --- a/tempesta_fw/t/sync_sockets/kernel/sync_kclient.c +++ b/tempesta_fw/t/sync_sockets/kernel/sync_kclient.c @@ -2,7 +2,7 @@ * A client for testing Synchronous Sockets connect() that does not sleep. * * Copyright (C) 2014 NatSys Lab. (info@natsys-lab.com). - * Copyright (C) 2015 Tempesta Technologies, Inc. + * Copyright (C) 2015-2018 Tempesta Technologies, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -92,7 +92,7 @@ static TfwAddr kclient_server_address; static SsHooks kclient_hooks; module_param(server, charp, 0); -MODULE_PARM_DESC(server, "Server host address and optional port nunber"); +MODULE_PARM_DESC(server, "Server host address and optional port number"); MODULE_LICENSE("GPL"); static int diff --git a/tempesta_fw/t/sync_sockets/kernel/sync_kserver.c b/tempesta_fw/t/sync_sockets/kernel/sync_kserver.c index 17cbf656d..08afc4acc 100644 --- a/tempesta_fw/t/sync_sockets/kernel/sync_kserver.c +++ b/tempesta_fw/t/sync_sockets/kernel/sync_kserver.c @@ -6,7 +6,7 @@ * kworker threads. * * Copyright (C) 2014 NatSys Lab. (info@natsys-lab.com). - * Copyright (C) 2015-2016 Tempesta Technologies, Inc. + * Copyright (C) 2015-2018 Tempesta Technologies, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -59,7 +59,7 @@ stat_update(int events) if (last_ts == jiffies / HZ) { pps_curr += events; } else { - // recahrge + // recharge if (pps_curr > pps_max) pps_max = pps_curr; pps_curr = events; diff --git a/tempesta_fw/t/sync_sockets/server.cc b/tempesta_fw/t/sync_sockets/server.cc index c36fa7c19..55971a913 100644 --- a/tempesta_fw/t/sync_sockets/server.cc +++ b/tempesta_fw/t/sync_sockets/server.cc @@ -3,6 +3,7 @@ * Synchronous Socket API. * * Copyright (C) 2014 NatSys Lab. (info@natsys-lab.com). + * Copyright (C) 2018 Tempesta Technologies, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -56,7 +57,7 @@ class RequestsStatistics { if (last_ts_ == t) { curr_ += events; } else { - // recahrge + // recharge if (curr_ > max_) max_ = curr_; curr_ = events; @@ -241,7 +242,7 @@ main(int argc, char *argv[]) if (setsockopt(listen_sd, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on)) < 0) { - std::cerr << "can't set reuseaddr for listenong socket" + std::cerr << "can't set reuseaddr for listening socket" << std::endl; exit(1); } diff --git a/tempesta_fw/t/unit/helpers.c b/tempesta_fw/t/unit/helpers.c index 6c552a877..2bfde198e 100644 --- a/tempesta_fw/t/unit/helpers.c +++ b/tempesta_fw/t/unit/helpers.c @@ -15,7 +15,7 @@ * and generic testing functions/macros are located in test.c/test.h * * Copyright (C) 2014 NatSys Lab. (info@natsys-lab.com). - * Copyright (C) 2015-2017 Tempesta Technologies, Inc. + * Copyright (C) 2015-2018 Tempesta Technologies, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -64,7 +64,7 @@ void test_req_free(TfwHttpReq *req) { /* In tests we are stricter: we don't allow to free a NULL pointer - * to be sure exactly what we are free'ing and to catch bugs early. */ + * to be sure exactly what we are freeing and to catch bugs early. */ BUG_ON(!req); tfw_http_msg_free((TfwHttpMsg *)req); diff --git a/tempesta_fw/t/unit/sched_helper.c b/tempesta_fw/t/unit/sched_helper.c index f551a800b..6042394c9 100644 --- a/tempesta_fw/t/unit/sched_helper.c +++ b/tempesta_fw/t/unit/sched_helper.c @@ -114,7 +114,7 @@ test_sg_release_all_reconfig(void) down_write(sg_sem); - /* Copy of hash_for_each_safe() which needs localy defined hash. */ + /* Copy of hash_for_each_safe() which needs locally defined hash. */ for ( ; !sg && i < (1 << TFW_SG_HBITS); i++) { hlist_for_each_entry_safe(sg, tmp, &sg_hash_reconfig[i], list_reconfig) diff --git a/tempesta_fw/t/unit/test.c b/tempesta_fw/t/unit/test.c index 52c716088..cbac58d09 100644 --- a/tempesta_fw/t/unit/test.c +++ b/tempesta_fw/t/unit/test.c @@ -36,7 +36,7 @@ test_fixture_fn_t test_teardown_fn; * * The problem with logging is that it is hard to find a real error * message among all logs generated during a test run. - * That happpens because: + * That happens because: * - Some tests intentionally make calls with invalid input data. * The code generates TFW_ERR() messages indistinguishable from * real errors. @@ -118,7 +118,7 @@ test_run_all(void) tfw_str_init_const(); /* - * Preemption is diabled by kernel_fpu_begin(), so + * Preemption is disabled by kernel_fpu_begin(), so * the tests can not sleep. */ TEST_SUITE_RUN(tfw_str); diff --git a/tempesta_fw/t/unit/test_cfg.c b/tempesta_fw/t/unit/test_cfg.c index 18c0ca167..c7081573b 100644 --- a/tempesta_fw/t/unit/test_cfg.c +++ b/tempesta_fw/t/unit/test_cfg.c @@ -393,7 +393,7 @@ TEST(cfg_parser, handles_escaped_special_characters) { 0 } }; - /* The leaning toothpick syndrome here: have to escape backslahes and + /* The leaning toothpick syndrome here: have to escape backslashes and * quotes both in C and the configuration language. */ int r = parse_cfg("escaped \\ \\\r\\\n\\#\\\"\\;\\\\;", specs); EXPECT_OK(r); diff --git a/tempesta_fw/t/unit/test_hash.c b/tempesta_fw/t/unit/test_hash.c index a9f2126a8..cc6963b24 100644 --- a/tempesta_fw/t/unit/test_hash.c +++ b/tempesta_fw/t/unit/test_hash.c @@ -2,7 +2,7 @@ * Tempesta FW * * Copyright (C) 2014 NatSys Lab. (info@natsys-lab.com). - * Copyright (C) 2015 Tempesta Technologies, Inc. + * Copyright (C) 2015-2018 Tempesta Technologies, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -110,7 +110,7 @@ TEST(tfw_hash_str, hashes_all_chars) TfwStr s1 = { .len = 0, .ptr = buf1 }; TfwStr s2 = { .len = 0, .ptr = buf2 }; - /* Change of each individial byte in the string should change + /* Change of each individual byte in the string should change * the hash value. */ for (i = 0; i < 255; ++i) { s1.len = s2.len = (i + 1); @@ -180,7 +180,7 @@ TEST(tfw_hash_str, distributes_all_input_across_hash_bits) * For a good hash function, a change of a single bit in the input will * cause changing many bits in the output (with high probability). * Our hash function calculates high and low halves of 64-bit output - * key, so we chage two bits simultaneously in the test. + * key, so we change two bits simultaneously in the test. * Probably, this is good to fix. */ for (i = 0; i < sizeof(buf) / 2; ++i) { diff --git a/tempesta_fw/t/unit/test_http_parser.c b/tempesta_fw/t/unit/test_http_parser.c index 3672b803d..b6e5519a9 100644 --- a/tempesta_fw/t/unit/test_http_parser.c +++ b/tempesta_fw/t/unit/test_http_parser.c @@ -2,7 +2,7 @@ * Tempesta FW * * Copyright (C) 2014 NatSys Lab. (info@natsys-lab.com). - * Copyright (C) 2015-2016 Tempesta Technologies, Inc. + * Copyright (C) 2015-2018 Tempesta Technologies, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -637,7 +637,7 @@ TEST(http_parser, mangled_messages) "4\r\n" "12345\r\n"); - /* "chunked" conding must be the last coding. */ + /* "chunked" coding must be the last coding. */ EXPECT_BLOCK_REQ("GET / HTTP/1.1\r\n" "Transfer-Encoding: chunked, gzip\r\n" "\r\n" @@ -1820,12 +1820,12 @@ TEST(http_parser, if_none_match) EXPECT_BLOCK_REQ("GET / HTTP/1.1\r\n" "If-None-Match: " ETAG_1 "\"\r\n" "\r\n"); - /* Dublicated header. */ + /* Duplicated header. */ EXPECT_BLOCK_REQ("GET / HTTP/1.1\r\n" "If-None-Match: \"" ETAG_1 "\"\r\n" "If-None-Match: \"" ETAG_1 "\"\r\n" "\r\n"); - /* Incomplite header. */ + /* Incomplete header. */ EXPECT_BLOCK_REQ("GET / HTTP/1.1\r\n" "If-None-Match: \"" ETAG_1 "\", \r\n" "\r\n"); diff --git a/tempesta_fw/t/unit/test_http_sticky.c b/tempesta_fw/t/unit/test_http_sticky.c index 2e930abe5..7fdd0125c 100644 --- a/tempesta_fw/t/unit/test_http_sticky.c +++ b/tempesta_fw/t/unit/test_http_sticky.c @@ -501,7 +501,7 @@ http_parse_helper(TfwHttpMsg *hm, ss_skb_actor_t actor) continue; case TFW_PASS: - /* sucessfully parsed */ + /* successfully parsed */ return 0; default: diff --git a/tempesta_fw/t/unit/user_space/alb.c b/tempesta_fw/t/unit/user_space/alb.c index fd7c725ec..bb9aac9a1 100644 --- a/tempesta_fw/t/unit/user_space/alb.c +++ b/tempesta_fw/t/unit/user_space/alb.c @@ -4,7 +4,7 @@ * Algorithm for ratio scheduler with as uniform as possible requests * distribution. * - * Copyright (C) 2017 Tempesta Technologies, Inc. + * Copyright (C) 2017-2018 Tempesta Technologies, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -47,7 +47,7 @@ typedef struct { * @srv_n - number of available servers. * @curr - pointer to current server. * @ri - ratio iteration, determines how many times we have to choose - * all servers before current utill we can choose current server. + * all servers before current until we can choose current server. * @rsum - sum of all ratios, used to avoid scanning fully zeroed array * of servers. * @rsum_orig - original value of @rsum. @@ -130,7 +130,7 @@ init_sched(const unsigned int *ratios, unsigned int n) * and of the right series are proportional to current iteration. * As the scheduler algorithm moves forward sum of the left series decreases. * Since each server selection just decrements current server ration, the - * sum of the series containg the server also decrements, i.e. decreases for + * sum of the series contains the server also decrements, i.e. decreases for * 1. * * Thus, a user must not specify weights like {1000, 100} since decrement @@ -139,7 +139,7 @@ init_sched(const unsigned int *ratios, unsigned int n) * specified wights on large numbers, but significant bursts are possible in * the first case. * - * Dynamic weights must be adjusted by devision for minimal weight. The same + * Dynamic weights must be adjusted by division for minimal weight. The same * can be done for static weights. Or at least document the algorithm * peculiarity for a user. * @@ -150,7 +150,7 @@ is_srv_turn(unsigned int i) { unsigned int head_sum2, tail_sum2; - /* The server w/ the largest ratio is always choosen. */ + /* The server w/ the largest ratio is always chosen. */ if (!i) return true; @@ -185,7 +185,7 @@ sched(void) if (rs.rearm != s) { /* * Do not choose the server if we fully exhausted its - * caunter. Likely branch for ratios { N, 1, 1, ... }, + * counter. Likely branch for ratios { N, 1, 1, ... }, * where N > 1, at some point. This is not the case if * all server weights were specified as 1: in this case * we're fall to plain round-robin. @@ -228,7 +228,7 @@ sched(void) return s; } /* - * It isn't trun of the current server. + * It isn't turn of the current server. * Start a new iteration from the server with the largest ratio. */ rs.curr = 0; diff --git a/tempesta_fw/t/unit/user_space/percentiles.c b/tempesta_fw/t/unit/user_space/percentiles.c index 49c8eb90a..17e4679d8 100644 --- a/tempesta_fw/t/unit/user_space/percentiles.c +++ b/tempesta_fw/t/unit/user_space/percentiles.c @@ -1,30 +1,30 @@ /** * Tempesta FW * - * Prototype for fast precentilies calculation. + * Prototype for fast percentiles calculation. * * The algorithm is constructed to be as efficient as possible sacrificing - * accuracy and answering questions different from originaly asked by user. + * accuracy and answering questions different from originally asked by user. * The main concepts and requirements are: * * 1. Small O(1) update time with only few conditions and cache line accesses; * - * 2. Very fast O(1) calculation of several percentilies in parallel; + * 2. Very fast O(1) calculation of several percentiles in parallel; * * 3. Very small overall memory footprint for inexpensive handling of * performance trends of many servers; * - * 4. Buckets must dynamicaly rearrange since we don't know server response - * times a-priori; + * 4. Buckets must dynamically rearrange since we don't know server response + * times a priori; * * 5. The buckets adjustments must be done in lock-less fashion on multi-core * environment; * * 6. If user ask for Nth percentile, e.g. 75th, we can return inaccurate - * value for different percentilie, e.g. 81st. This is very possibe if we - * don't have enough data for accurate percentilies calculation. + * value for different percentile, e.g. 81st. This is very possible if we + * don't have enough data for accurate percentiles calculation. * - * Copyright (C) 2016-2017 Tempesta Technologies, Inc. + * Copyright (C) 2016-2018 Tempesta Technologies, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -51,21 +51,21 @@ #define SET(s) {ARRAY_SIZE(s), s} /* - * Keep arrays sorted to make our simple basic algorithm for percentlies + * Keep arrays sorted to make our simple basic algorithm for percentiles * calculation work. */ static const struct { size_t len; unsigned int *set; } sets[] = { - /* Not enough data for 1-percentilie, so show 0 for 1-percentilie. */ + /* Not enough data for 1-percentile, so show 0 for 1-percentile. */ SET(((unsigned int[]){1, 2, 3, 4, 5, 6, 7, 8, 9, 10})), /* * `3` is outlier in first range (count=4, bucket=2). - * Right bound of last range is extened to 1069. + * Right bound of last range is extended to 1069. */ SET(((unsigned int[]){1, 2, 3, 3, 3, 3, 4, 4, 5, 1001, 1002, 1010})), - /* All percentilies should be calculated accurately. */ + /* All percentiles should be calculated accurately. */ SET(((unsigned int[]){1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, @@ -78,25 +78,25 @@ static const struct { }; /* - * @ith - percentilie number; - * @val - percentilie value; + * @ith - percentile number; + * @val - percentile value; */ typedef struct { int ith; int val; -} Percentilie; +} Percentile; /** - * Calculate @np percentilies from @pcnts over @set of size @len. + * Calculate @np percentiles from @pcnts over @set of size @len. */ static void -basic_percentilie(const unsigned int *set, size_t len, Percentilie *pcnts, +basic_percentile(const unsigned int *set, size_t len, Percentile *pcnts, size_t np) { int i; for (i = 0; i < np; ++i) { - /* How many items we need to collect for each percentilie. */ + /* How many items we need to collect for each percentile. */ int n = len * pcnts[i].ith / 100; pcnts[i].val = n ? set[n - 1] : 0; } @@ -363,11 +363,11 @@ tfw_stats_upd(TfwPcntRanges *rng, unsigned int r_time) } /** - * Retrieve nearest to @pcnts->ith percentilies. + * Retrieve nearest to @pcnts->ith percentiles. * @pcnts must be sorted. */ static void -tfw_stats_calc(TfwPcntRanges *rng, Percentilie *pcnts, size_t np, bool clear) +tfw_stats_calc(TfwPcntRanges *rng, Percentile *pcnts, size_t np, bool clear) { int i, r, b, p = 0; unsigned long cnt, tot_cnt = rng->tot_cnt; @@ -376,7 +376,7 @@ tfw_stats_calc(TfwPcntRanges *rng, Percentilie *pcnts, size_t np, bool clear) if (unlikely(!tot_cnt)) return; - /* How many items we need to collect for each percentilie. */ + /* How many items we need to collect for each percentile. */ for (i = 0; i < np; ++i) { pval[i] = tot_cnt * pcnts[i].ith / 100; if (!pval[i]) @@ -413,7 +413,7 @@ static TfwPcntRanges rng = { }; static void -tfw_percentilie(const unsigned int *set, size_t len, Percentilie *pcnts, +tfw_percentile(const unsigned int *set, size_t len, Percentile *pcnts, size_t np) { int i; @@ -423,7 +423,7 @@ tfw_percentilie(const unsigned int *set, size_t len, Percentilie *pcnts, tfw_stats_upd(&rng, set[i]); /* - * 2. Perform percentilies calculation. + * 2. Perform percentiles calculation. * Zero the statistic on each call. In real life this should be done * once per T, configurable time. */ @@ -435,12 +435,12 @@ main(int argc, char *argv[]) { int i, j; - printf("Format: -> \n\n"); + printf("Format: -> \n\n"); for (i = 0; i < ARRAY_SIZE(sets); ++i) { - Percentilie pprev[6], pnext[6]; - Percentilie p0[6] = { {1}, {50}, {75}, {90}, {95}, {99} }; - Percentilie p1[6] = { {1}, {50}, {75}, {90}, {95}, {99} }; + Percentile pprev[6], pnext[6]; + Percentile p0[6] = { {1}, {50}, {75}, {90}, {95}, {99} }; + Percentile p1[6] = { {1}, {50}, {75}, {90}, {95}, {99} }; /* Store previous statistic for Tempesta trends. * This should be used for /proc/tempesta/perfstat since @@ -451,14 +451,14 @@ main(int argc, char *argv[]) */ memcpy(pprev, p1, sizeof(p1)); - /* Usual percentilies calculation, use it as refference. */ - basic_percentilie(sets[i].set, sets[i].len, p0, ARRAY_SIZE(p0)); + /* Usual percentiles calculation, use it as reference. */ + basic_percentile(sets[i].set, sets[i].len, p0, ARRAY_SIZE(p0)); printf("base:\t1->%u\t50->%u\t75->%u\t90->%u\t95->%u\t99->%u\n", p0[0].val, p0[1].val, p0[2].val, p0[3].val, p0[4].val, p0[5].val); - /* Tempesta percentilies. */ - tfw_percentilie(sets[i].set, sets[i].len, p1, ARRAY_SIZE(p1)); + /* Tempesta percentiles. */ + tfw_percentile(sets[i].set, sets[i].len, p1, ARRAY_SIZE(p1)); printf("tfw:\t%d->%u\t%d->%u\t%d->%u\t%d->%u\t%d->%u\t%d->%u\n", p1[0].ith, p1[0].val, p1[1].ith, p1[1].val, p1[2].ith, p1[2].val, p1[3].ith, p1[3].val, diff --git a/tempesta_fw/t/unit/user_space/slr.cc b/tempesta_fw/t/unit/user_space/slr.cc index 7974e5acc..d8e5929a8 100644 --- a/tempesta_fw/t/unit/user_space/slr.cc +++ b/tempesta_fw/t/unit/user_space/slr.cc @@ -4,7 +4,7 @@ * Simple linear regression calculation on sliding data window. * This model assumes time as explanatory variable @x. * - * Copyright (C) 2017 Tempesta Technologies, Inc. + * Copyright (C) 2017-2018 Tempesta Technologies, Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by @@ -27,7 +27,7 @@ template class SLR { // Use the multiplier to calculate @y with 1/MUL - // precission on integer arithmetic. */ + // precision on integer arithmetic. */ static const long MUL = 1000; long n; /* observation number */ @@ -36,7 +36,7 @@ class SLR { T x_avg_y_avg; /* avg(x) * avg(y) */ T x_sq_avg; /* avg(x * x) */ T x_avg_sq; /* avg(x) * avg(x) */ - T a, b; /* coeficients for y = a + b*x + eps */ + T a, b; /* coefficients for y = a + b*x + eps */ struct { T x; T y; diff --git a/tempesta_fw/tempesta_fw.h b/tempesta_fw/tempesta_fw.h index 0ee485dfa..07c4d97d9 100644 --- a/tempesta_fw/tempesta_fw.h +++ b/tempesta_fw/tempesta_fw.h @@ -53,7 +53,7 @@ * @specs is the specification for the configuration parser. It lists * all possible configuration sections and directives for the module and * describes how to handle them. @specs must be an array of TfwCfgSpec{} - * structures which is terminated by a null (zero'ed) element. + * structures which is terminated by a null (zeroed) element. * * @start and @stop callbacks are invoked when corresponding events are * received via sysctl. The @start is called after the configuration is diff --git a/tempesta_fw/vhost.c b/tempesta_fw/vhost.c index 55e89749c..88c846cf7 100644 --- a/tempesta_fw/vhost.c +++ b/tempesta_fw/vhost.c @@ -358,7 +358,7 @@ static TfwGlobal tfw_global = { /* * Get vhost matching the specified name. Vhost's reference counter - * is incremented in case of successfull search. + * is incremented in case of successful search. */ TfwVhost * tfw_vhost_lookup(const char *name) diff --git a/tempesta_fw/vhost.h b/tempesta_fw/vhost.h index bf244ce5c..e633bb850 100644 --- a/tempesta_fw/vhost.h +++ b/tempesta_fw/vhost.h @@ -102,7 +102,7 @@ enum { * @capo - Array of pointers to Cache Policy definitions. * @nipdef - Array of pointers to Non-Idempotent Request definitions. * @frang_cfg - Pointer to location-specific Frang settings structure. - * @main_sg - Main server group to which requsts must be proxied. + * @main_sg - Main server group to which requests must be proxied. * @backup_sg - Backup server group. * @hdrs_pool - Pointer to parent vhost's pool (for mod. headers allocation). * @mod_hdrs - Modification of request/response headers before forwarding. diff --git a/tempesta_fw/work_queue.c b/tempesta_fw/work_queue.c index 67b5752f7..264cb52de 100644 --- a/tempesta_fw/work_queue.c +++ b/tempesta_fw/work_queue.c @@ -63,7 +63,7 @@ tfw_wq_init(TfwRBQueue *q, int node) void tfw_wq_destroy(TfwRBQueue *q) { - /* Ensure that there is no peding work. */ + /* Ensure that there is no pending work. */ WARN_ON_ONCE(tfw_wq_size(q)); kfree(q->array); @@ -108,7 +108,7 @@ __tfw_wq_push(TfwRBQueue *q, void *ptr) * There is an empty slot to push a new item. * Acquire the current head position and move the global head. * If current head position is acquired by a competing - * poroducer, then read the current head and try again. + * producer, then read the current head and try again. */ if (atomic64_cmpxchg(&q->head, head, head + 1) == head) break; @@ -128,7 +128,7 @@ __tfw_wq_push(TfwRBQueue *q, void *ptr) /** * Sets tail value to be compared with current turnstile ticket, so - * @ticket is the identifier of currently successully pop()'ed item or an item + * @ticket is the identifier of currently successfully pop()'ed item or an item * to be pop()'ed next time. */ int