<tankf33der>
Via envs.net infrastructure. Main feature - always connected. And i dont need always keep browser open on irccloud to keep session active.
<Regenaxer>
Nice
orivej has joined #picolisp
_whitelogger has joined #picolisp
casaca has quit [*.net *.split]
Nistur has quit [*.net *.split]
casaca has joined #picolisp
Nistur has joined #picolisp
rob_w has quit [Ping timeout: 246 seconds]
<tankf33der>
calling curl as https client and reading from pipe
<tankf33der>
sometimes exits with error
<tankf33der>
(23) Failed writing body
<beneroth>
curl has an argument to enable a log into a file
<beneroth>
maybe turn this on, and on success you delete the log file afterwards, on fail you keep it to inspect
<beneroth>
e.g. use --stderr option
rob_w has joined #picolisp
<beneroth>
or if you can replicate, use --verbose to get more details
<beneroth>
<tankf33der> (23) Failed writing body
<tankf33der>
cant repeat on latest, installing debian
<beneroth>
first find out if that refers to the body when sending (when you do HTTP POST) or reading the response
<beneroth>
I have an API client which uses curl wrapped in pil, I always let the HTTP body/response go into a file with the "-o" output option
<beneroth>
and then I read & validate the output file in a next step
<beneroth>
(maybe a bit slower, but more resilient and easier to debug)
<beneroth>
(performance didn't matter so much in my use case, as the other end was faulty and slow anyway)
<beneroth>
hmm
<beneroth>
I'd guess it's not handling of expected error response but pipe timing issue
<beneroth>
I mean something like 'curl writes into the pipe buffer faster than pil reads"... should only block then and continue when there is space, but well..
<beneroth>
if performance is not critical, I would let curl output into a file and then read the file
<beneroth>
man curl says at the end
<beneroth>
" 23 Write error. Curl couldn't write data to a local filesystem or similar."
<beneroth>
sounds like that fits with my guess
<beneroth>
you probably could optimize the performance while using an -o output-file if you create this file previously as a unix/linux fifo-file
<tankf33der>
while true; do pil21 nestping.l -https && sleep 1 && echo "next"; done
<tankf33der>
this loop works for hours without errors
<beneroth>
ok
<beneroth>
then I know
<beneroth>
I guess then it fails if you leave the sleep 1 away, right?
<beneroth>
you create/close too many pipes in short time
<tankf33der>
but fails once under crontab, running hourly.
<tankf33der>
i just receiving error mail from cron once a day
<beneroth>
hmm
<tankf33der>
others 23 runs are ok
<beneroth>
must be some weird thing with the pipes
<tankf33der>
anyway pil21 works under latest debian.
<beneroth>
great!
<beneroth>
I've gotta go :\
<beneroth>
bbl
beneroth has quit [Quit: Leaving]
mmmattyx has joined #picolisp
<Regenaxer>
Perhaps "Failed writing body" means a pipe error?
<Regenaxer>
Exiting the while loop while curl still writes to the pipe
<Regenaxer>
If so, curl should ignore SIGPIPE, not sure if there is an option
rob_w has quit [Remote host closed the connection]
emacsoma1 has quit [Quit: WeeChat 3.0]
emacsomancer has joined #picolisp
<tankf33der>
It fails only sometimes, not always
<Regenaxer>
yes, race condition
<Regenaxer>
two processes in the pipe
<Regenaxer>
the reader finishes before the writer
<Regenaxer>
perhaps exits because it finds a result early in th data
<Regenaxer>
Or curl hangs for a moment for some reason