X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fconnection.c;h=9a152b0901c77374a0229f9d38c51622c9c14138;hb=18701a2fcad5171b03a76ceda18702831eb90850;hp=149709a677cb5d239044a5a3ab74b519c828dca0;hpb=2058959fc0a6888b55f23586cd3f1d173b2a46b5;p=pazpar2-moved-to-github.git diff --git a/src/connection.c b/src/connection.c index 149709a..9a152b0 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1,7 +1,5 @@ -/* $Id: connection.c,v 1.11 2007-08-28 21:11:21 quinn Exp $ - Copyright (c) 2006-2007, Index Data. - -This file is part of Pazpar2. +/* This file is part of Pazpar2. + Copyright (C) 2006-2008 Index Data Pazpar2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -14,30 +12,43 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with Pazpar2; see the file LICENSE. If not, write to the -Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. - */ +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ /** \file connection.c \brief Z39.50 connection (low-level client) */ +#if HAVE_CONFIG_H +#include +#endif + #include #include #include +#if HAVE_SYS_TIME_H #include +#endif +#if HAVE_UNISTD_H #include +#endif +#if HAVE_SYS_SOCKET_H #include +#endif +#ifdef WIN32 +#include +typedef int socklen_t; +#endif +#if HAVE_NETDB_H #include +#endif + #include #include #include -#if HAVE_CONFIG_H -#include "cconfig.h" -#endif - #include #include #include @@ -261,7 +272,7 @@ static void connection_handler(IOCHAN i, int event) else // we throw away response and go to idle mode { yaz_log(YLOG_DEBUG, "Ignoring result of expired operation"); - client_set_state(cl, Client_Idle); + client_set_state(cl, Client_Continue); } } /* if len==1 we do nothing but wait for more input */ @@ -477,8 +488,9 @@ int client_prep_connection(struct client *cl) else if (co->state == Conn_Open) { if (client_get_state(cl) == Client_Error - || client_get_state(cl) == Client_Disconnected) - client_set_state(cl, Client_Idle); + || client_get_state(cl) == Client_Disconnected + || client_get_state(cl) == Client_Idle) + client_set_state(cl, Client_Continue); iochan_setflag(co->iochan, EVENT_OUTPUT); } return 1;