aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua
diff options
context:
space:
mode:
authorJosh Soref <2119212+jsoref@users.noreply.github.com>2022-02-22 17:01:28 -0500
committerGitHub <noreply@github.com>2022-02-22 22:01:28 +0000
commit2b8e6958f40ef36c1508118ac36a43694283a83c (patch)
treefa9a9b6843546bdb297b00bc78b83ab4c318f724 /src/lua
parent85faeb34719e2b0898d319b02416f669d70f4562 (diff)
downloadrspamd-2b8e6958f40ef36c1508118ac36a43694283a83c.tar.gz
rspamd-2b8e6958f40ef36c1508118ac36a43694283a83c.zip
Spelling (#4086)
[Rework] Massive spelling fix from @jsoref
Diffstat (limited to 'src/lua')
-rw-r--r--src/lua/lua_config.c18
-rw-r--r--src/lua/lua_dns_resolver.c10
-rw-r--r--src/lua/lua_mimepart.c6
-rw-r--r--src/lua/lua_redis.c2
-rw-r--r--src/lua/lua_regexp.c2
-rw-r--r--src/lua/lua_task.c18
-rw-r--r--src/lua/lua_tcp.c2
-rw-r--r--src/lua/lua_text.c4
-rw-r--r--src/lua/lua_thread_pool.h2
-rw-r--r--src/lua/lua_url.c6
-rw-r--r--src/lua/lua_util.c10
-rw-r--r--src/lua/lua_xmlrpc.c8
12 files changed, 44 insertions, 44 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c
index 467d386a7..f9e6bf437 100644
--- a/src/lua/lua_config.c
+++ b/src/lua/lua_config.c
@@ -256,7 +256,7 @@ LUA_FUNCTION_DEF (config, register_callback_symbol_priority);
/***
* @method rspamd_config:register_dependency(id|name, depname)
* Create a dependency on symbol identified by name for symbol identified by ID or name.
- * This affects order of checks only (a symbol is still checked if its dependencys are disabled).
+ * This affects order of checks only (a symbol is still checked if its dependencies are disabled).
* @param {number|string} id id or name of source (numeric id is returned by all register_*_symbol)
* @param {string} depname dependency name
* @example
@@ -350,7 +350,7 @@ LUA_FUNCTION_DEF (config, get_metric_symbol);
/**
* @method rspamd_config:get_action(name)
- * Gets data for a specific action in config. This function returns number reperesenting action's score
+ * Gets data for a specific action in config. This function returns number representing action's score
*
* @param {string} name name of action
* @return {number} action's score or nil in case of undefined score or action
@@ -495,7 +495,7 @@ LUA_FUNCTION_DEF (config, register_settings_id);
/***
* @method rspamd_config:__newindex(name, callback)
- * This metamethod is called if new indicies are added to the `rspamd_config` object.
+ * This metamethod is called if new indices are added to the `rspamd_config` object.
* Technically, it is the equivalent of @see rspamd_config:register_symbol where `weight` is 1.0.
* There is also table form invocation that allows to control more things:
*
@@ -734,7 +734,7 @@ LUA_FUNCTION_DEF (config, register_monitored);
*
* - `default`: default option value
* - `type`: type of an option (`string`, `number`, `object`, `array` etc)
- * - `reqired`: if an option is required
+ * - `required`: if an option is required
*
* @param {string} path documentation path (e.g. module name)
* @param {string} option name of the option
@@ -2885,7 +2885,7 @@ lua_config_newindex (lua_State *L)
}
else
{
- /* Fill in missing fields from lua defintion if they are not set */
+ /* Fill in missing fields from lua definition if they are not set */
if (sym->description == NULL) {
lua_pushstring (L, "description");
lua_gettable (L, -2);
@@ -2909,12 +2909,12 @@ lua_config_newindex (lua_State *L)
}
lua_pop (L, 1);
if (group) {
- if (sym->flags & RSPAMD_SYMBOL_FLAG_UNGROUPPED) {
+ if (sym->flags & RSPAMD_SYMBOL_FLAG_UNGROUPED) {
/* Unset the "ungrouped" group */
sym->gr = NULL;
}
/* Add the group. If the symbol was ungrouped, this will
- * clear RSPAMD_SYMBOL_FLAG_UNGROUPPED from the flags. */
+ * clear RSPAMD_SYMBOL_FLAG_UNGROUPED from the flags. */
rspamd_config_add_symbol_group (cfg, name, group);
}
}
@@ -3570,8 +3570,8 @@ lua_metric_symbol_inserter (gpointer k, gpointer v, gpointer ud)
lua_pushboolean (L, true);
lua_settable (L, -3);
}
- if (s->flags & RSPAMD_SYMBOL_FLAG_UNGROUPPED) {
- lua_pushstring (L, "ungroupped");
+ if (s->flags & RSPAMD_SYMBOL_FLAG_UNGROUPED) {
+ lua_pushstring (L, "ungrouped");
lua_pushboolean (L, true);
lua_settable (L, -3);
}
diff --git a/src/lua/lua_dns_resolver.c b/src/lua/lua_dns_resolver.c
index b5ded396d..c3bd4cacf 100644
--- a/src/lua/lua_dns_resolver.c
+++ b/src/lua/lua_dns_resolver.c
@@ -532,7 +532,7 @@ err:
* * `mempool` - pool memory pool for storing intermediate data
* * `name` - host name to resolve
* * `callback` - callback callback function to be called upon name resolution is finished; must be of type `function (resolver, to_resolve, results, err)`
- * * `forced` - true if needed to override notmal limit for DNS requests
+ * * `forced` - true if needed to override normal limit for DNS requests
* @return {boolean} `true` if DNS request has been scheduled
*/
static int
@@ -562,7 +562,7 @@ lua_dns_resolver_resolve_a (lua_State *L)
* * `mempool` - pool memory pool for storing intermediate data
* * `name` - host name to resolve
* * `callback` - callback callback function to be called upon name resolution is finished; must be of type `function (resolver, to_resolve, results, err)`
- * * `forced` - true if needed to override notmal limit for DNS requests
+ * * `forced` - true if needed to override normal limit for DNS requests
* @return {boolean} `true` if DNS request has been scheduled
*/
static int
@@ -592,7 +592,7 @@ lua_dns_resolver_resolve_ptr (lua_State *L)
* * `mempool` - pool memory pool for storing intermediate data
* * `name` - host name to resolve
* * `callback` - callback callback function to be called upon name resolution is finished; must be of type `function (resolver, to_resolve, results, err)`
- * * `forced` - true if needed to override notmal limit for DNS requests
+ * * `forced` - true if needed to override normal limit for DNS requests
* @return {boolean} `true` if DNS request has been scheduled
*/
static int
@@ -622,7 +622,7 @@ lua_dns_resolver_resolve_txt (lua_State *L)
* * `mempool` - pool memory pool for storing intermediate data
* * `name` - host name to resolve
* * `callback` - callback callback function to be called upon name resolution is finished; must be of type `function (resolver, to_resolve, results, err)`
- * * `forced` - true if needed to override notmal limit for DNS requests
+ * * `forced` - true if needed to override normal limit for DNS requests
* @return {boolean} `true` if DNS request has been scheduled
*/
static int
@@ -652,7 +652,7 @@ lua_dns_resolver_resolve_mx (lua_State *L)
* * `mempool` - pool memory pool for storing intermediate data
* * `name` - host name to resolve
* * `callback` - callback callback function to be called upon name resolution is finished; must be of type `function (resolver, to_resolve, results, err)`
- * * `forced` - true if needed to override notmal limit for DNS requests
+ * * `forced` - true if needed to override normal limit for DNS requests
* @return {boolean} `true` if DNS request has been scheduled
*/
static int
diff --git a/src/lua/lua_mimepart.c b/src/lua/lua_mimepart.c
index db12cf672..27b12ae6d 100644
--- a/src/lua/lua_mimepart.c
+++ b/src/lua/lua_mimepart.c
@@ -318,7 +318,7 @@ LUA_FUNCTION_DEF (mimepart, get_header_full);
* * By default headers are searched in caseless matter.
* @param {string} name name of header to get
* @param {boolean} case_sensitive case sensitiveness flag to search for a header
- * @return {number} number of header's occurrencies or 0 if not found
+ * @return {number} number of header's occurrences or 0 if not found
*/
LUA_FUNCTION_DEF (mimepart, get_header_count);
@@ -559,7 +559,7 @@ LUA_FUNCTION_DEF (mimepart, is_specific);
/***
* @method mime_part:get_urls([need_emails|list_protos][, need_images])
* Get all URLs found in a mime part. Telephone urls and emails are not included unless explicitly asked in `list_protos`
- * @param {boolean} need_emails if `true` then reutrn also email urls, this can be a comma separated string of protocols desired or a table (e.g. `mailto` or `telephone`)
+ * @param {boolean} need_emails if `true` then return also email urls, this can be a comma separated string of protocols desired or a table (e.g. `mailto` or `telephone`)
* @param {boolean} need_images return urls from images (<img src=...>) as well
* @return {table rspamd_url} list of all urls found
*/
@@ -1868,7 +1868,7 @@ lua_mimepart_is_attachment (lua_State * L)
lua_pushboolean (L, true);
}
else {
- /* Image or an embeded object */
+ /* Image or an embedded object */
lua_pushboolean (L, false);
}
}
diff --git a/src/lua/lua_redis.c b/src/lua/lua_redis.c
index 46202a520..0ec2fa74e 100644
--- a/src/lua/lua_redis.c
+++ b/src/lua/lua_redis.c
@@ -188,7 +188,7 @@ lua_redis_dtor (struct lua_redis_ctx *ctx)
struct redisAsyncContext *ac;
ud = &ctx->async;
- msg_debug_lua_redis ("desctructing %p", ctx);
+ msg_debug_lua_redis ("destructing %p", ctx);
if (ud->ctx) {
diff --git a/src/lua/lua_regexp.c b/src/lua/lua_regexp.c
index 92ed1d790..49c976c69 100644
--- a/src/lua/lua_regexp.c
+++ b/src/lua/lua_regexp.c
@@ -792,7 +792,7 @@ lua_regexp_split (lua_State *L)
/***
* @method re:destroy()
- * Destroy regexp from caches if needed (the pointer is removed by garbadge collector)
+ * Destroy regexp from caches if needed (the pointer is removed by garbage collector)
*/
static gint
lua_regexp_destroy (lua_State *L)
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 4a66ce865..7d01f6ce3 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -174,7 +174,7 @@ LUA_FUNCTION_DEF (task, adjust_result);
/***
* @method task:remove_result(symbol[, shadow_result])
- * Removes the symbol from a named or unamed/default result
+ * Removes the symbol from a named or unnamed/default result
* @param {string} symbol symbol to remove
* @param {string} shadow_result name of shadow result
* @return {boolean} true if a symbol has been removed
@@ -241,7 +241,7 @@ LUA_FUNCTION_DEF (task, append_message);
/***
* @method task:get_urls([need_emails|list_protos][, need_images])
* Get all URLs found in a message. Telephone urls and emails are not included unless explicitly asked in `list_protos`
- * @param {boolean} need_emails if `true` then reutrn also email urls, this can be a comma separated string of protocols desired or a table (e.g. `mailto` or `telephone`)
+ * @param {boolean} need_emails if `true` then return also email urls, this can be a comma separated string of protocols desired or a table (e.g. `mailto` or `telephone`)
* @param {boolean} need_images return urls from images (<img src=...>) as well
* @return {table rspamd_url} list of all urls found
@example
@@ -267,14 +267,14 @@ LUA_FUNCTION_DEF (task, get_urls);
* - If both parameters are nil then all urls are included
* @param {table} flags_include included flags
* @param {table} flags_exclude excluded flags
- * @param {table} protocols_mask incude only specific protocols
+ * @param {table} protocols_mask include only specific protocols
* @return {table rspamd_url} list of urls matching conditions
*/
LUA_FUNCTION_DEF (task, get_urls_filtered);
/***
* @method task:has_urls([need_emails])
* Returns 'true' if a task has urls listed
- * @param {boolean} need_emails if `true` then reutrn also email urls
+ * @param {boolean} need_emails if `true` then return also email urls
* @return {boolean} true if a task has urls (urls or emails if `need_emails` is true)
*/
LUA_FUNCTION_DEF (task, has_urls);
@@ -413,7 +413,7 @@ LUA_FUNCTION_DEF (task, get_header_full);
* * By default headers are searched in caseless matter.
* @param {string} name name of header to get
* @param {boolean} case_sensitive case sensitiveness flag to search for a header
- * @return {number} number of header's occurrencies or 0 if not found
+ * @return {number} number of header's occurrences or 0 if not found
*/
LUA_FUNCTION_DEF (task, get_header_count);
/***
@@ -443,7 +443,7 @@ LUA_FUNCTION_DEF (task, get_headers);
* Order in remove starts from 1, where 0 means 'remove all', and negative value means
* remove from the end
* Order in addition means addition from the top: 0 means the most top header, 1 one after, etc
- * negative order means addtion to the end, e.g. -1 is appending header.
+ * negative order means addition to the end, e.g. -1 is appending header.
* @return {bool} true if header could be modified (always true unless we don't have an unparsed message)
*/
LUA_FUNCTION_DEF (task, modify_header);
@@ -2269,7 +2269,7 @@ lua_task_set_pre_result (lua_State * L)
RSPAMD_LUA_PARSE_ARGUMENTS_DEFAULT,
"*action=S;message=S;module=S;score=D;priority=i;flags=S;result=S",
&act_str, &message, &module, &score, &priority, &fl_str, &res_name)) {
- gint ret = luaL_error (L, "invald arguments: %s", err->message);
+ gint ret = luaL_error (L, "invalid arguments: %s", err->message);
g_error_free (err);
return ret;
@@ -5808,7 +5808,7 @@ lua_task_set_milter_reply (lua_State *L)
* UCL itself cannot do it directly. So the trick is to extract the
* original object, pack it into an array and then insert it back.
*
- * I wish there was a simplier way to do it...
+ * I wish there was a simpler way to do it...
*/
const ucl_object_t *add_hdrs = ucl_object_lookup (prev, "add_headers");
const ucl_object_t *nadd_hdrs = ucl_object_lookup (reply, "add_headers");
@@ -7025,7 +7025,7 @@ lua_image_get_filename (lua_State *L)
return 1;
}
-/* Arvhive methods */
+/* Archive methods */
static gint
lua_archive_get_type (lua_State *L)
{
diff --git a/src/lua/lua_tcp.c b/src/lua/lua_tcp.c
index 37f535850..635aa885d 100644
--- a/src/lua/lua_tcp.c
+++ b/src/lua/lua_tcp.c
@@ -100,7 +100,7 @@ LUA_FUNCTION_DEF (tcp, request);
* @function rspamd_tcp.connect_sync()
*
* Creates pseudo-synchronous TCP connection.
- * Each method of the connection requiring IO, becames a yielding point,
+ * Each method of the connection requiring IO, becomes a yielding point,
* i.e. current thread Lua thread is get suspended and resumes as soon as IO is done
*
* This class represents low-level API, using of "lua_tcp_sync" module is recommended.
diff --git a/src/lua/lua_text.c b/src/lua/lua_text.c
index f88b5c29b..19317bf59 100644
--- a/src/lua/lua_text.c
+++ b/src/lua/lua_text.c
@@ -101,7 +101,7 @@ LUA_FUNCTION_DEF (text, save_in_file);
LUA_FUNCTION_DEF (text, span);
/***
* @method rspamd_text:sub(start[, len])
- * Returns a substrin for lua_text similar to string.sub from Lua
+ * Returns a substring for lua_text similar to string.sub from Lua
* @return {rspamd_text} new rspamd_text with span (must be careful when using with owned texts...)
*/
LUA_FUNCTION_DEF (text, sub);
@@ -194,7 +194,7 @@ LUA_FUNCTION_DEF (text, base32);
* @method rspamd_text:base64([line_length, [nline, [fold]]])
* Returns a text encoded in base64 (new rspamd_text is allocated)
*
- * @param {number} line_length return text splited with newlines up to this attribute
+ * @param {number} line_length return text split with newlines up to this attribute
* @param {string} nline newline type: `cr`, `lf`, `crlf`
* @param {boolean} fold use folding when splitting into lines (false by default)
* @return {rspamd_text} new text encoded in base64
diff --git a/src/lua/lua_thread_pool.h b/src/lua/lua_thread_pool.h
index 2845d2f67..9dc269bfd 100644
--- a/src/lua/lua_thread_pool.h
+++ b/src/lua/lua_thread_pool.h
@@ -53,7 +53,7 @@ lua_thread_pool_free (struct lua_thread_pool *pool);
/**
* Extracts a thread from the list of available ones.
- * It immediately becames running one and should be used to run a Lua script/function straight away.
+ * It immediately becomes the running one and should be used to run a Lua script/function straight away.
* as soon as the code is finished, it should be either returned into list of available threads by
* calling lua_thread_pool_return() or terminated by calling lua_thread_pool_terminate_entry()
* if the code finished with error.
diff --git a/src/lua/lua_url.c b/src/lua/lua_url.c
index 2d9d64b39..af7dd5f4e 100644
--- a/src/lua/lua_url.c
+++ b/src/lua/lua_url.c
@@ -599,8 +599,8 @@ lua_url_get_protocol (lua_State *L)
/***
* @method url:get_count()
- * Return number of occurrencies for this particular URL
- * @return {number} number of occurrencies
+ * Return number of occurrences for this particular URL
+ * @return {number} number of occurrences
*/
static gint
lua_url_get_count (lua_State *L)
@@ -871,7 +871,7 @@ lua_url_all (lua_State *L)
* - `host_encoded`: URL host part is encoded
* - `schema_encoded`: URL schema part is encoded
* - `query_encoded`: URL query part is encoded
- * - `missing_slahes`: URL has some slashes missing
+ * - `missing_slashes`: URL has some slashes missing
* - `idn`: URL has international characters
* - `has_port`: URL has port
* - `has_user`: URL has user part
diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c
index 4dd944008..742c6377a 100644
--- a/src/lua/lua_util.c
+++ b/src/lua/lua_util.c
@@ -54,7 +54,7 @@ LUA_FUNCTION_DEF (util, create_event_base);
LUA_FUNCTION_DEF (util, load_rspamd_config);
/***
* @function util.config_from_ucl(any, string)
- * Load rspamd config from ucl reperesented by any lua table
+ * Load rspamd config from ucl represented by any lua table
* @return {confg} new configuration object suitable for access
*/
LUA_FUNCTION_DEF (util, config_from_ucl);
@@ -68,7 +68,7 @@ LUA_FUNCTION_DEF (util, config_from_ucl);
LUA_FUNCTION_DEF (util, encode_base64);
/***
* @function util.encode_qp(input[, str_len, [newlines_type]])
- * Encodes data in quouted printable breaking lines if needed
+ * Encodes data in quoted printable breaking lines if needed
* @param {text or string} input input data
* @param {number} str_len optional size of lines or 0 if split is not needed
* @return {rspamd_text} encoded data chunk
@@ -77,7 +77,7 @@ LUA_FUNCTION_DEF (util, encode_qp);
/***
* @function util.decode_qp(input)
- * Decodes data from quouted printable
+ * Decodes data from quoted printable
* @param {text or string} input input data
* @return {rspamd_text} decoded data chunk
*/
@@ -127,9 +127,9 @@ LUA_FUNCTION_DEF (util, tokenize_text);
LUA_FUNCTION_DEF (util, process_message);
/***
* @function util.tanh(num)
- * Calculates hyperbolic tanhent of the specified floating point value
+ * Calculates hyperbolic tangent of the specified floating point value
* @param {number} num input number
- * @return {number} hyperbolic tanhent of the variable
+ * @return {number} hyperbolic tangent of the variable
*/
LUA_FUNCTION_DEF (util, tanh);
diff --git a/src/lua/lua_xmlrpc.c b/src/lua/lua_xmlrpc.c
index d4aa87888..67f4dcfbc 100644
--- a/src/lua/lua_xmlrpc.c
+++ b/src/lua/lua_xmlrpc.c
@@ -34,7 +34,7 @@ static const struct luaL_reg xmlrpclib_m[] = {
INIT_LOG_MODULE(xmlrpc)
enum lua_xmlrpc_state {
- read_method_responce = 0,
+ read_method_response = 0,
read_params = 1,
read_param = 2,
read_param_value = 3,
@@ -115,7 +115,7 @@ xmlrpc_start_element (GMarkupParseContext *context,
msg_debug_xmlrpc ("got start element %s on state %d", name, last_state);
switch (ud->parser_state) {
- case read_method_responce:
+ case read_method_response:
/* Expect tag methodResponse */
if (g_ascii_strcasecmp (name, "methodResponse") == 0) {
ud->parser_state = read_params;
@@ -342,7 +342,7 @@ xmlrpc_end_element (GMarkupParseContext *context,
msg_debug_xmlrpc ("got end element %s on state %d", name, last_state);
switch (ud->parser_state) {
- case read_method_responce:
+ case read_method_response:
ud->parser_state = error_state;
break;
case read_params:
@@ -615,7 +615,7 @@ lua_xmlrpc_parse_reply (lua_State *L)
if (data != NULL) {
ud.L = L;
- ud.parser_state = read_method_responce;
+ ud.parser_state = read_method_response;
ud.param_count = 0;
ud.st = g_queue_new ();