From 498be7bfa621513f2dccc36b1ad35efb50634b25 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 14 Jan 2004 20:28:55 +0000 Subject: (_assuan_cookie_write_data): Return the requested size to indicate successful operation. Fixes a spurious bug we previously fixed using fflush(). --- NEWS | 2 ++ src/ChangeLog | 11 +++++++++++ src/assuan-buffer.c | 7 ++++--- src/assuan.h | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 46ec63b..550ca2b 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ Noteworthy changes in version 0.6.3 (unreleased) ------------------------------------------------ + * Fixed a data corruption bug in assuan_get_data_fp. + Noteworthy changes in version 0.6.2 (2003-12-18) ------------------------------------------------ diff --git a/src/ChangeLog b/src/ChangeLog index 2b2f768..e31da5c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2004-01-14 Werner Koch + + * assuan-buffer.c (_assuan_cookie_write_data): Return the + requested size to indicate successful operation. Fixes a spurious + bug we previously fixed using fflush(). + +2003-12-22 Werner Koch + + * assuan.h (ASSUAN_Locale_Problem): Added. + * assuan-errors.c (assuan_strerror): Ditto. + 2003-12-18 Werner Koch * assuan.h (AssuanCommand): Clarified that these are now diff --git a/src/assuan-buffer.c b/src/assuan-buffer.c index 3684b3e..f049ba4 100644 --- a/src/assuan-buffer.c +++ b/src/assuan-buffer.c @@ -275,9 +275,10 @@ assuan_write_line (ASSUAN_CONTEXT ctx, const char *line) /* Write out the data in buffer as datalines with line wrapping and percent escaping. This fucntion is used for GNU's custom streams */ int -_assuan_cookie_write_data (void *cookie, const char *buffer, size_t size) +_assuan_cookie_write_data (void *cookie, const char *buffer, size_t orig_size) { ASSUAN_CONTEXT ctx = cookie; + size_t size = orig_size; char *line; size_t linelen; @@ -344,12 +345,12 @@ _assuan_cookie_write_data (void *cookie, const char *buffer, size_t size) } ctx->outbound.data.linelen = linelen; - return 0; + return (int)orig_size; } /* Write out any buffered data - This fucntion is used for GNU's custom streams */ + This function is used for GNU's custom streams */ int _assuan_cookie_write_flush (void *cookie) { diff --git a/src/assuan.h b/src/assuan.h index 9b72812..3da9b31 100644 --- a/src/assuan.h +++ b/src/assuan.h @@ -80,7 +80,7 @@ typedef enum ASSUAN_Unexpected_Status = 124, ASSUAN_Unexpected_Data = 125, ASSUAN_Invalid_Status = 126, - + ASSUAN_Locale_Problem = 127, ASSUAN_Not_Confirmed = 128, /* Warning: Don't use the rror codes, below they are deprecated. */ -- cgit v1.2.3