From 2b718aaad8d57c625e94a43c2462a1e234ea31d5 Mon Sep 17 00:00:00 2001 From: Natalia Ogoreltseva Date: Tue, 17 Dec 2019 11:31:41 +0300 Subject: [PATCH 1/4] fixes gh-1021 update replication_timeout description --- doc/reference/configuration/cfg_replication.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/reference/configuration/cfg_replication.rst b/doc/reference/configuration/cfg_replication.rst index d5041566bd..6f90d95ea6 100644 --- a/doc/reference/configuration/cfg_replication.rst +++ b/doc/reference/configuration/cfg_replication.rst @@ -49,9 +49,11 @@ .. confval:: replication_timeout - A replica sends heartbeat messages to the master every second, and the - master is programmed to reconnect automatically if it doesn’t see heartbeat - messages more often than ``replication_timeout`` seconds. + If the master has no updates to send to replicas, it sends heartbeat messages + every ``replication_timeout``, and a replica sends ACK packet back. Both master + and replica are programmed to drop the connection if they don't get any response + more often than four ``replication_timeout`` seconds. Then the replica tries + to reconnect to the master. See more in :ref:`Monitoring a replica set `. From 1dc51411a6d42eb233df0598534d3390bd9915f0 Mon Sep 17 00:00:00 2001 From: Natalia Ogoreltseva Date: Fri, 20 Dec 2019 16:20:13 +0300 Subject: [PATCH 2/4] fixes gh-559 add more info about cookies --- doc/reference/reference_lua/http.rst | 45 +++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/doc/reference/reference_lua/http.rst b/doc/reference/reference_lua/http.rst index 88e57a5033..5109334efa 100644 --- a/doc/reference/reference_lua/http.rst +++ b/doc/reference/reference_lua/http.rst @@ -162,6 +162,49 @@ Below is a list of all ``http`` functions. :rtype: table + Cookies component contains a Lua table where the key is a cookie name. The value + is an array of two elements where the first is cookie value and the second + is an array with the cookie's options. Possible options are `"Expires", "Max-Age", + "Domain", "Path", "Secure", "HttpOnly", "SameSite"`. Note that option's + value consists of two strings with '=' between them. `Here + `_ + you can find more info. + + **Example** + + You can use cookies information like this: + + .. code-block:: tarantoolsession + + tarantool> require('http.client').get('https://www.tarantool.io/en/').cookies + --- + - csrftoken: + - bWJVkBybvX9LdJ8uLPOTVrit5P3VbRjE3potYVOuUnsSjYT5ahghDV06tXRkfnOl + - - Max-Age=31449600 + - Path=/ + ... + + tarantool> cookies = require('http.client').get('https://www.tarantool.io/en/').cookies + --- + ... + + tarantool> options = cookies['csrftoken'][2] + --- + ... + + tarantool> for _, option in ipairs(options) do + > if option:startswith('csrftoken cookie's Max-Age = ') then + > print(option) + > end + > end + + csrftoken cookie's Max-Age = 31449600 + --- + ... + + tarantool> + + The following "shortcuts" exist for requests: * ``http_client:get(url, options)`` - shortcut for @@ -176,7 +219,7 @@ Below is a list of all ``http`` functions. ``http_client:request("OPTIONS", url, nil, opts)`` * ``http_client:head(url, options)`` - shortcut for ``http_client:request("HEAD", url, nil, opts)`` - * ``http_client:delete(url, options)`` - shortcut for + * ``http_client:delete(url, options)`` - shortcut for ``http_client:request("DELETE", url, nil, opts)`` * ``http_client:trace(url, options)`` - shortcut for ``http_client:request("TRACE", url, nil, opts)`` From aed9d82956f425d8daf0fa0c5c4f8c442905f713 Mon Sep 17 00:00:00 2001 From: Natalia Ogoreltseva Date: Mon, 23 Dec 2019 17:20:46 +0300 Subject: [PATCH 3/4] minor fixes --- doc/reference/reference_lua/http.rst | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/reference/reference_lua/http.rst b/doc/reference/reference_lua/http.rst index 5109334efa..96580557ea 100644 --- a/doc/reference/reference_lua/http.rst +++ b/doc/reference/reference_lua/http.rst @@ -162,13 +162,13 @@ Below is a list of all ``http`` functions. :rtype: table - Cookies component contains a Lua table where the key is a cookie name. The value - is an array of two elements where the first is cookie value and the second - is an array with the cookie's options. Possible options are `"Expires", "Max-Age", - "Domain", "Path", "Secure", "HttpOnly", "SameSite"`. Note that option's - value consists of two strings with '=' between them. `Here - `_ - you can find more info. + The ``cookies`` component contains a Lua table where the key is a cookie + name. The value is an array of two elements where the first one is the + cookie value and the second one is an array with the cookie’s options. + Possible options are: “Expires”, “Max-Age”, “Domain”, “Path”, “Secure”, + “HttpOnly”, “SameSite”. Note that an option is a string with '=' + splitting the option's name and its value. + `Here `_ you can find more info. **Example** From 32db7df35d13c35cd3f58a088a1ebb9e0e5aa0d7 Mon Sep 17 00:00:00 2001 From: lenkis Date: Wed, 22 Jan 2020 17:13:22 +0300 Subject: [PATCH 4/4] Minor fixes --- doc/reference/configuration/cfg_replication.rst | 6 +++--- doc/reference/reference_lua/http.rst | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/reference/configuration/cfg_replication.rst b/doc/reference/configuration/cfg_replication.rst index 6f90d95ea6..81ec32e405 100644 --- a/doc/reference/configuration/cfg_replication.rst +++ b/doc/reference/configuration/cfg_replication.rst @@ -50,9 +50,9 @@ .. confval:: replication_timeout If the master has no updates to send to replicas, it sends heartbeat messages - every ``replication_timeout``, and a replica sends ACK packet back. Both master - and replica are programmed to drop the connection if they don't get any response - more often than four ``replication_timeout`` seconds. Then the replica tries + every ``replication_timeout`` seconds, and each replica sends an ACK packet back. + Both master and replica are programmed to drop the connection if they get no response + in four ``replication_timeout`` seconds. Then the replica tries to reconnect to the master. See more in :ref:`Monitoring a replica set `. diff --git a/doc/reference/reference_lua/http.rst b/doc/reference/reference_lua/http.rst index 96580557ea..0ac7f35d99 100644 --- a/doc/reference/reference_lua/http.rst +++ b/doc/reference/reference_lua/http.rst @@ -165,10 +165,11 @@ Below is a list of all ``http`` functions. The ``cookies`` component contains a Lua table where the key is a cookie name. The value is an array of two elements where the first one is the cookie value and the second one is an array with the cookie’s options. - Possible options are: “Expires”, “Max-Age”, “Domain”, “Path”, “Secure”, - “HttpOnly”, “SameSite”. Note that an option is a string with '=' + Possible options are: "Expires", "Max-Age", "Domain", "Path", "Secure", + "HttpOnly", "SameSite". Note that an option is a string with '=' splitting the option's name and its value. - `Here `_ you can find more info. + `Here `_ + you can find more info. **Example** @@ -204,7 +205,6 @@ Below is a list of all ``http`` functions. tarantool> - The following "shortcuts" exist for requests: * ``http_client:get(url, options)`` - shortcut for @@ -219,7 +219,7 @@ Below is a list of all ``http`` functions. ``http_client:request("OPTIONS", url, nil, opts)`` * ``http_client:head(url, options)`` - shortcut for ``http_client:request("HEAD", url, nil, opts)`` - * ``http_client:delete(url, options)`` - shortcut for + * ``http_client:delete(url, options)`` - shortcut for ``http_client:request("DELETE", url, nil, opts)`` * ``http_client:trace(url, options)`` - shortcut for ``http_client:request("TRACE", url, nil, opts)``