# HG changeset patch # User Timo Sirainen # Date 1265116705 -7200 # Node ID 5e50d5597474f62b415b5af24ad202a92461fdd4 # Parent 9a5f3e3b01973b6f4d2dbb90e56e0b7e751fbc07 dict proxy: Iteration failure wasn't passed to dict client. diff -r 9a5f3e3b0197 -r 5e50d5597474 src/dict/dict-commands.c --- a/src/dict/dict-commands.c Tue Feb 02 15:00:15 2010 +0200 +++ b/src/dict/dict-commands.c Tue Feb 02 15:18:25 2010 +0200 @@ -70,7 +70,12 @@ /* finished iterating */ o_stream_unset_flush_callback(conn->output); dict_iterate_deinit(&conn->iter_ctx); - o_stream_send(conn->output, "\n", 1); + + str_truncate(str, 0); + if (ret < 0) + str_append_c(str, DICT_PROTOCOL_REPLY_FAIL); + str_append_c(str, '\n'); + o_stream_send(conn->output, str_data(str), str_len(str)); } o_stream_uncork(conn->output); return ret <= 0 ? 1 : 0; diff -r 9a5f3e3b0197 -r 5e50d5597474 src/lib-dict/dict-client.c --- a/src/lib-dict/dict-client.c Tue Feb 02 15:00:15 2010 +0200 +++ b/src/lib-dict/dict-client.c Tue Feb 02 15:18:25 2010 +0200 @@ -517,10 +517,16 @@ /* line contains key \t value */ p_clear(ctx->pool); - if (*line != DICT_PROTOCOL_REPLY_OK) + switch (*line) { + case DICT_PROTOCOL_REPLY_OK: + value = strchr(++line, '\t'); + break; + case DICT_PROTOCOL_REPLY_FAIL: + return -1; + default: value = NULL; - else - value = strchr(++line, '\t'); + break; + } if (value == NULL) { /* broken protocol */ i_error("dict client (%s) sent broken reply", dict->path);