projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ZOOM_record_get: xml returns MARC XML instead of OAI MARC
[yaz-moved-to-github.git]
/
comstack
/
tcpip.c
diff --git
a/comstack/tcpip.c
b/comstack/tcpip.c
index
2d56db1
..
4abb057
100644
(file)
--- a/
comstack/tcpip.c
+++ b/
comstack/tcpip.c
@@
-2,7
+2,7
@@
* Copyright (c) 1995-2002, Index Data
* See the file LICENSE for details.
*
* Copyright (c) 1995-2002, Index Data
* See the file LICENSE for details.
*
- * $Id: tcpip.c,v 1.48 2002-09-10 20:56:34 adam Exp $
+ * $Id: tcpip.c,v 1.50 2002-09-25 12:37:07 adam Exp $
*/
#include <stdio.h>
*/
#include <stdio.h>
@@
-53,14
+53,8
@@
void *tcpip_straddr(COMSTACK h, const char *str);
#define TRC(X)
#endif
#define TRC(X)
#endif
-#if HAVE_SOCKLEN_T
-#define NET_LEN_T socklen_t
-#else
-#if GETPEERNAME_ACCEPTS_SIZE_T_FOR_THIRD_ARGUMENT
-#define NET_LEN_T size_t
-#else
-#define NET_LEN_T int
-#endif
+#ifndef YAZ_SOCKLEN_T
+#define YAZ_SOCKLEN_T int
#endif
/* this state is used for both SSL and straight TCP/IP */
#endif
/* this state is used for both SSL and straight TCP/IP */
@@
-316,7
+310,7
@@
int tcpip_connect(COMSTACK h, void *address)
return 1;
}
#else
return 1;
}
#else
- if (errno == EINPROGRESS)
+ if (yaz_errno() == EINPROGRESS)
{
h->event = CS_CONNECT;
h->state = CS_ST_CONNECTING;
{
h->event = CS_CONNECT;
h->state = CS_ST_CONNECTING;
@@
-459,7
+453,7
@@
int tcpip_listen(COMSTACK h, char *raddr, int *addrlen,
void *cd)
{
struct sockaddr_in addr;
void *cd)
{
struct sockaddr_in addr;
- NET_LEN_T len = sizeof(addr);
+ YAZ_SOCKLEN_T len = sizeof(addr);
TRC(fprintf(stderr, "tcpip_listen pid=%d\n", getpid()));
if (h->state != CS_ST_IDLE)
TRC(fprintf(stderr, "tcpip_listen pid=%d\n", getpid()));
if (h->state != CS_ST_IDLE)
@@
-474,10
+468,10
@@
int tcpip_listen(COMSTACK h, char *raddr, int *addrlen,
#ifdef WIN32
WSAGetLastError() == WSAEWOULDBLOCK
#else
#ifdef WIN32
WSAGetLastError() == WSAEWOULDBLOCK
#else
- errno == EWOULDBLOCK
+ yaz_errno() == EWOULDBLOCK
#ifdef EAGAIN
#if EAGAIN != EWOULDBLOCK
#ifdef EAGAIN
#if EAGAIN != EWOULDBLOCK
- || errno == EAGAIN
+ || yaz_errno() == EAGAIN
#endif
#endif
#endif
#endif
#endif
#endif
@@
-678,22
+672,22
@@
int tcpip_get(COMSTACK h, char **buf, int *bufsize)
else
return -1;
#else
else
return -1;
#else
- if (errno == EWOULDBLOCK
+ if (yaz_errno() == EWOULDBLOCK
#ifdef EAGAIN
#if EAGAIN != EWOULDBLOCK
#ifdef EAGAIN
#if EAGAIN != EWOULDBLOCK
- || errno == EAGAIN
+ || yaz_errno() == EAGAIN
#endif
#endif
#endif
#endif
- || errno == EINPROGRESS
+ || yaz_errno() == EINPROGRESS
#ifdef __sun__
#ifdef __sun__
- || errno == ENOENT /* Sun's sometimes set errno to this */
+ || yaz_errno() == ENOENT /* Sun's sometimes set errno to this */
#endif
)
{
h->io_pending = CS_WANT_READ;
break;
}
#endif
)
{
h->io_pending = CS_WANT_READ;
break;
}
- else if (errno == 0)
+ else if (yaz_errno() == 0)
continue;
else
return -1;
continue;
else
return -1;
@@
-853,10
+847,10
@@
int tcpip_put(COMSTACK h, char *buf, int size)
#ifdef WIN32
WSAGetLastError() == WSAEWOULDBLOCK
#else
#ifdef WIN32
WSAGetLastError() == WSAEWOULDBLOCK
#else
- errno == EWOULDBLOCK
+ yaz_errno() == EWOULDBLOCK
#ifdef EAGAIN
#if EAGAIN != EWOULDBLOCK
#ifdef EAGAIN
#if EAGAIN != EWOULDBLOCK
- || errno == EAGAIN
+ || yaz_errno() == EAGAIN
#endif
#endif
#endif
#endif
#endif
#endif
@@
-974,7
+968,7
@@
char *tcpip_addrstr(COMSTACK h)
struct sockaddr_in addr;
tcpip_state *sp = (struct tcpip_state *)h->cprivate;
char *r, *buf = sp->buf;
struct sockaddr_in addr;
tcpip_state *sp = (struct tcpip_state *)h->cprivate;
char *r, *buf = sp->buf;
- NET_LEN_T len;
+ YAZ_SOCKLEN_T len;
struct hostent *host;
len = sizeof(addr);
struct hostent *host;
len = sizeof(addr);