eclient now passes NULL for 555 responses rather than calling the
authorRichard Kettlewell <rjk@greenend.org.uk>
Fri, 18 Apr 2008 21:30:17 +0000 (22:30 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Fri, 18 Apr 2008 21:30:17 +0000 (22:30 +0100)
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.

lib/eclient.c
lib/eclient.h

index 4f13558..78f94bd 100644 (file)
@@ -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)
index c03d9e5..5d57f3f 100644 (file)
@@ -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 */