From 0e443305d04f09a42d8ad0a9196d841bab4955a8 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Tue, 10 Nov 2009 09:04:50 +0000 Subject: 2009-11-10 Marcus Brinkmann * assuan-defs.h (struct assuan_context_s): Rename CTX->process_done to CTX->process_complete for clarity. Remove buffer variables from UDS. * assuan-pipe-connect.c (socketpair_connect): Allow FD_CHILD_LIST to be NULL. * assuan-handler.c: Rename CTX->process_done to CTX->process_complete for clarity. (process_request, process_next): Handle EOF. * assuan-uds.c (uds_reader): Remove buffering, which breaks the pending line algorithm in assuan-buffer.c. (_assuan_init_uds_io, _assuan_uds_deinit): Remove buffering. * assuan-buffer.c (_assuan_read_line): Add comment. --- src/assuan-buffer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/assuan-buffer.c') diff --git a/src/assuan-buffer.c b/src/assuan-buffer.c index 32a9aee..8dac4fb 100644 --- a/src/assuan-buffer.c +++ b/src/assuan-buffer.c @@ -79,6 +79,7 @@ readline (assuan_context_t ctx, char *buf, size_t buflen, *r_eof = 1; break; /* allow incomplete lines */ } + p = buf; nleft -= n; buf += n; @@ -88,7 +89,6 @@ readline (assuan_context_t ctx, char *buf, size_t buflen, if (p) break; /* at least one full line available - that's enough for now */ } - return 0; } @@ -142,7 +142,9 @@ _assuan_read_line (assuan_context_t ctx) if (saved_errno == EAGAIN) { - /* We have to save a partial line. */ + /* We have to save a partial line. Due to readline's + behaviour, we know that this is not a complete line yet + (no newline). So we don't set PENDING to true. */ memcpy (ctx->inbound.attic.line, line, atticlen + nread); ctx->inbound.attic.pending = 0; ctx->inbound.attic.linelen = atticlen + nread; @@ -253,6 +255,7 @@ assuan_read_line (assuan_context_t ctx, char **line, size_t *linelen) *line = ctx->inbound.line; *linelen = ctx->inbound.linelen; + return err; } -- cgit v1.2.3