X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Ftcpip.c;h=0e31fc6274becb128c2b010b1c5e3fd8b5427bfb;hb=b8d0ce914a074e4c6769d7f4d5f75b2f50c070c1;hp=b1f9fa9f6ca944506491bb831a2c144e9b773ebb;hpb=29cc293e92725df0aaf70fa4897600597dd8db9b;p=yaz-moved-to-github.git diff --git a/src/tcpip.c b/src/tcpip.c index b1f9fa9..0e31fc6 100644 --- a/src/tcpip.c +++ b/src/tcpip.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: tcpip.c,v 1.35 2007-10-07 08:53:26 adam Exp $ + * $Id: tcpip.c,v 1.38 2007-11-30 11:44:47 adam Exp $ */ /** * \file tcpip.c @@ -46,9 +46,6 @@ #if HAVE_SYS_SOCKET_H #include #endif -#if HAVE_SYS_SELECT_H -#include -#endif #if HAVE_SYS_WAIT_H #include #endif @@ -104,7 +101,7 @@ typedef struct tcpip_state int written; /* -1 if we aren't writing */ int towrite; /* to verify against user input */ - int (*complete)(const unsigned char *buf, int len); /* length/comple. */ + int (*complete)(const char *buf, int len); /* length/complete. */ #if HAVE_GETADDRINFO struct addrinfo *ai; #else @@ -227,7 +224,7 @@ COMSTACK yaz_tcpip_create(int s, int flags, int protocol, if (connect_host) { tcpip_state *sp = (tcpip_state *) p->cprivate; - sp->connect_request_buf = xmalloc(strlen(connect_host) + 30); + sp->connect_request_buf = (char *) xmalloc(strlen(connect_host) + 30); sprintf(sp->connect_request_buf, "CONNECT %s HTTP/1.0\r\n\r\n", connect_host); sp->connect_request_len = strlen(sp->connect_request_buf); @@ -409,8 +406,7 @@ int tcpip_more(COMSTACK h) { tcpip_state *sp = (tcpip_state *)h->cprivate; - return sp->altlen && (*sp->complete)((unsigned char *) sp->altbuf, - sp->altlen); + return sp->altlen && (*sp->complete)(sp->altbuf, sp->altlen); } /* @@ -895,7 +891,7 @@ int tcpip_get(COMSTACK h, char **buf, int *bufsize) sp->altsize = tmpi; } h->io_pending = 0; - while (!(berlen = (*sp->complete)((unsigned char *)*buf, hasread))) + while (!(berlen = (*sp->complete)(*buf, hasread))) { if (!*bufsize) { @@ -1026,7 +1022,7 @@ int ssl_get(COMSTACK h, char **buf, int *bufsize) sp->altsize = tmpi; } h->io_pending = 0; - while (!(berlen = (*sp->complete)((unsigned char *)*buf, hasread))) + while (!(berlen = (*sp->complete)(*buf, hasread))) { if (!*bufsize) {