diff options
| author | ruki <[email protected]> | 2020-09-25 00:33:07 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-09-25 00:33:07 +0800 |
| commit | 90af4956738036172984f068502624bbc515cae7 (patch) | |
| tree | 7cd7177becaf98e676ae8eaa478f042e14505d3a /tests/modules/socket | |
| parent | 700f08a7bae11c22295f884610f98b7b99eb1790 (diff) | |
fix trailing white-space
Diffstat (limited to 'tests/modules/socket')
| -rw-r--r-- | tests/modules/socket/sched_tcp/echo_server.lua | 10 | ||||
| -rw-r--r-- | tests/modules/socket/sched_tcp/file_server.lua | 8 | ||||
| -rw-r--r-- | tests/modules/socket/sched_udp/echo_server.lua | 2 | ||||
| -rw-r--r-- | tests/modules/socket/tcp/echo_server.lua | 6 | ||||
| -rw-r--r-- | tests/modules/socket/tcp/file_server.lua | 6 | ||||
| -rw-r--r-- | tests/modules/socket/udp/echo_server.lua | 2 | ||||
| -rw-r--r-- | tests/modules/socket/unix_tcp/echo_server.lua | 6 | ||||
| -rw-r--r-- | tests/modules/socket/unix_tcp/file_server.lua | 6 |
8 files changed, 23 insertions, 23 deletions
diff --git a/tests/modules/socket/sched_tcp/echo_server.lua b/tests/modules/socket/sched_tcp/echo_server.lua index 82a2044d8..d85a6fdb1 100644 --- a/tests/modules/socket/sched_tcp/echo_server.lua +++ b/tests/modules/socket/sched_tcp/echo_server.lua @@ -39,14 +39,14 @@ function _listen(addr, port) local sock_clients = {} local sock = socket.bind(addr, port) sock:listen(100) - print("%s: listening %s:%d ..", sock, addr, port) - while true do + print("%s: listening %s:%d ..", sock, addr, port) + while true do local sock_client = sock:accept() if sock_client then - print("%s: accepted", sock_client) + print("%s: accepted", sock_client) table.insert(sock_clients, sock_client) - scheduler.co_start(_session_recv, sock_client) - scheduler.co_start(_session_send, sock_client) + scheduler.co_start(_session_recv, sock_client) + scheduler.co_start(_session_send, sock_client) end end for _, sock_client in ipairs(sock_clients) do diff --git a/tests/modules/socket/sched_tcp/file_server.lua b/tests/modules/socket/sched_tcp/file_server.lua index c1ae25d33..983280117 100644 --- a/tests/modules/socket/sched_tcp/file_server.lua +++ b/tests/modules/socket/sched_tcp/file_server.lua @@ -16,12 +16,12 @@ function _listen(addr, port, filepath) local sock = socket.bind(addr, port) sock:listen(100) - print("%s: listening %s:%d ..", sock, addr, port) - while true do + print("%s: listening %s:%d ..", sock, addr, port) + while true do local sock_client = sock:accept() if sock_client then - print("%s: accepted", sock_client) - scheduler.co_start(_session, sock_client, filepath) + print("%s: accepted", sock_client) + scheduler.co_start(_session, sock_client, filepath) end end sock:close() diff --git a/tests/modules/socket/sched_udp/echo_server.lua b/tests/modules/socket/sched_udp/echo_server.lua index 21f8c887d..129aab7e5 100644 --- a/tests/modules/socket/sched_udp/echo_server.lua +++ b/tests/modules/socket/sched_udp/echo_server.lua @@ -4,7 +4,7 @@ import("core.base.scheduler") function _listen(addr, port) local sock = socket.udp() sock:bind(addr, port) - while true do + while true do print("%s: recv in %s:%d ..", sock, addr, port) local recv, data, peer_addr, peer_port = sock:recvfrom(8192, {block = true}) print("%s: recv %d bytes from: %s:%d", sock, recv, peer_addr, peer_port) diff --git a/tests/modules/socket/tcp/echo_server.lua b/tests/modules/socket/tcp/echo_server.lua index 9ff19dbed..fb70bd424 100644 --- a/tests/modules/socket/tcp/echo_server.lua +++ b/tests/modules/socket/tcp/echo_server.lua @@ -6,11 +6,11 @@ function main() local port = 9001 local sock = socket.bind(addr, port) sock:listen(20) - print("%s: listening %s:%d ..", sock, addr, port) - while true do + print("%s: listening %s:%d ..", sock, addr, port) + while true do local sock_client = sock:accept() if sock_client then - print("%s: accepted", sock_client) + print("%s: accepted", sock_client) local count = 0 local result = nil while true do diff --git a/tests/modules/socket/tcp/file_server.lua b/tests/modules/socket/tcp/file_server.lua index d619a496f..1cbf40339 100644 --- a/tests/modules/socket/tcp/file_server.lua +++ b/tests/modules/socket/tcp/file_server.lua @@ -6,11 +6,11 @@ function main(filepath) local port = 9090 local sock = socket.bind(addr, port) sock:listen(20) - print("%s: listening %s:%d ..", sock, addr, port) - while true do + print("%s: listening %s:%d ..", sock, addr, port) + while true do local sock_client = sock:accept() if sock_client then - print("%s: accepted", sock_client) + print("%s: accepted", sock_client) local file = io.open(filepath, 'rb') if file then local send = sock_client:sendfile(file, {block = true}) diff --git a/tests/modules/socket/udp/echo_server.lua b/tests/modules/socket/udp/echo_server.lua index 84f55eae4..9dad7daee 100644 --- a/tests/modules/socket/udp/echo_server.lua +++ b/tests/modules/socket/udp/echo_server.lua @@ -5,7 +5,7 @@ function main() local port = 9001 local sock = socket.udp() sock:bind(addr, port) - while true do + while true do print("%s: recv in %s:%d ..", sock, addr, port) local recv, data, peer_addr, peer_port = sock:recvfrom(8192, {block = true}) print("%s: recv %d bytes from: %s:%d", sock, recv, peer_addr, peer_port) diff --git a/tests/modules/socket/unix_tcp/echo_server.lua b/tests/modules/socket/unix_tcp/echo_server.lua index 8b69d495f..8a1ea6c7d 100644 --- a/tests/modules/socket/unix_tcp/echo_server.lua +++ b/tests/modules/socket/unix_tcp/echo_server.lua @@ -6,11 +6,11 @@ function main(addr) os.tryrm(addr) local sock = socket.bind_unix(addr) sock:listen(20) - print("%s: listening %s ..", sock, addr) - while true do + print("%s: listening %s ..", sock, addr) + while true do local sock_client = sock:accept() if sock_client then - print("%s: accepted", sock_client) + print("%s: accepted", sock_client) local count = 0 local result = nil while true do diff --git a/tests/modules/socket/unix_tcp/file_server.lua b/tests/modules/socket/unix_tcp/file_server.lua index b17d71104..96560ff67 100644 --- a/tests/modules/socket/unix_tcp/file_server.lua +++ b/tests/modules/socket/unix_tcp/file_server.lua @@ -4,11 +4,11 @@ function main(filepath, addr) addr = addr or path.join(os.tmpdir(), "file.socket") local sock = socket.bind_unix(addr) sock:listen(20) - print("%s: listening %s ..", sock, addr) - while true do + print("%s: listening %s ..", sock, addr) + while true do local sock_client = sock:accept() if sock_client then - print("%s: accepted", sock_client) + print("%s: accepted", sock_client) local file = io.open(filepath, 'rb') if file then local send = sock_client:sendfile(file, {block = true}) |
