mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-26 04:28:20 +01:00
tiny bug in test.
This commit is contained in:
parent
b1a4ad2b19
commit
b2b7e9cef1
@ -17,12 +17,6 @@
|
|||||||
* Initializes module
|
* Initializes module
|
||||||
\*-------------------------------------------------------------------------*/
|
\*-------------------------------------------------------------------------*/
|
||||||
int sock_open(void) {
|
int sock_open(void) {
|
||||||
#if DOESNT_COMPILE_TRY_THIS
|
|
||||||
struct sigaction ignore;
|
|
||||||
memset(&ignore, 0, sizeof(ignore));
|
|
||||||
ignore.sa_handler = SIG_IGN;
|
|
||||||
sigaction(SIGPIPE, &ignore, NULL);
|
|
||||||
#endif
|
|
||||||
/* instals a handler to ignore sigpipe or it will crash us */
|
/* instals a handler to ignore sigpipe or it will crash us */
|
||||||
signal(SIGPIPE, SIG_IGN);
|
signal(SIGPIPE, SIG_IGN);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -447,11 +447,14 @@ function getstats_test()
|
|||||||
str = data:receive(%d)
|
str = data:receive(%d)
|
||||||
data:send(str)
|
data:send(str)
|
||||||
]], c))
|
]], c))
|
||||||
c:send(string.rep("a", c))
|
data:send(string.rep("a", c))
|
||||||
c:receive(c)
|
data:receive(c)
|
||||||
local r, s, a = c:getstats()
|
t = t + c
|
||||||
assert(r == t, "received count failed")
|
local r, s, a = data:getstats()
|
||||||
assert(s == t, "sent count failed")
|
assert(r == t, "received count failed" .. tostring(r)
|
||||||
|
.. "/" .. tostring(t))
|
||||||
|
assert(s == t, "sent count failed" .. tostring(s)
|
||||||
|
.. "/" .. tostring(t))
|
||||||
end
|
end
|
||||||
print("ok")
|
print("ok")
|
||||||
end
|
end
|
||||||
|
@ -24,7 +24,6 @@ while 1 do
|
|||||||
print("server: closing connection...")
|
print("server: closing connection...")
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
print(command);
|
|
||||||
(loadstring(command))()
|
(loadstring(command))()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user