X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fseshigh.c;h=2a3fc2fb7eb8e3102d00205e63780461d20d6bf8;hb=32687c1504015e0675d49983707576f8db9b7bfc;hp=261b617f74448e767d6ab813300f6dfcce9c2afc;hpb=4cadb168b5477478ceea77aa53364c54e6b3cfba;p=yaz-moved-to-github.git diff --git a/src/seshigh.c b/src/seshigh.c index 261b617..2a3fc2f 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: seshigh.c,v 1.95 2006-07-31 12:15:02 adam Exp $ + * $Id: seshigh.c,v 1.96 2006-08-24 13:25:45 adam Exp $ */ /** * \file seshigh.c @@ -340,7 +340,7 @@ void ir_session(IOCHAN h, int event) } assoc->cs_get_mask = EVENT_INPUT; if ((res = cs_get(conn, &assoc->input_buffer, - &assoc->input_buffer_len)) <= 0) + &assoc->input_buffer_len)) == 0) { yaz_log(log_sessiondetail, "Connection closed by client"); cs_close(conn); @@ -348,6 +348,15 @@ void ir_session(IOCHAN h, int event) iochan_destroy(h); return; } + else if (res < 0) + { + yaz_log(log_session, "Connection error: %s", + cs_errmsg(cs_errno(conn))); + req = request_get(&assoc->incoming); /* get a new request */ + do_close_req(assoc, Z_Close_protocolError, + "Incoming package too large", req); + return; + } else if (res == 1) /* incomplete read - wait for more */ { if (conn->io_pending & CS_WANT_WRITE) @@ -378,7 +387,7 @@ void ir_session(IOCHAN h, int event) yaz_log(YLOG_WARN, "PDU dump:"); odr_dumpBER(yaz_log_file(), assoc->input_buffer, res); request_release(req); - do_close(assoc, Z_Close_protocolError,"Malformed package"); + do_close(assoc, Z_Close_protocolError, "Malformed package"); } else { @@ -2317,7 +2326,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) assoc->init->implementation_name, odr_prepend(assoc->encode, "GFS", resp->implementationName)); - version = odr_strdup(assoc->encode, "$Revision: 1.95 $"); + version = odr_strdup(assoc->encode, "$Revision: 1.96 $"); if (strlen(version) > 10) /* check for unexpanded CVS strings */ version[strlen(version)-2] = '\0'; resp->implementationVersion = odr_prepend(assoc->encode,