From: Adam Dickmeiss Date: Tue, 9 Dec 2003 17:13:35 +0000 (+0000) Subject: Fixed bad memory reference - when bad SRW/HTTP response was received X-Git-Tag: YAZ.2.0.7~4 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=e323a843d06898d46d0aaac39d345bdd560c0c59;p=yaz-moved-to-github.git Fixed bad memory reference - when bad SRW/HTTP response was received --- diff --git a/client/client.c b/client/client.c index 841ba06..4fddacf 100644 --- a/client/client.c +++ b/client/client.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2003, Index Data * See the file LICENSE for details. * - * $Id: client.c,v 1.213 2003-11-19 19:06:41 adam Exp $ + * $Id: client.c,v 1.214 2003-12-09 17:13:35 adam Exp $ */ #include @@ -3338,17 +3338,20 @@ static void http_response(Z_HTTP_Response *hres) } close_session(); } - if (!strcmp(hres->version, "1.0")) - { - /* HTTP 1.0: only if Keep-Alive we stay alive.. */ - if (!connection_head || strcmp(connection_head, "Keep-Alive")) - close_session(); - } - else + else { - /* HTTP 1.1: only if no close we stay alive .. */ - if (connection_head && !strcmp(connection_head, "close")) - close_session(); + if (!strcmp(hres->version, "1.0")) + { + /* HTTP 1.0: only if Keep-Alive we stay alive.. */ + if (!connection_head || strcmp(connection_head, "Keep-Alive")) + close_session(); + } + else + { + /* HTTP 1.1: only if no close we stay alive .. */ + if (connection_head && !strcmp(connection_head, "close")) + close_session(); + } } } #endif