diff options
| author | Werner Koch <[email protected]> | 2001-12-13 15:04:36 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2001-12-13 15:04:36 +0000 |
| commit | 3de2384ea5ae8b542c0d6654ceca3b8f473d2f9f (patch) | |
| tree | aa13c8812fe6c65ca6db924dd7f0de6c5b70ec8a /assuan/assuan-listen.c | |
| parent | *** empty log message *** (diff) | |
| download | gpgme-3de2384ea5ae8b542c0d6654ceca3b8f473d2f9f.tar.gz gpgme-3de2384ea5ae8b542c0d6654ceca3b8f473d2f9f.zip | |
Updated Assuan to the current version
Diffstat (limited to 'assuan/assuan-listen.c')
| -rw-r--r-- | assuan/assuan-listen.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/assuan/assuan-listen.c b/assuan/assuan-listen.c index f8ccb270..822ef32c 100644 --- a/assuan/assuan-listen.c +++ b/assuan/assuan-listen.c @@ -25,6 +25,28 @@ #include "assuan-defs.h" +AssuanError +assuan_set_hello_line (ASSUAN_CONTEXT ctx, const char *line) +{ + if (!ctx) + return ASSUAN_Invalid_Value; + if (!line) + { + xfree (ctx->hello_line); + ctx->hello_line = NULL; + } + else + { + char *buf = xtrymalloc (3+strlen(line)+1); + if (!buf) + return ASSUAN_Out_Of_Core; + strcpy (buf, "OK "); + strcpy (buf+3, line); + xfree (ctx->hello_line); + ctx->hello_line = buf; + } + return 0; +} /** @@ -38,7 +60,7 @@ * Return value: 0 on success or an error if the connection could for * some reason not be established. **/ -int +AssuanError assuan_accept (ASSUAN_CONTEXT ctx) { int rc; @@ -57,9 +79,8 @@ assuan_accept (ASSUAN_CONTEXT ctx) } /* send the hello */ - - rc = _assuan_write_line (ctx, - "OK Hello dear client - what can I do for you?"); + rc = assuan_write_line (ctx, ctx->hello_line? ctx->hello_line + : "OK Your orders please"); if (rc) return rc; @@ -70,6 +91,7 @@ assuan_accept (ASSUAN_CONTEXT ctx) } + int assuan_get_input_fd (ASSUAN_CONTEXT ctx) { |
