cURL / Mailing Lists / curl-library / Single Mail

curl-library

Piping Telnet

From: Will Dean <will_at_willscorner.net>
Date: Mon, 23 Jun 2008 10:54:29 -0400

Hi,

I am trying to use libcurl to handle the telnet session when polling
ARP tables off a device. Since libcurl doesn't have any sort of
callback functions for telnet I had to spawn it in a child and
redirect both stdin and stdout.

I have no trouble writing to the libcurl/the session but when
attempting to read() I get blocking of some sort if I try to write
post read().

write()
write()
....
read()

will work.

write()
write()
....
read()
write()

will block.

write()
write()
....
read()
read()

will block (I think this is normal as there is zero).

I have tried my code without libcurl in the child and it doesn't seem
to happen. Any thoughts? Could libcurl be buffering the data?

I've posted the code here - http://willscorner.net/tmp_email_attachments/pipetest.c

Thanks!
-------------------------------
Will Dean
will_at_willscorner.net
XMPP: will_at_willscorner.net
+12024706679
Received on 2008-06-23