Add tcpsocket.

TODO:
 * check for getaddrinfo() in configure
 * fallback if getaddrinfo() is unavailable
This commit is contained in:
Jonathan Schleifer 2012-09-30 00:34:49 +02:00
parent 0452bfc9ef
commit c18e55e2ff
6 changed files with 198 additions and 4 deletions

View file

@ -46,11 +46,15 @@ ssize_t
cfw_stream_read(void *ptr, void *buf, size_t len)
{
CFWStream *stream = ptr;
ssize_t ret;
if (stream == NULL || stream->ops == NULL)
return -1;
return stream->ops->read(stream, buf, len);
if ((ret = stream->ops->read(stream, buf, len)) < -1)
ret = -1;
return ret;
}
bool