X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Ftcpip.c;h=b992319ca2c12d4006206c6a260717ff8369cd79;hb=c81c923c94d47c16308d487de3431f5027059522;hp=2ef9dc2c054d047803e39fb6c48d22cec5b4b481;hpb=377e50914cd78d52e77032a3eaf8972f23b4e7b9;p=yaz-moved-to-github.git diff --git a/src/tcpip.c b/src/tcpip.c index 2ef9dc2..b992319 100644 --- a/src/tcpip.c +++ b/src/tcpip.c @@ -1,8 +1,6 @@ -/* - * Copyright (C) 1995-2007, Index Data ApS +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2008 Index Data * See the file LICENSE for details. - * - * $Id: tcpip.c,v 1.36 2007-10-09 06:00:56 adam Exp $ */ /** * \file tcpip.c @@ -46,9 +44,6 @@ #if HAVE_SYS_SOCKET_H #include #endif -#if HAVE_SYS_SELECT_H -#include -#endif #if HAVE_SYS_WAIT_H #include #endif @@ -227,7 +222,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); @@ -723,7 +718,15 @@ int tcpip_listen(COMSTACK h, char *raddr, int *addrlen, ) h->cerrno = CSNODATA; else + { +#ifdef WIN32 + shutdown(h->iofile, SD_RECEIVE); +#else + shutdown(h->iofile, SHUT_RD); +#endif + listen(h->iofile, SOMAXCONN); h->cerrno = CSYSERR; + } return -1; } if (addrlen && (size_t) (*addrlen) >= sizeof(struct sockaddr_in)) @@ -823,9 +826,9 @@ COMSTACK tcpip_accept(COMSTACK h) state->ssl = SSL_new (state->ctx); SSL_set_fd (state->ssl, cnew->iofile); } +#endif state->connect_request_buf = 0; state->connect_response_buf = 0; -#endif h = cnew; } if (h->state == CS_ST_ACCEPT)