From b29e199ffdd108c0d207c9ec26038f747b994401 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 24 Feb 2009 15:24:58 +0000 Subject: Add hack for the inquiry feature. --- AUTHORS | 3 ++- doc/assuan.texi | 4 +++- src/ChangeLog | 5 +++++ src/assuan-buffer.c | 7 +++++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/AUTHORS b/AUTHORS index 7ac4415..42bb79d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,7 +2,8 @@ Package: libassuan Maintainer: Werner Koch Bug reports: gnupg-devel@gnupg.org Security related bug reports: security@gnupg.org -License: LGPLv2.1+ +License (library): LGPLv2.1+ +License (manual): GPLv3+ Werner Koch diff --git a/doc/assuan.texi b/doc/assuan.texi index 479d4bb..b0c0451 100644 --- a/doc/assuan.texi +++ b/doc/assuan.texi @@ -247,7 +247,9 @@ Request could not be fulfilled. The error codes are mostly application specific except for a few common ones. @item S @var{keyword} -Informational output by the server, still processing the request. +Informational output by the server, still processing the request. A +client may not send such lines to the server while processing an Inquiry +command. @item # Comment line issued only for debugging purposes. Totally ignored. diff --git a/src/ChangeLog b/src/ChangeLog index 210b53c..3d875fb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-02-24 Werner Koch + + * assuan-buffer.c (assuan_send_data): Add hack to optionally send + a final "CAN". + 2008-11-03 Marcus Brinkmann * assuan-handler.c (std_handler_help): Make I unsigned to silence diff --git a/src/assuan-buffer.c b/src/assuan-buffer.c index 3968584..b9e3572 100644 --- a/src/assuan-buffer.c +++ b/src/assuan-buffer.c @@ -507,6 +507,9 @@ _assuan_cookie_write_flush (void *cookie) * a INQUIRE response. However, when assuan_transact() is used, this * function takes care of sending END itself. * + * If BUFFER is NULL and LENGTH is 1 and we are a client, a "CAN" is + * send instead of an "END". + * * Return value: 0 on success or an error code **/ @@ -515,7 +518,7 @@ assuan_send_data (assuan_context_t ctx, const void *buffer, size_t length) { if (!ctx) return _assuan_error (ASSUAN_Invalid_Value); - if (!buffer && length) + if (!buffer && length > 1) return _assuan_error (ASSUAN_Invalid_Value); if (!buffer) @@ -524,7 +527,7 @@ assuan_send_data (assuan_context_t ctx, const void *buffer, size_t length) if (ctx->outbound.data.error) return ctx->outbound.data.error; if (!ctx->is_server) - return assuan_write_line (ctx, "END"); + return assuan_write_line (ctx, length == 1? "CAN":"END"); } else { -- cgit v1.2.3