diff options
Diffstat (limited to 'etc')
-rw-r--r-- | etc/lp.lua | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -76,7 +76,7 @@ RFC 1179 | |||
76 | -- gets server acknowledement | 76 | -- gets server acknowledement |
77 | local function recv_ack(con) | 77 | local function recv_ack(con) |
78 | local ack = con.skt:receive(1) | 78 | local ack = con.skt:receive(1) |
79 | con.try(string.char(0) == ack, "failed to receive server acknowledement") | 79 | con.try(string.char(0) == ack, "failed to receive server acknowledgement") |
80 | end | 80 | end |
81 | 81 | ||
82 | -- sends client acknowledement | 82 | -- sends client acknowledement |
@@ -166,7 +166,7 @@ local function send_hdr(con, control) | |||
166 | end | 166 | end |
167 | 167 | ||
168 | local function send_control(con, control) | 168 | local function send_control(con, control) |
169 | local sent = con:send(control) | 169 | local sent = con.skt:send(control) |
170 | con.try(sent and sent >= 1, "failed to send control file") | 170 | con.try(sent and sent >= 1, "failed to send control file") |
171 | send_ack(con) | 171 | send_ack(con) |
172 | end | 172 | end |
@@ -176,7 +176,7 @@ local function send_data(con,fh,size) | |||
176 | while size > 0 do | 176 | while size > 0 do |
177 | buf,message = fh:read(8192) | 177 | buf,message = fh:read(8192) |
178 | if buf then | 178 | if buf then |
179 | st = con.try(con:send(buf)) | 179 | st = con.try(con.skt:send(buf)) |
180 | size = size - st | 180 | size = size - st |
181 | else | 181 | else |
182 | con.try(size == 0, "file size mismatch") | 182 | con.try(size == 0, "file size mismatch") |
@@ -303,7 +303,7 @@ query = socket.protect(function(p) | |||
303 | if string.sub(p.format or 's',1,1) == 's' then fmt = 3 else fmt = 4 end | 303 | if string.sub(p.format or 's',1,1) == 's' then fmt = 3 else fmt = 4 end |
304 | con.try(con.skt:send(string.format("%c%s %s\n", fmt, p.queue or "*", | 304 | con.try(con.skt:send(string.format("%c%s %s\n", fmt, p.queue or "*", |
305 | p.list or ""))) | 305 | p.list or ""))) |
306 | local data = ltry(connection:receive("*a")) | 306 | local data = con.try(con.skt:receive("*a")) |
307 | con.skt:close() | 307 | con.skt:close() |
308 | return data | 308 | return data |
309 | end) | 309 | end) |