diff options
author | Marcus Brinkmann <mb@g10code.com> | 2009-11-10 09:04:50 +0000 |
---|---|---|
committer | Marcus Brinkmann <mb@g10code.com> | 2009-11-10 09:04:50 +0000 |
commit | 0e443305d04f09a42d8ad0a9196d841bab4955a8 (patch) | |
tree | f226b96130900cf5a40b89382561467de56b26fd /src/assuan-buffer.c | |
parent | 420da928a39d1e296fb74c0ba3a023a889a082bf (diff) | |
download | libassuan-0e443305d04f09a42d8ad0a9196d841bab4955a8.tar.gz |
2009-11-10 Marcus Brinkmann <marcus@g10code.de>
* 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.
Diffstat (limited to 'src/assuan-buffer.c')
-rw-r--r-- | src/assuan-buffer.c | 7 |
1 files changed, 5 insertions, 2 deletions
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; } |