From 62ef2216d2c7c1c563ea163e2a0fdacccb54e31e Mon Sep 17 00:00:00 2001 Message-Id: <62ef2216d2c7c1c563ea163e2a0fdacccb54e31e.1714254350.git.mdw@distorted.org.uk> From: Mark Wooding Date: Fri, 28 Dec 2007 16:13:46 +0000 Subject: [PATCH] cgi: more graceful error handling in absence of server Organization: Straylight/Edgeware From: rjk@greenend.org.uk <> --- lib/client.c | 4 ++++ tests/cookie.py | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/client.c b/lib/client.c index dc1d44e..1dac922 100644 --- a/lib/client.c +++ b/lib/client.c @@ -165,6 +165,10 @@ static int disorder_simple_v(disorder_client *c, const char *arg; struct dynstr d; + if(!c->fpout) { + error(0, "not connected to server"); + return -1; + } if(cmd) { dynstr_init(&d); dynstr_append_string(&d, cmd); diff --git a/tests/cookie.py b/tests/cookie.py index c0b71e0..8a91829 100755 --- a/tests/cookie.py +++ b/tests/cookie.py @@ -29,6 +29,7 @@ def test(): v = c.version() print " getting cookie" k = c.make_cookie() + print " cookie value is %s" % k print " connecting with cookie" c = disorder.client() c.connect(k) -- [mdw]