From: Ilya Shipitsin Date: Tue, 5 May 2020 19:53:22 +0000 (+0500) Subject: CLEANUP: assorted typo fixes in the code and comments X-Git-Tag: v2.2-dev8~92 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c02a23f981f3c6d9189dcc55bbfbd7df946ce9d6;p=thirdparty%2Fhaproxy.git CLEANUP: assorted typo fixes in the code and comments This is 9th iteration of typo fixes --- diff --git a/src/checks.c b/src/checks.c index bb78cc845f..0fefdc5316 100644 --- a/src/checks.c +++ b/src/checks.c @@ -1061,7 +1061,7 @@ static void tcpcheck_expect_onerror_message(struct buffer *msg, struct check *ch * 1. if info field is already provided, copy it * 2. if the expect rule provides an onerror log-format string, * use it to produce the message - * 3. the expect rule is part of a protcol check (http, redis, mysql...), do nothing + * 3. the expect rule is part of a protocol check (http, redis, mysql...), do nothing * 4. Otherwise produce the generic tcp-check info message */ if (istlen(info)) { @@ -1149,7 +1149,7 @@ static void tcpcheck_expect_onsuccess_message(struct buffer *msg, struct check * * 1. if info field is already provided, copy it * 2. if the expect rule provides an onsucces log-format string, * use it to produce the message - * 3. the expect rule is part of a protcol check (http, redis, mysql...), do nothing + * 3. the expect rule is part of a protocol check (http, redis, mysql...), do nothing * 4. Otherwise produce the generic tcp-check info message */ if (istlen(info)) @@ -2080,8 +2080,8 @@ static enum tcpcheck_eval_ret tcpcheck_eval_send(struct check *check, struct tcp } -/* Try to reveice data before evaluting a tcp-check expect rule. Returns - * TCPCHK_EVAL_WAIT if it is already subcribed on receive events or if nothing +/* Try to receive data before evaluating a tcp-check expect rule. Returns + * TCPCHK_EVAL_WAIT if it is already subscribed on receive events or if nothing * was received, TCPCHK_EVAL_CONTINUE to evaluate the expect rule or * TCPCHK_EVAL_STOP if an error occurred. */ @@ -2582,7 +2582,7 @@ static enum tcpcheck_eval_ret tcpcheck_eval_expect(struct check *check, struct t } /* Evaluates a TCPCHK_ACT_ACTION_KW rule. Returns TCPCHK_EVAL_CONTINUE to - * evaluate the next rule or TCPCHK_EVAL_STOP if an error occurred. It nevers + * evaluate the next rule or TCPCHK_EVAL_STOP if an error occurred. It never * waits. */ static enum tcpcheck_eval_ret tcpcheck_eval_action_kw(struct check *check, struct tcpcheck_rule *rule) @@ -3728,7 +3728,7 @@ static struct tcpcheck_rule *parse_tcpcheck_connect(char **args, int cur_arg, st continue; memprintf(errmsg, "first step MUST also be a 'connect', " - "optionnaly preceded by a 'set-var', an 'unset-var' or a 'comment', " + "optionally preceded by a 'set-var', an 'unset-var' or a 'comment', " "when there is a 'connect' step in the tcp-check ruleset"); goto error; } @@ -4431,7 +4431,7 @@ static struct tcpcheck_rule *parse_tcpcheck_expect(char **args, int cur_arg, str if (strcmp(args[cur_arg+1], "value-lf") == 0) flags |= TCPCHK_EXPT_FL_HTTP_HVAL_FMT; - /* Parse the value pattern, optionnal */ + /* Parse the value pattern, optional */ if (strcmp(args[cur_arg+2], "-m") == 0) { cur_arg += 2; if (!*(args[cur_arg+1])) { @@ -4919,7 +4919,7 @@ static int tcpcheck_add_http_rule(struct tcpcheck_rule *chk, struct tcpcheck_rul */ if (chk->action == TCPCHK_ACT_SEND && (chk->send.http.flags & TCPCHK_SND_HTTP_FROM_OPT)) { - /* Tries to add an implcit http-check send rule from an "option httpchk" line. + /* Tries to add an implicit http-check send rule from an "option httpchk" line. * First, the first rule is retrieved, skipping the first CONNECT, if any, and * following tests are performed : * @@ -4929,7 +4929,7 @@ static int tcpcheck_add_http_rule(struct tcpcheck_rule *chk, struct tcpcheck_rul * 2- If it is another implicit send rule, it is replaced with the new one. * * 3- Otherwise, it means it is an explicit send rule. In this case we merge - * both, overwritting the old send rule (the explicit one) with info of the + * both, overwriting the old send rule (the explicit one) with info of the * new send rule (the implicit one). */ r = get_first_tcpcheck_rule(rules); @@ -5372,7 +5372,7 @@ static int init_srv_agent_check(struct server *srv) if (!srv->do_agent) goto out; - /* If there is no connect rule preceeding all send / expect rules, an + /* If there is no connect rule preceding all send / expect rules, an * implicit one is inserted before all others. */ chk = get_first_tcpcheck_rule(srv->agent.tcpcheck_rules); @@ -5473,7 +5473,7 @@ static int check_proxy_tcpcheck(struct proxy *px) /* For all ruleset: */ - /* If there is no connect rule preceeding all send / expect rules, an + /* If there is no connect rule preceding all send / expect rules, an * implicit one is inserted before all others. */ chk = get_first_tcpcheck_rule(&px->tcpcheck_rules); @@ -6351,7 +6351,7 @@ int proxy_parse_ssl_hello_chk_opt(char **args, int cur_arg, struct proxy *curpx, * Check RFC 2246 (TLSv1.0) sections A.3 and A.4 for details. */ static char sslv3_client_hello[] = { - "16" /* ContentType : 0x16 = Hanshake */ + "16" /* ContentType : 0x16 = Handshake */ "0300" /* ProtocolVersion : 0x0300 = SSLv3 */ "0079" /* ContentLength : 0x79 bytes after this one */ "01" /* HanshakeType : 0x01 = CLIENT HELLO */ diff --git a/src/chunk.c b/src/chunk.c index 100783e238..f2abcba4e6 100644 --- a/src/chunk.c +++ b/src/chunk.c @@ -172,7 +172,7 @@ int chunk_appendf(struct buffer *chk, const char *fmt, ...) /* * Encode chunk into chunk , respecting the limit of at most - * chk->size chars. Replace non-printable or special chracters with "&#%d;". + * chk->size chars. Replace non-printable or special characters with "&#%d;". * If the chk->len is over, nothing is added. Returns the new chunk size. */ int chunk_htmlencode(struct buffer *dst, struct buffer *src) diff --git a/src/hlua.c b/src/hlua.c index 67aa2c696d..ed987d50b0 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -343,7 +343,7 @@ __LJMP static const char *hlua_traceback(lua_State *L) /* This function check the number of arguments available in the * stack. If the number of arguments available is not the same - * then an error is throwed. + * then an error is thrown. */ __LJMP static inline void check_args(lua_State *L, int nb, char *fcn) { @@ -403,7 +403,7 @@ static int hlua_arg2lua(lua_State *L, const struct arg *arg) return 1; } -/* This function take one entrie in an LUA stack at the index "ud", +/* This function take one entry in an LUA stack at the index "ud", * and try to convert it in an HAProxy argument entry. This is useful * with sample fetch wrappers. The input arguments are given to the * lua wrapper and converted as arg list by the function. @@ -588,7 +588,7 @@ static int hlua_lua2smp(lua_State *L, int ud, struct sample *smp) * is in accord with the expected argp defined by the "mask". The function * returns true or false. It can be adjust the types if there compatibles. * - * This function assumes thant the argp argument contains ARGM_NBARGS + 1 + * This function assumes that the argp argument contains ARGM_NBARGS + 1 * entries. */ __LJMP int hlua_lua2arg_check(lua_State *L, int first, struct arg *argp, @@ -802,7 +802,7 @@ __LJMP int hlua_lua2arg_check(lua_State *L, int first, struct arg *argp, } /* - * The following functions are used to make correspondance between the the + * The following functions are used to make correspondence between the the * executed lua pointer and the "struct hlua *" that contain the context. * * - hlua_gethlua : return the hlua context associated with an lua_State. @@ -1337,7 +1337,7 @@ static int hlua_set_map(lua_State *L) /* A class is a lot of memory that contain data. This data can be a table, * an integer or user data. This data is associated with a metatable. This - * metatable have an original version registred in the global context with + * metatable have an original version registered in the global context with * the name of the object (_G[] = ). * * A metable is a table that modify the standard behavior of a standard diff --git a/src/http_act.c b/src/http_act.c index e9f58002ae..e6e3df4f81 100644 --- a/src/http_act.c +++ b/src/http_act.c @@ -71,7 +71,7 @@ static void release_http_action(struct act_rule *rule) /* This function executes one of the set-{method,path,query,uri} actions. It * builds a string in the trash from the specified format string. It finds * the action to be performed in <.action>, previously filled by function - * parse_set_req_line(). The replacement action is excuted by the function + * parse_set_req_line(). The replacement action is executed by the function * http_action_set_req_line(). On success, it returns ACT_RET_CONT. If an error * occurs while soft rewrites are enabled, the action is canceled, but the rule * processing continue. Otherwsize ACT_RET_ERR is returned. @@ -1071,7 +1071,7 @@ static enum act_parse_ret parse_http_set_log_level(const char **args, int *orig_ /* This function executes a early-hint action. It adds an HTTP Early Hint HTTP * 103 response header with <.arg.http.str> name and with a value built * according to <.arg.http.fmt> log line format. If it is the first early-hint - * rule of a serie, the 103 response start-line is added first. At the end, if + * rule of series, the 103 response start-line is added first. At the end, if * the next rule is not an early-hint rule or if it is the last rule, the EOH * block is added to terminate the response. On success, it returns * ACT_RET_CONT. If an error occurs while soft rewrites are enabled, the action @@ -1148,7 +1148,7 @@ static enum act_return http_action_early_hint(struct act_rule *rule, struct prox /* This function executes a set-header or add-header actions. It builds a string * in the trash from the specified format string. It finds the action to be * performed in <.action>, previously filled by function parse_set_header(). The - * replacement action is excuted by the function http_action_set_header(). On + * replacement action is executed by the function http_action_set_header(). On * success, it returns ACT_RET_CONT. If an error occurs while soft rewrites are * enabled, the action is canceled, but the rule processing continue. Otherwsize * ACT_RET_ERR is returned. @@ -1271,7 +1271,7 @@ static enum act_parse_ret parse_http_set_header(const char **args, int *orig_arg /* This function executes a replace-header or replace-value actions. It * builds a string in the trash from the specified format string. It finds * the action to be performed in <.action>, previously filled by function - * parse_replace_header(). The replacement action is excuted by the function + * parse_replace_header(). The replacement action is executed by the function * http_action_replace_header(). On success, it returns ACT_RET_CONT. If an error * occurs while soft rewrites are enabled, the action is canceled, but the rule * processing continue. Otherwsize ACT_RET_ERR is returned. @@ -2019,7 +2019,7 @@ static int check_http_return_action(struct act_rule *rule, struct proxy *px, cha * * - action 0 : dummy response, no payload * - action 1 : implicit error message depending on the status code or explicit one - * - action 2 : explicit file oject ('file' argument) + * - action 2 : explicit file object ('file' argument) * - action 3 : explicit log-format string ('content' argument) * * The content-type must be defined for non-empty payload. It is ignored for diff --git a/src/mux_h1.c b/src/mux_h1.c index 0421bbad54..f9048b15ed 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -356,7 +356,7 @@ static void h1_trace(enum trace_level level, uint64_t mask, const struct trace_s * - if the input buffer failed to be allocated or is full , we must not try * to receive * - if he input processing is busy waiting for the output side, we may - * attemp to receive + * attempt to receive * - otherwise must may not attempt to receive */ static inline int h1_recv_allowed(const struct h1c *h1c) @@ -845,7 +845,7 @@ static void h1_set_cli_conn_mode(struct h1s *h1s, struct h1m *h1m) } else if (!(h1m->flags & H1_MF_CONN_KAL) && (fe->options & PR_O_HTTP_MODE) == PR_O_HTTP_CLO) { - /* no explict keep-alive and option httpclose => close */ + /* no explicit keep-alive and option httpclose => close */ h1s->flags = (h1s->flags & ~H1S_F_WANT_MSK) | H1S_F_WANT_CLO; TRACE_STATE("force close mode (resp)", H1_EV_TX_DATA|H1_EV_TX_HDRS, h1s->h1c->conn, h1s); } @@ -1136,7 +1136,7 @@ static void h1_set_req_tunnel_mode(struct h1s *h1s) /* * Switch the response to tunnel mode. This function must only be called on - * successfull replies to CONNECT requests or on protocol switching. In this + * successful replies to CONNECT requests or on protocol switching. In this * last case, this function takes care to switch the request to tunnel mode if * possible. On the server side, if the request is not finished, the mux is mark * as busy on input. @@ -1779,7 +1779,7 @@ static size_t h1_process_output(struct h1c *h1c, struct buffer *buf, size_t coun } else if ((h1m->flags & H1_MF_RESP) && ((h1s->meth == HTTP_METH_CONNECT && h1s->status == 200) || h1s->status == 101)) { - /* a successfull reply to a CONNECT or a protocol switching is sent + /* a successful reply to a CONNECT or a protocol switching is sent * to the client. Switch the response to tunnel mode. */ h1_set_res_tunnel_mode(h1s); @@ -3104,7 +3104,7 @@ REGISTER_CONFIG_POSTPARSER("h1-headers-map", cfg_h1_headers_case_adjust_postpars /****************************************/ -/* MUX initialization and instanciation */ +/* MUX initialization and instantiation */ /****************************************/ /* The mux operations */ diff --git a/src/peers.c b/src/peers.c index 3bed8a6221..2e54ab94d5 100644 --- a/src/peers.c +++ b/src/peers.c @@ -159,7 +159,7 @@ struct peer_prep_params { /*******************************/ /* stick table sync mesg types */ /* Note: ids >= 128 contains */ -/* id message cotains data */ +/* id message contains data */ /*******************************/ #define PEER_MSG_STKT_UPDATE 0x80 #define PEER_MSG_STKT_INCUPDATE 0x81 @@ -280,7 +280,7 @@ static const char *statuscode_str(int statuscode) /* This function encode an uint64 to 'dynamic' length format. The encoded value is written at address *str, and the - caller must assure that size after *str is large enought. + caller must assure that size after *str is large enough. At return, the *str is set at the next Byte after then encoded integer. The function returns then length of the encoded integer in Bytes */ @@ -449,7 +449,7 @@ static int peer_prepare_updatemsg(char *msg, size_t size, struct peer_prep_param /* construct message */ - /* check if we need to send the update identifer */ + /* check if we need to send the update identifier */ if (!st->last_pushed || updateid < st->last_pushed || ((updateid - st->last_pushed) != 1)) { use_identifier = 1; } @@ -1302,7 +1302,7 @@ static inline int peer_send_teach_stage2_msgs(struct appctx *appctx, struct peer * was encountered. * must be set if the stick-table entry expires. * must be set for PEER_MSG_STKT_UPDATE or PEER_MSG_STKT_UPDATE_TIMED stick-table - * messages, in this case the stick-table udpate message is received with a stick-table + * messages, in this case the stick-table update message is received with a stick-table * update ID. * is the length of the stick-table update message computed upon receipt. */ @@ -1778,7 +1778,7 @@ static inline int peer_treat_awaited_msg(struct appctx *appctx, struct peer *pee struct shared_table *st; /* Reset message: remote need resync */ - /* prepare tables fot a global push */ + /* prepare tables for a global push */ for (st = peer->tables; st; st = st->next) { st->teaching_origin = st->last_pushed = st->table->update; st->flags = 0; @@ -1871,7 +1871,7 @@ static inline int peer_treat_awaited_msg(struct appctx *appctx, struct peer *pee /* * Send any message to peer. * Returns 1 if succeeded, or -1 or 0 if failed. - * -1 means an internal error occured, 0 is for a peer protocol error leading + * -1 means an internal error occurred, 0 is for a peer protocol error leading * to a peer state change (from the peer I/O handler point of view). */ static inline int peer_send_msgs(struct appctx *appctx, struct peer *peer) @@ -2855,7 +2855,7 @@ static struct dcache_tx *new_dcache_tx(size_t max_entries) /* * Allocate a cache of dictionary entries with as name and * as maximum of entries. - * Return the dictionay cache if succeeded, NULL if not. + * Return the dictionary cache if succeeded, NULL if not. * Must be deallocated calling free_dcache(). */ static struct dcache *new_dcache(size_t max_entries) diff --git a/src/server.c b/src/server.c index 9e74fa4852..265106eb87 100644 --- a/src/server.c +++ b/src/server.c @@ -1277,7 +1277,7 @@ static struct srv_kw_list srv_kws = { "ALL", { }, { INITCALL1(STG_REGISTER, srv_register_keywords, &srv_kws); /* Recomputes the server's eweight based on its state, uweight, the current time, - * and the proxy's algorihtm. To be used after updating sv->uweight. The warmup + * and the proxy's algorithm. To be used after updating sv->uweight. The warmup * state is automatically disabled if the time is elapsed. If is * not zero, the update will be propagated immediately. * @@ -2248,7 +2248,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr len2mask6(mask, &opt->pref_net[opt->pref_net_nb].mask.in6); opt->pref_net[opt->pref_net_nb].family = AF_INET6; } else { - /* All network conversions fail, retrun error. */ + /* All network conversions fail, return error. */ ha_alert("parsing [%s:%d]: '%s': invalid network '%s'.\n", file, linenum, args[cur_arg], p); err_code |= ERR_ALERT | ERR_FATAL; diff --git a/src/standard.c b/src/standard.c index 1bca31816a..701bcc2513 100644 --- a/src/standard.c +++ b/src/standard.c @@ -2292,7 +2292,7 @@ const void *my_memmem(const void *haystack, size_t haystacklen, const void *need return NULL; } -/* get length of the initial segment consiting entirely of bytes in */ +/* get length of the initial segment consisting entirely of bytes in */ size_t my_memspn(const void *str, size_t len, const void *accept, size_t acceptlen) { size_t ret = 0; @@ -2304,7 +2304,7 @@ size_t my_memspn(const void *str, size_t len, const void *accept, size_t acceptl return ret; } -/* get length of the initial segment consiting entirely of bytes not in */ +/* get length of the initial segment consisting entirely of bytes not in */ size_t my_memcspn(const void *str, size_t len, const void *reject, size_t rejectlen) { size_t ret = 0; diff --git a/src/stream.c b/src/stream.c index 4822387d61..f7ed26f30c 100644 --- a/src/stream.c +++ b/src/stream.c @@ -970,7 +970,7 @@ static void sess_set_term_flags(struct stream *s) /* This function parses the use-service action ruleset. It executes * the associated ACL and set an applet as a stream or txn final node. * it returns ACT_RET_ERR if an error occurs, the proxy left in - * consistent state. It returns ACT_RET_STOP in succes case because + * consistent state. It returns ACT_RET_STOP in success case because * use-service must be a terminal action. Returns ACT_RET_YIELD * if the initialisation function require more data. */ @@ -995,7 +995,7 @@ enum act_return process_use_service(struct act_rule *rule, struct proxy *px, else appctx = si_appctx(&s->si[1]); - /* Stops the applet sheduling, in case of the init function miss + /* Stops the applet scheduling, in case of the init function miss * some data. */ si_stop_get(&s->si[1]); diff --git a/src/wurfl.c b/src/wurfl.c index b8133bad86..b7eb1fef85 100644 --- a/src/wurfl.c +++ b/src/wurfl.c @@ -294,7 +294,7 @@ static int ha_wurfl_init(void) // ebtree initialization global_wurfl.btree = EB_ROOT; - // checking if informations are valid WURFL data ( cap, vcaps, properties ) + // checking if information is valid WURFL data ( cap, vcaps, properties ) list_for_each_entry(wi, &global_wurfl.information_list, list) { // check if information is already loaded looking into btree if (ebst_lookup(&global_wurfl.btree, wi->data.name) == NULL) { @@ -736,7 +736,7 @@ static const char *ha_wurfl_retrieve_header(const char *header_name, const void //the header is searched from the beginning ctx.blk = NULL; - // We could skip this chek since ha_wurfl_retrieve_header is called from inside + // We could skip this check since ha_wurfl_retrieve_header is called from inside // ha_wurfl_get()/ha_wurfl_get_all() that already perform the same check // We choose to keep it in case ha_wurfl_retrieve_header will be called directly htx = smp_prefetch_htx(smp, chn, NULL, 1);