summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2346d7d)
more cases for tcpip_get (was unset before).
* Copyright (C) 1995-2006, Index Data ApS
* See the file LICENSE for details.
*
* Copyright (C) 1995-2006, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: tcpip.c,v 1.26 2006-09-01 11:27:20 adam Exp $
+ * $Id: tcpip.c,v 1.27 2006-09-01 12:42:31 adam Exp $
TRC(fprintf(stderr, " recv res=%d, hasread=%d\n", res, hasread));
if (res < 0)
{
TRC(fprintf(stderr, " recv res=%d, hasread=%d\n", res, hasread));
if (res < 0)
{
- TRC(fprintf(stderr, " recv errno=%d, (%s)\n", yaz_errno(),
+ TRC(fprintf(stderr, " recv errno=%d, (%s)\n", yaz_errno(),
strerror(yaz_errno())));
#ifdef WIN32
if (WSAGetLastError() == WSAEWOULDBLOCK)
strerror(yaz_errno())));
#ifdef WIN32
if (WSAGetLastError() == WSAEWOULDBLOCK)
+ {
+ h->cerrno = CSYSERR;
#else
if (yaz_errno() == EWOULDBLOCK
#ifdef EAGAIN
#else
if (yaz_errno() == EWOULDBLOCK
#ifdef EAGAIN
else if (yaz_errno() == 0)
continue;
else
else if (yaz_errno() == 0)
continue;
else
+ {
+ h->cerrno = CSYSERR;
if (!sp->altbuf)
{
if (!(sp->altbuf = (char *)xmalloc(sp->altsize = req)))
if (!sp->altbuf)
{
if (!(sp->altbuf = (char *)xmalloc(sp->altsize = req)))
+ {
+ h->cerrno = CSYSERR;
} else if (sp->altsize < req)
if (!(sp->altbuf =(char *)xrealloc(sp->altbuf, sp->altsize = req)))
} else if (sp->altsize < req)
if (!(sp->altbuf =(char *)xrealloc(sp->altbuf, sp->altsize = req)))
+ {
+ h->cerrno = CSYSERR;
TRC(fprintf(stderr, " Moving %d bytes to altbuf(0x%x)\n", tomove,
(unsigned) sp->altbuf));
memcpy(sp->altbuf, *buf + berlen, sp->altlen = tomove);
TRC(fprintf(stderr, " Moving %d bytes to altbuf(0x%x)\n", tomove,
(unsigned) sp->altbuf));
memcpy(sp->altbuf, *buf + berlen, sp->altlen = tomove);
unsigned long flag;
#ifdef WIN32
unsigned long flag;
#ifdef WIN32
+ flag = blocking ? 0 : 1;
if (ioctlsocket(p->iofile, FIONBIO, &flag) < 0)
return 0;
#else
if (ioctlsocket(p->iofile, FIONBIO, &flag) < 0)
return 0;
#else