mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-26 04:28:20 +01:00
Previous bug fix caused a new bug. :o/
This commit is contained in:
parent
c98dc99199
commit
84f03fda7c
@ -129,7 +129,7 @@ int sendraw(p_buf buf, const char *data, size_t count, size_t *sent)
|
||||
p_tm tm = buf->tm;
|
||||
size_t total = 0;
|
||||
int err = IO_DONE;
|
||||
while (total < count && err == IO_DONE) {
|
||||
while (total < count && (err == IO_DONE || err == IO_RETRY)) {
|
||||
size_t done;
|
||||
err = io->send(io->ctx, data+total, count-total, &done, tm_get(tm));
|
||||
total += done;
|
||||
|
@ -11,6 +11,7 @@ end
|
||||
function fail(...)
|
||||
local s = string.format(unpack(arg))
|
||||
io.stderr:write("ERROR: ", s, "!\n")
|
||||
socket.sleep(3)
|
||||
os.exit()
|
||||
end
|
||||
|
||||
@ -432,6 +433,20 @@ function rebind_test()
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
test("character line")
|
||||
test_asciiline(1)
|
||||
test_asciiline(17)
|
||||
test_asciiline(200)
|
||||
test_asciiline(4091)
|
||||
test_asciiline(80199)
|
||||
test_asciiline(8000000)
|
||||
test_asciiline(80199)
|
||||
test_asciiline(4091)
|
||||
test_asciiline(200)
|
||||
test_asciiline(17)
|
||||
test_asciiline(1)
|
||||
|
||||
test("method registration")
|
||||
test_methods(socket.tcp(), {
|
||||
"accept",
|
||||
@ -498,18 +513,6 @@ test_mixed(200)
|
||||
test_mixed(17)
|
||||
test_mixed(1)
|
||||
|
||||
test("character line")
|
||||
test_asciiline(1)
|
||||
test_asciiline(17)
|
||||
test_asciiline(200)
|
||||
test_asciiline(4091)
|
||||
test_asciiline(80199)
|
||||
test_asciiline(8000000)
|
||||
test_asciiline(80199)
|
||||
test_asciiline(4091)
|
||||
test_asciiline(200)
|
||||
test_asciiline(17)
|
||||
test_asciiline(1)
|
||||
|
||||
test("binary line")
|
||||
reconnect()
|
||||
|
@ -13,6 +13,7 @@ while 1 do
|
||||
-- control:setoption("nodelay", true)
|
||||
while 1 do
|
||||
command, error = control:receive()
|
||||
print(error)
|
||||
if error then
|
||||
control:close()
|
||||
print("server: closing connection...")
|
||||
@ -24,6 +25,7 @@ while 1 do
|
||||
print("server: closing connection...")
|
||||
break
|
||||
end
|
||||
print(command);
|
||||
(loadstring(command))()
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user