Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #46

Merged
merged 1 commit into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests-and-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: check out repository code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: run luacheck
run: sudo apt-get install -y lua-check && cd "${{ github.workspace }}" && ./tests/run-luacheck.sh -q
Expand Down
2 changes: 1 addition & 1 deletion docs/modules/mqtt.client.html
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ <h3>Parameters:</h3>
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
callback to call when publihsed message will be acknowledged
callback to call when published message will be acknowledged
(<em>optional</em>)
</li>
</li></ul>
Expand Down
2 changes: 1 addition & 1 deletion examples/copas-example.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local mqtt_ioloop = require("mqtt.ioloop")

local num_pings = 10 -- total number of ping-pongs
local timeout = 1 -- timeout between ping-pongs
local suffix = tostring(math.random(1000000)) -- mqtt topic suffix to distinct simultaneous rinning of this script
local suffix = tostring(math.random(1000000)) -- mqtt topic suffix to distinct simultaneous running of this script

-- NOTE: more about flespi tokens: https://flespi.com/kb/tokens-access-keys-to-flespi-platform
local token = "stPwSVV73Eqw5LSv0iMXbc4EguS7JyuZR9lxU5uLxI5tiNM8ToTVqNpu85pFtJv9"
Expand Down
2 changes: 1 addition & 1 deletion examples/openresty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ There is a two ways to run MQTT client in openresty:

Started MQTT client is connecting, subscribing and waiting for incoming MQTT publications as you code it, without any magic asynchronous work.

**Caveats**: The keep_alive feature will not work as there is no way for MQTT client to break its receive() operation in keep_alive interval and send PINGREQ packet to MQTT broker to maintain connection. It may lead to disconnects from MQTT broker side in absense traffic in opened MQTT connection. After disconnecting from broker there is a way to reconnect using openresty's timer.
**Caveats**: The keep_alive feature will not work as there is no way for MQTT client to break its receive() operation in keep_alive interval and send PINGREQ packet to MQTT broker to maintain connection. It may lead to disconnects from MQTT broker side in absence of traffic in opened MQTT connection. After disconnecting from broker there is a way to reconnect using openresty's timer.

# ioloop mode

Expand Down
8 changes: 4 additions & 4 deletions mqtt/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function client_mt:__init(args)
self._to_remove_handlers = {}

-- state
self.first_connect = true -- contains true to perform one network connection attemt after client creation
self.first_connect = true -- contains true to perform one network connection attempt after client creation
self.send_time = 0 -- time of the last network send from client side

-- packet creation/parse functions according version
Expand Down Expand Up @@ -420,7 +420,7 @@ end
-- @tparam[opt=false] boolean args.dup dup message publication flag
-- @tparam[opt] table args.properties properties for publishing message
-- @tparam[opt] table args.user_properties user properties for publishing message
-- @tparam[opt] function args.callback callback to call when publihsed message will be acknowledged
-- @tparam[opt] function args.callback callback to call when published message will be acknowledged
-- @return true or packet id on success or false and error message on failure
function client_mt:publish(args)
-- fetch and validate args
Expand Down Expand Up @@ -718,8 +718,8 @@ function client_mt:open_connection()
-- create connection table
local conn = {
uri = args.uri,
wait_for_pubrec = {}, -- a table with packet_id of parially acknowledged sent packets in QoS 2 exchange process
wait_for_pubrel = {}, -- a table with packet_id of parially acknowledged received packets in QoS 2 exchange process
wait_for_pubrec = {}, -- a table with packet_id of partially acknowledged sent packets in QoS 2 exchange process
wait_for_pubrel = {}, -- a table with packet_id of partially acknowledged received packets in QoS 2 exchange process
}
client_mt._parse_uri(args, conn)
client_mt._apply_secure(args, conn)
Expand Down
2 changes: 1 addition & 1 deletion mqtt/protocol.lua
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ combined_packet_mt.__index = function(_, key)
end

--- Combine several data parts into one
-- @tparam combined_packet_mt/string ... any amout of strings of combined_packet_mt tables to combine into one packet
-- @tparam combined_packet_mt/string ... any amount of strings of combined_packet_mt tables to combine into one packet
-- @treturn combined_packet_mt table suitable to append packet parts or to stringify it into raw packet bytes
function protocol.combine(...)
return setmetatable({...}, combined_packet_mt)
Expand Down
2 changes: 1 addition & 1 deletion mqtt/protocol4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function protocol4.parse_packet(read_func)
if not ptype then
return false, flags
end
-- parse readed data according type in fixed header
-- parse read data according type in fixed header
if ptype == packet_type.CONNECT then
return parse_packet_connect_input(input, const_v311)
elseif ptype == packet_type.CONNACK then
Expand Down
2 changes: 1 addition & 1 deletion mqtt/protocol5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ function protocol5.parse_packet(read_func)
local byte1, byte2, err, rc, ok, packet, topic, packet_id
local read_data = input.read_func

-- parse readed data according type in fixed header
-- parse read data according type in fixed header
if ptype == packet_type.CONNACK then
-- DOC: 3.2 CONNACK – Connect acknowledgement
if input.available < 3 then
Expand Down
4 changes: 2 additions & 2 deletions tests/spec/mqtt-client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,8 @@ describe("no_local flag for subscription: ", function()
assert.are.equal(1, s2.published, "only one publish")
assert.are.same({"stop"}, s1.messages, "only one message")
assert.are.same({"message", "stop"}, s2.messages, "should be two messages")
assert.are.same({}, s1.errors, "errors occured with client 1")
assert.are.same({}, s2.errors, "errors occured with client 2")
assert.are.same({}, s1.errors, "errors occurred with client 1")
assert.are.same({}, s2.errors, "errors occurred with client 2")
end)
end)

Expand Down