mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
httpd don't need readline now
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
local socket = require "socket"
|
||||
|
||||
local readline = socket.readline
|
||||
local readbytes = socket.read
|
||||
local writebytes = socket.write
|
||||
|
||||
@@ -10,18 +9,7 @@ local socket_error = {}
|
||||
sockethelper.socket_error = socket_error
|
||||
|
||||
function sockethelper.readfunc(fd)
|
||||
local helper = {}
|
||||
|
||||
function helper.readline()
|
||||
local ret = readline(fd, "\r\n")
|
||||
if ret then
|
||||
return ret
|
||||
else
|
||||
error(socket_error)
|
||||
end
|
||||
end
|
||||
|
||||
function helper.readbytes(sz)
|
||||
return function (sz)
|
||||
local ret = readbytes(fd, sz)
|
||||
if ret then
|
||||
return ret
|
||||
@@ -29,8 +17,6 @@ function sockethelper.readfunc(fd)
|
||||
error(socket_error)
|
||||
end
|
||||
end
|
||||
|
||||
return helper
|
||||
end
|
||||
|
||||
function sockethelper.writefunc(fd)
|
||||
|
||||
Reference in New Issue
Block a user