mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
* assuan-buffer.c (_assuan_read_line): Add output logging.
(assuan_write_line): Ditto. (_assuan_cookie_write_data): Ditto. (_assuan_cookie_write_flush): Ditto. * assuan-util.c (_assuan_log_print_buffer): New. (assuan_set_log_stream): New. (assuan_begin_confidential): New. (assuan_end_confidential): New. * assuan-defs.h: Add a few handler variables. * assuan-pipe-server.c (assuan_deinit_pipe_server): Removed. (deinit_pipe_server): New. (assuan_deinit_server): New. Changed all callers to use this. * assuan-listen.c (assuan_accept): Use the accept handler. * assuan-handler.c (process_request): Use the close Handler. * assuan-socket-server.c: New.
This commit is contained in:
parent
6af684c118
commit
f58da1883a
11 changed files with 311 additions and 19 deletions
|
@ -35,7 +35,9 @@ struct cmdtbl_s {
|
|||
struct assuan_context_s {
|
||||
AssuanError err_no;
|
||||
const char *err_str;
|
||||
int os_errno; /* last system error number used with certain error codes*/
|
||||
|
||||
int confidential;
|
||||
int is_server; /* set if this is context belongs to a server */
|
||||
int in_inquire;
|
||||
char *hello_line;
|
||||
|
@ -43,6 +45,8 @@ struct assuan_context_s {
|
|||
|
||||
void *user_pointer; /* for assuan_[gs]et_pointer () */
|
||||
|
||||
FILE *log_fp;
|
||||
|
||||
struct {
|
||||
int fd;
|
||||
int eof;
|
||||
|
@ -69,7 +73,12 @@ struct assuan_context_s {
|
|||
|
||||
int pipe_mode; /* We are in pipe mode, i.e. we can handle just one
|
||||
connection and must terminate then */
|
||||
pid_t pid; /* In pipe mode, the pid of the child server process. */
|
||||
pid_t pid; /* In pipe mode, the pid of the child server process. */
|
||||
int listen_fd; /* The fd we are listening on (used by socket servers) */
|
||||
|
||||
void (*deinit_handler)(ASSUAN_CONTEXT);
|
||||
int (*accept_handler)(ASSUAN_CONTEXT);
|
||||
int (*finish_handler)(ASSUAN_CONTEXT);
|
||||
|
||||
struct cmdtbl_s *cmdtbl;
|
||||
size_t cmdtbl_used; /* used entries */
|
||||
|
@ -85,8 +94,6 @@ struct assuan_context_s {
|
|||
int input_fd; /* set by INPUT command */
|
||||
int output_fd; /* set by OUTPUT command */
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -115,6 +122,8 @@ void _assuan_free (void *p);
|
|||
|
||||
#define set_error(c,e,t) assuan_set_error ((c), ASSUAN_ ## e, (t))
|
||||
|
||||
void _assuan_log_print_buffer (FILE *fp, const void *buffer, size_t length);
|
||||
|
||||
|
||||
#endif /*ASSUAN_DEFS_H*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue