aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/lp.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/etc/lp.lua b/etc/lp.lua
index 14ffc70..5230957 100644
--- a/etc/lp.lua
+++ b/etc/lp.lua
@@ -76,7 +76,7 @@ RFC 1179
76-- gets server acknowledement 76-- gets server acknowledement
77local function recv_ack(con) 77local 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")
80end 80end
81 81
82-- sends client acknowledement 82-- sends client acknowledement
@@ -166,7 +166,7 @@ local function send_hdr(con, control)
166end 166end
167 167
168local function send_control(con, control) 168local 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)
172end 172end
@@ -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
309end) 309end)