From 1bd1b63c0e407352151e55894b4c185556e0b87d Mon Sep 17 00:00:00 2001 Message-Id: <1bd1b63c0e407352151e55894b4c185556e0b87d.1715355586.git.mdw@distorted.org.uk> From: Mark Wooding Date: Fri, 18 Apr 2008 22:30:17 +0100 Subject: [PATCH] eclient now passes NULL for 555 responses rather than calling the error callback. This is actually rather more convenient in reality. The only place where this matters already has a workaroud to translate errors back into null values. That isn't removed, but should be some time. Organization: Straylight/Edgeware From: Richard Kettlewell --- lib/eclient.c | 6 ++++-- lib/eclient.h | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/eclient.c b/lib/eclient.c index 4f13558..78f94bd 100644 --- a/lib/eclient.c +++ b/lib/eclient.c @@ -841,9 +841,11 @@ static void stash_command(disorder_eclient *c, static void string_response_opcallback(disorder_eclient *c, struct operation *op) { D(("string_response_callback")); - if(c->rc / 100 == 2) { + if(c->rc / 100 == 2 || c->rc == 555) { if(op->completed) { - if(c->protocol >= 2) { + if(c->rc == 555) + ((disorder_eclient_string_response *)op->completed)(op->v, NULL); + else if(c->protocol >= 2) { char **rr = split(c->line + 4, 0, SPLIT_QUOTES, 0, 0); if(rr && *rr) diff --git a/lib/eclient.h b/lib/eclient.h index c03d9e5..5d57f3f 100644 --- a/lib/eclient.h +++ b/lib/eclient.h @@ -141,8 +141,14 @@ struct sink; typedef void disorder_eclient_no_response(void *v); /* completion callback with no data */ +/** @brief String result completion callback + * @param v User data + * @param value or NULL + * + * @p value can be NULL for disorder_eclient_get(), + * disorder_eclient_get_global() and disorder_eclient_userinfo(). + */ typedef void disorder_eclient_string_response(void *v, const char *value); -/* completion callback with a string result */ typedef void disorder_eclient_integer_response(void *v, long value); /* completion callback with a integer result */ -- [mdw]