From 874a35cb55022d55786d14fa7b7ea7b5aaba7424 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Mon, 10 Sep 2018 21:26:07 +0100 Subject: [PATCH] DOC: Fix typos in lua documentation --- doc/lua-api/index.rst | 114 ++++++++++++++++++++--------------------- src/filters.c | 2 +- src/stream_interface.c | 2 +- 3 files changed, 59 insertions(+), 59 deletions(-) diff --git a/doc/lua-api/index.rst b/doc/lua-api/index.rst index 0c79766eb..553cf521e 100644 --- a/doc/lua-api/index.rst +++ b/doc/lua-api/index.rst @@ -209,7 +209,7 @@ Core class configuration file, on the default syslog server if it is configured and on the stderr if it is allowed. - :param integer loglevel: Is the log level asociated with the message. It is a + :param integer loglevel: Is the log level associated with the message. It is a number between 0 and 7. :param string msg: The log content. :see: :js:attr:`core.emerg`, :js:attr:`core.alert`, :js:attr:`core.crit`, @@ -314,8 +314,8 @@ Core class Returns HAProxy core informations. We can found information like the uptime, the pid, memory pool usage, tasks number, ... - These information are also returned by the management sockat via the command - "show info". See the management socket documentation fpor more information + These information are also returned by the management socket via the command + "show info". See the management socket documentation for more information about the content of these variables. :returns: an array of values. @@ -325,7 +325,7 @@ Core class **context**: body, init, task, action This function returns the current time. The time returned is fixed by the - HAProxy core and assures than the hour will be monotnic and that the system + HAProxy core and assures than the hour will be monotonic and that the system call 'gettimeofday' will not be called too. The time is refreshed between each Lua execution or resume, so two consecutive call to the function "now" will probably returns the same result. @@ -338,7 +338,7 @@ Core class **context**: body, init, task, action - This function take a string repsenting http date, and returns an integer + This function take a string representing http date, and returns an integer containing the corresponding date with a epoch format. A valid http date me respect the format IMF, RFC850 or ASCTIME. @@ -353,7 +353,7 @@ Core class **context**: body, init, task, action - This function take a string repsenting IMF date, and returns an integer + This function take a string representing IMF date, and returns an integer containing the corresponding date with a epoch format. :param string date: a date IMF formatted @@ -371,7 +371,7 @@ Core class **context**: body, init, task, action - This function take a string repsenting RFC850 date, and returns an integer + This function take a string representing RFC850 date, and returns an integer containing the corresponding date with a epoch format. :param string date: a date RFC859 formatted @@ -389,7 +389,7 @@ Core class **context**: body, init, task, action - This function take a string repsenting ASCTIME date, and returns an integer + This function take a string representing ASCTIME date, and returns an integer containing the corresponding date with a epoch format. :param string date: a date ASCTIME formatted @@ -407,7 +407,7 @@ Core class **context**: body, init, task, action - This function take a string repsenting http date, and returns an integer + This function take a string representing http date, and returns an integer containing the corresponding date with a epoch format. :param string date: a date http-date formatted @@ -416,7 +416,7 @@ Core class **context**: body, init, task, action - This function take a string repsenting http date, and returns an integer + This function take a string representing http date, and returns an integer containing the corresponding date with a epoch format. :param string date: a date http-date formatted @@ -433,7 +433,7 @@ Core class **context**: body, init, task, action, sample-fetch, converter - proxies is a table containing the list of all proxies declared in the + Proxies is a table containing the list of all proxies declared in the configuration file. The table is indexed by the proxy name, and each entry of the proxies table is an object of type :ref:`proxy_class`. @@ -466,9 +466,9 @@ Core class * **txn** (:ref:`txn_class`): this is a TXN object used for manipulating the current request or TCP stream. - * **argX**: this is argument provided throught the HAProxy configuration file. + * **argX**: this is argument provided through the HAProxy configuration file. - Here, an exemple of action registration. the action juste send an 'Hello world' + Here, an example of action registration. The action just send an 'Hello world' in the logs. .. code-block:: lua @@ -491,7 +491,7 @@ Core class http-request lua.hello-world .. - A second example using aruments + A second example using arguments .. code-block:: lua @@ -531,16 +531,16 @@ Core class * **str** (*string*): this is the input value automatically converted in string. * **p1** .. **p5** (*string*): this is a list of string arguments declared in - the haroxy configuration file. The number of arguments doesn't exceed 5. + the HAProxy configuration file. The number of arguments doesn't exceed 5. The order and the nature of these is conventionally choose by the - developper. + developer. .. js:function:: core.register_fetches(name, func) **context**: body Register a Lua function executed as sample fetch. All the registered sample - fetchs can be used in HAProxy with the prefix "lua.". A Lua sample fetch + fetch can be used in HAProxy with the prefix "lua.". A Lua sample fetch return a string as output. The registered function can take up to 9 values as parameter. All the value are strings. @@ -557,10 +557,10 @@ Core class * **txn** (:ref:`txn_class`): this is the txn object associated with the current request. * **p1** .. **p5** (*string*): this is a list of string arguments declared in - the haroxy configuration file. The number of arguments doesn't exceed 5. + the HAProxy configuration file. The number of arguments doesn't exceed 5. The order and the nature of these is conventionally choose by the - developper. - * **Returns**: A string containing some data, ot nil if the value cannot be + developer. + * **Returns**: A string containing some data, or nil if the value cannot be returned now. lua example code: @@ -608,9 +608,9 @@ Core class **warning**: Applets of type 'http' cannot be called from 'tcp-*' rulesets. Only the 'http-*' rulesets are authorized, this means that is not possible to call an HTTP applet from a proxy in tcp - mode. Applets of type 'tcp' can be called from anywhre. + mode. Applets of type 'tcp' can be called from anywhere. - Here, an exemple of service registration. the service just send an 'Hello world' + Here, an example of service registration. The service just send an 'Hello world' as an http response. .. code-block:: lua @@ -690,7 +690,7 @@ Core class .. I/O are managed with the :ref:`applettcp_class` object. Args are given as - paramter. The args embbed the registred path. If the path is declared like + parameter. The args embed the registered path. If the path is declared like this: .. code-block:: lua @@ -707,7 +707,7 @@ Core class > show ssl stats all .. - Then, arg1, arg2 and arg3 will contains respectivey "show", "ssl" and "stats". + Then, arg1, arg2 and arg3 will contains respectively "show", "ssl" and "stats". arg4 will contain "all". arg5 contains nil. .. js:function:: core.set_nice(nice) @@ -722,7 +722,7 @@ Core class **context**: init, task, action, sample-fetch, converter - set the value *value* associated to the key *key* in the map referenced by + Set the value *value* associated to the key *key* in the map referenced by *filename*. :param string filename: the Map reference @@ -749,7 +749,7 @@ Core class **context**: body, init, task, action, sample-fetch, converter - This function retruns a new concat object. + This function returns a new concat object. :returns: A :ref:`concat_class` object. @@ -781,7 +781,7 @@ Core class its network length, like this: "127.0.0.1/8" or "aaaa::1234/32". :returns: a userdata containing network or nil if an error occurs. - Parse ipv4 or ipv6 adresses and its facultative associated network. + Parse ipv4 or ipv6 addresses and its facultative associated network. .. js:function:: core.match_addr(addr1, addr2) @@ -789,7 +789,7 @@ Core class :param addr1: is an address created with "core.parse_addr". :param addr2: is an address created with "core.parse_addr". - :returns: boolean, true if the network of the addresses matche, else returns + :returns: boolean, true if the network of the addresses match, else returns false. Match two networks. For example "127.0.0.1/32" matchs "127.0.0.0/8". The order @@ -906,7 +906,7 @@ Proxy class .. js:function:: Proxy.get_stats(px) - Returns a table containg the proxy statistics. The statistics returned are + Returns a table containing the proxy statistics. The statistics returned are not the same if the proxy is frontend or a backend. :param class_proxy px: A :ref:`proxy_class` which indicates the manipulated @@ -1134,12 +1134,12 @@ Concat class For each concatenation, Lua: * allocate memory for the result, * catenate the two string copying the strings in the new memory bloc, - * free the old memory block containing the string whoch is no longer used. + * free the old memory block containing the string which is no longer used. This process does many memory move, allocation and free. In addition, the - memory is not really freed, it is just mark mark as unsused and wait for the + memory is not really freed, it is just mark mark as unused and wait for the garbage collector. - The Concat class provide an alternative way for catenating strings. It uses + The Concat class provide an alternative way to concatenate strings. It uses the internal Lua mechanism (it does not allocate memory), but it doesn't copy the data more than once. @@ -1173,12 +1173,12 @@ Concat class :param class_concat concat: A :ref:`concat_class` which contains the currently builded string. - :param string string: A new string to concatenate to the current builded + :param string string: A new string to concatenate to the current built string. .. js:function:: Concat.dump(concat) - This function returns the concanated string. + This function returns the concatenated string. :param class_concat concat: A :ref:`concat_class` which contains the currently builded string. @@ -1193,7 +1193,7 @@ Fetches class This class contains a lot of internal HAProxy sample fetches. See the HAProxy "configuration.txt" documentation for more information about her - usage. they are the chapters 7.3.2 to 7.3.6. + usage. They are the chapters 7.3.2 to 7.3.6. **warning** some sample fetches are not available in some context. These limitations are specified in this documentation when they're useful. @@ -1424,7 +1424,7 @@ HTTP class .. js:function:: HTTP.res_add_header(http, name, value) - appends an HTTP header field in the response whose name is + Appends an HTTP header field in the response whose name is specified in "name" and whose value is defined in "value". :param class_http http: The related http object. @@ -1452,7 +1452,7 @@ HTTP class .. js:function:: HTTP.req_set_header(http, name, value) - This variable replace all occurence of all header "name", by only + This variable replace all occurrence of all header "name", by only one containing the "value". :param class_http http: The related http object. @@ -1460,7 +1460,7 @@ HTTP class :param string value: The header value. :see: :js:func:`HTTP.res_set_header` - This function does the same work as the folowwing code: + This function does the same work as the following code: .. code-block:: lua @@ -1472,7 +1472,7 @@ HTTP class .. js:function:: HTTP.res_set_header(http, name, value) - This variable replace all occurence of all header "name", by only + This variable replace all occurrence of all header "name", by only one containing the "value". :param class_http http: The related http object. @@ -1604,7 +1604,7 @@ TXN class :returns: An :ref:`http_class`. - This attribute contains an HTTP class object. It is avalaible only if the + This attribute contains an HTTP class object. It is available only if the proxy has the "mode http" enabled. .. js:function:: TXN.log(TXN, loglevel, msg) @@ -1614,7 +1614,7 @@ TXN class the stderr if it is allowed. :param class_txn txn: The class txn object containing the data. - :param integer loglevel: Is the log level asociated with the message. It is a + :param integer loglevel: Is the log level associated with the message. It is a number between 0 and 7. :param string msg: The log content. :see: :js:attr:`core.emerg`, :js:attr:`core.alert`, :js:attr:`core.crit`, @@ -1628,7 +1628,7 @@ TXN class .. js:function:: TXN.deflog(TXN, msg) - Sends a log line with the default loglevel for the proxy ssociated with the + Sends a log line with the default loglevel for the proxy associated with the transaction. :param class_txn txn: The class txn object containing the data. @@ -1695,8 +1695,8 @@ TXN class function. If no data are stored, it returns a nil value. :param class_txn txn: The class txn object containing the data. - :returns: the opaque data previsously stored, or nil if nothing is - avalaible. + :returns: the opaque data previously stored, or nil if nothing is + available. .. js:function:: TXN.set_priv(txn, data) @@ -1828,15 +1828,15 @@ Socket class :param integer port: must be an integer number in the range [1..64K]. :returns: 1 or nil. - an address field extension permits to use the connect() function to connect to + An address field extension permits to use the connect() function to connect to other stream than TCP. The syntax containing a simpleipv4 or ipv6 address is the basically expected format. This format requires the port. Other format accepted are a socket path like "/socket/path", it permits to - connect to a socket. abstract namespaces are supported with the prefix - "abns@", and finaly a filedescriotr can be passed with the prefix "fd@". + connect to a socket. Abstract namespaces are supported with the prefix + "abns@", and finaly a file descriptor can be passed with the prefix "fd@". The prefix "ipv4@", "ipv6@" and "unix@" are also supported. The port can be - passed int the string. The syntax "127.0.0.1:1234" is valid. in this case, the + passed int the string. The syntax "127.0.0.1:1234" is valid. In this case, the parameter *port* must not be set. .. js:function:: Socket.connect_ssl(socket, address, port) @@ -1956,7 +1956,7 @@ Socket class receive data. :param class_socket socket: Is the manipulated Socket. - :param float value: The timeout value. Use flotting point to specify + :param float value: The timeout value. Use floating point to specify milliseconds. .. _regex_class: @@ -2031,7 +2031,7 @@ Map class .. js:class:: Map This class permits to do some lookup in HAProxy maps. The declared maps can - be modified during the runtime throught the HAProxy management socket. + be modified during the runtime through the HAProxy management socket. .. code-block:: lua @@ -2206,7 +2206,7 @@ AppletHTTP class This attribute contains a Fetches class object. Note that the applet execution place cannot access to a valid HAProxy core HTTP - transaction, so some sample fecthes related to the HTTP dependant + transaction, so some sample fetches related to the HTTP dependant values (hdr, path, ...) are not available. .. js:attribute:: AppletHTTP.sf @@ -2216,7 +2216,7 @@ AppletHTTP class This attribute contains a Fetches class object. The functions of this object returns always a string. Note that the applet execution place cannot access to a valid HAProxy core HTTP - transaction, so some sample fecthes related to the HTTP dependant + transaction, so some sample fetches related to the HTTP dependant values (hdr, path, ...) are not available. .. js:attribute:: AppletHTTP.method @@ -2316,7 +2316,7 @@ AppletHTTP class Reads data from the HTTP body, according to the specified read *size*. If the *size* is missing, the function tries to read all the content of the stream until the end. If the *size* is bigger than the http body, it returns the - amount of data avalaible. + amount of data available. :param class_AppletHTTP applet: An :ref:`applethttp_class` :param integer size: the required read size. @@ -2336,8 +2336,8 @@ AppletHTTP class it returns a nil value. :param class_AppletHTTP applet: An :ref:`applethttp_class` - :returns: the opaque data previsously stored, or nil if nothing is - avalaible. + :returns: the opaque data previously stored, or nil if nothing is + available. :see: :js:func:`AppletHTTP.set_priv` .. js:function:: AppletHTTP.set_priv(applet, data) @@ -2447,8 +2447,8 @@ AppletTCP class it returns a nil value. :param class_AppletTCP applet: An :ref:`applettcp_class` - :returns: the opaque data previsously stored, or nil if nothing is - avalaible. + :returns: the opaque data previously stored, or nil if nothing is + available. :see: :js:func:`AppletTCP.set_priv` .. js:function:: AppletTCP.set_priv(applet, data) diff --git a/src/filters.c b/src/filters.c index 3956667a4..734058c5c 100644 --- a/src/filters.c +++ b/src/filters.c @@ -41,7 +41,7 @@ static int handle_analyzer_result(struct stream *s, struct channel *chn, unsigne * - BREAK_EXECUTION must be used to break the loop and set the filter from * which to resume the next time. * - * Here is an exemple: + * Here is an example: * * RESUME_FILTER_LOOP(stream, channel) { * ... diff --git a/src/stream_interface.c b/src/stream_interface.c index eb04043e4..c918a7cce 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -1425,7 +1425,7 @@ void si_applet_wake_cb(struct stream_interface *si) /* update the stream-int, channels, and possibly wake the stream up */ stream_int_notify(si); - /* stream_int_notify may pass throught checksnd and released some + /* stream_int_notify may pass through checksnd and released some * WAIT_ROOM flags. The process_stream will consider those flags * to wakeup the appctx but in the case the task is not in runqueue * we may have to wakeup the appctx immediately.