summaryrefslogtreecommitdiff
path: root/src/assuan-buffer.c
Commit message (Collapse)AuthorAgeFilesLines
* w32: File handle passing to server is now supported.NIIBE Yutaka2023-05-171-2/+2
| | | | | | | | | * configure.ac: Fix for MinGW. * src/assuan-buffer.c (assuan_sendfd): Fix runtime check. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* Drop WindowsCE support.NIIBE Yutaka2022-08-311-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * contrib/*: Remove. * Makefile.am (EXTRA_DIST): Don't include contrib/. * configure.ac (HAVE_W32CE_SYSTEM): Remove. * src/gpgcedev.c: Remove. * src/gpgcedev.def: Remove. * src/gpgcemgr.c: Remove. * src/system-w32ce.c: Remove. * src/w32ce-add.h: Remove. * src/w32ce-fd-t.inc.h: Remove. * src/Makefile.am (EXTRA_DIST, parts_of_assuan_h, common_sources): Fix. * src/assuan-buffer.c [HAVE_W32CE_SYSTEM]: No conditionalize. * src/setenv.c [HAVE_W32CE_SYSTEM]: Likewise. * src/assuan-defs.h [HAVE_W32CE_SYSTEM]: Remove dependent part. * src/assuan-error.c [HAVE_W32CE_SYSTEM]: Likewise. * src/assuan-handler.c [HAVE_W32CE_SYSTEM]: Likewise. * src/assuan-socket.c [HAVE_W32CE_SYSTEM]: Likewise. * src/system.c [HAVE_W32CE_SYSTEM]: Likewise. * src/sysutils.c [HAVE_W32CE_SYSTEM]: Likewise. * tests/Makefile.am (EXTRA_DIST): Fix. (w32cetools): Remove. * tests/common.h [HAVE_W32CE_SYSTEM]: Remove dependent part. * tests/pipeconnect.c [HAVE_W32CE_SYSTEM]: Likewise. * tests/ce-createpipe.c: Remove. * tests/ce-server.c: Remove. -- GnuPG-bug-id: 6170 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* struct assuan_context_s: Move boolean fields to flags.NIIBE Yutaka2022-05-251-1/+1
| | | | | | | | | | | | | | | * src/assuan-defs.h (struct assuan_context_s): Move is_server, in_inquire, in_process_next, process_complete, in_command into flags. * src/assuan-buffer.c: Follow the change. * src/assuan-handler.c: Likewise. * src/assuan-inquire.c: Likewise. * src/assuan-pipe-server.c: Likewise. * src/assuan-socket-server.c: Likewise. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* server,client: Wipe the outbound buffer when CONFIDENTIAL.NIIBE Yutaka2022-05-251-0/+2
| | | | | | | | | * src/assuan-buffer.c (assuan_send_data): Wipe the buffer. -- GnuPG-bug-id: 5977 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* Add an SPDX tag to all core files.Werner Koch2017-11-151-16/+18
| | | | --
* Fix typos found by codespell.Justus Winter2015-12-011-1/+1
| | | | | -- Signed-off-by: Justus Winter <justus@g10code.com>
* Do not segv if NULL is passed for CTX in sendfd and receivefd.Werner Koch2015-06-261-0/+6
| | | | | | | | | | | * src/assuan-buffer.c (assuan_sendfd): Check that CTX is not NULL. (assuan_receivefd): Ditto. -- This change is to align the behaviour with that of assuan_send_data. Suggested-by: Andre Heinecke. Signed-off-by: Werner Koch <wk@gnupg.org>
* w32: Remove I/O delays due to our 100ms delay after an EAGAIN.Werner Koch2014-11-071-0/+9
| | | | | | | * src/system-w32.c (__assuan_read): Retry using select. Map WSAECONNRESET to EPIPE. (__assuan_write): Retry using select. * src/assuan-buffer.c (readline) [W32]: Return EOF instead of EPIPE.
* Make new functions also visible on non-W32.Werner Koch2012-01-251-15/+15
| | | | | | | * src/system-posix.c (__assuan_read, __assuan_write, __assuan_recvmsg) (__assuan_sendmsg, __assuan_waitpid): Make functions global. * src/libassuan.vers: Add above functions. * configure.ac: Set version to 2.1.0-git.
* 2010-11-01 Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>Marcus Brinkmann2010-11-011-0/+2
| | | | | | | | | | | | | | | * configure.ac: Check for fcntl.h. 2010-11-01 Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de> * assuan-socket.c, assuan-uds.c, system.c, assuan-pipe-server.c, assuan-pipe-connect.c [!HAVE_FCNTL_H]: Don't include fcntl.h. * assuan-buffer.c [!HAVE_W32CE_SYSTEM]: Do not include process.h. * assuan-socket.c [!HAVE_W32CE_SYSTEM]: Do not include io.h. * w32-includes.inc.h: Include winsock2.h before ws2tcpip.h. * sysutils.c (w32_read_registry): Replace goto label "leave" by "out" (as leave is defined by some Windows header file). * assuan-inquire.c: Likewise.
* Changes to allow building the CE version with MSC.Werner Koch2010-11-011-2/+4
|
* Cleaned up the loggingWerner Koch2010-03-111-79/+31
|
* Prepare for a port to WindowsCE.Werner Koch2010-01-221-1/+1
|
* Add comments.Marcus Brinkmann2010-01-051-2/+7
|
* 2009-11-10 Marcus Brinkmann <marcus@g10code.de>Marcus Brinkmann2009-11-101-2/+5
| | | | | | | | | | | | | | | | * 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.
* 2009-10-16 Marcus Brinkmann <marcus@g10code.de>Marcus Brinkmann2009-10-161-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * autogen.sh: Remove --with-pth-prefix from configure invocation. * configure.ac (_ASSUAN_IN_LIBASSUAN, PTH_SYSCALL_SOFT): Do not set anymore. (GNUPG_PATH_PTH): Don't invoke. (HAVE_PTH): Remove conditional. (LIBASSUAN_CONFIG_THREAD_MODULES): Removed. doc/ 2009-10-16 Marcus Brinkmann <marcus@g10code.com> * assuan.texi: Remove documentation for thread support. (assuan_pipe_connect_ext): Update prototype. src/ 2009-10-16 Marcus Brinkmann <marcus@g10code.com> * conversion.c: Do not include <sys/types.h> and <time.h>. * debug.h (TRACE_BEG6, TRACE4): New macros. (TRACE_SYSERR): Pass _assuan_trace_context to _assuan_debug. * context.c (assuan_set_pointer, assuan_get_pointer, assuan_set_flag, assuan_get_flag, assuan_set_io_monitor, assuan_set_error): Add trace messages. * libassuan-config.in, libassuan.m4, Makefile.am: Remove PTH support. * assuan.h (assuan_msghdr_t): New type. (ASSUAN_INVALID_PID): New macro. (ASSUAN_NO_FIXSIGNALS): New flag macro. (ASSUAN_SYSTEM_HOOKS_VERSION): New macro. (struct assuan_system_hooks, assuan_system_hooks_t): New types. (assuan_pipe_connect, assuan_pipe_connect_ext): Don't make ARGV const for name==NULL operation. Make fd_child_list an array of assuan_fd_t. (assuan_sock_init, assuan_sock_deinit, assuan_set_system_hooks, assuan_ctx_set_system_hooks, __assuan_pipe, __assuan_close, __assuan_spawn, __assuan_socketpair): New function prototypes. (_ASSUAN_SYSTEM_PTH_IMPL, ASSUAN_SYSTEM_PTH_DECL, ASSUAN_SYSTEM_PTH): New macros. (_assuan_system_pth): New declaration. * libassuan.vers, libassuan.defs: Add assuan_sock_init, assuan_sock_deinit, __assuan_pipe, __assuan_close, __assuan_spawn, __assuan_socketpair, assuan_set_system_hooks, assuan_ctx_set_system_hooks. * assuan-defs.h (struct assuan_io): Removed, move members to ... (struct assuan_context_s): ... this to ENGINE. New flag no_fixsignals. New member SYSTEM. Remove member IO. (_assuan_pipe, _assuan_read, _assuan_write, _assuan_recvmsg, _assuan_sendmsg, _assuan_spawn, _assuan_socketpair, _assuan_system_hooks, _assuan_system_hooks_copy): New declarations. (_assuan_error_is_eagain, _assuan_waitpid, _assuan_usleep, _assuan_close, _assuan_sock_new, _assuan_sock_connect, _assuan_sock_bind, _assuan_sock_get_nonce, _assuan_sock_check_nonce): Add context argument. (_assuan_io_read, _assuan_io_write, _assuan_simple_sendmsg, _assuan_simple_recvmsg): Removed. * context.c (assuan_ctx_set_system_hooks): New function. * assuan.c (assuan_set_system_hooks): New function. (assuan_new_ext): Initialize CTX->system. (assuan_release): Always output trace message. * assuan-error.c (_assuan_error_is_eagain): Add ctx argument, pass along to _assuan_usleep. * assuan-inquire.c assuan-listen.c, assuan-socket-server.c, assuan-handler.c, assuan-socket-connect.c, assuan-client.c, assuan-pipe-connect.c, assuan-socket.c: Pass CTX argument to functions that need it (_assuan_sock_new, _assuan_sock_check_none, _assuan_close, _assuan_error_is_eagain and many more). * assuan-socket-server.c (assuan_init_socket_server_ext): Update fields in CTX->engine instead of CTX->io. * assuan-socket-connect (assuan_socket_connect_ext): Likewise. * assuan-uds.c (uds_reader, uds_writer, uds_sendfd): Use _assuan_recvmsg and _assuan_sendmsg instead of _assuan_simple_recvmsg and _assuan_simple_sendmsg respectively. (_assuan_init_uds_io): Update fields in CTX->engine instead of CTX->io. * assuan-buffer.c: Use functions in CTX->engine instead of CTX->io. * assuan-pipe-server.c (assuan_init_pipe_server): Update fields in CTX->engine instead of CTX->io. * system.c: Include <sys/types.h>, <time.h>, <fcntl.h>, and <windows.h> resp. <sys/wait.h>. Define MAX_OPEN_FDS. (_assuan_system_hooks_copy, __assuan_usleep, _assuan_usleep, __assuan_pipe, _assuan_pipe, __assuan_close, _assuan_close, __assuan_read, _assuan_read, __assuan_write, _assuan_write, __assuan_recvmsg, _assuan_recvmsg, __assuan_sendmsg, _assuan_sendmsg, __assuan_spawn, _assuan_spawn, __assuan_waitpid, _assuan_waitpid, __assuan_socketpair, _assuan_socketpair): New functions. (_assuan_system_hooks): New singleton. * assuan-io.c (_assuan_waitpid, do_io_read, _assuan_io_read, do_io_write, _assuan_io_write, _assuan_simple_sendmsg, _assuan_simple_recvmsg, _assuan_usleep): Removed. * assuan-pipe-connect (writen, build_w32_commandline, create_inheritable_pipe): Removed (actually moved to system.c). (fix_signals) [_ASSUAN_NO_FIXED_SIGNALS]: Still fix signals. (do_finish): Move waitpid logic to _assuan_waitpid, just call that. (struct at_pipe_fork, struct at_socketpair_fork): New types. (at_pipe_fork_cb, at_socketpair_fork_cb): New callback functions. (pipe_connect_unix, pipe_connect_w32): Replaced by ... (pipe_connect): ... this new function using new system functions. (socketpair_connect): Reimplement to use new system functions. (assuan_pipe_connect, assuan_pipe_connect_ext): Add trace message. * assuan-socket.c (_assuan_close): Removed (moved to system.c). (_assuan_sock_new, _assuan_sock_connect, _assuan_sock_bind, _assuan_sock_get_nonce, _assuan_sock_check_nonce): Add context argument. Use new system interface. (sock_ctx): New singleton. (assuan_sock_init, assuan_sock_deinit): New functions to initialize and deinitialize the singleton.
* 2009-09-19 Marcus Brinkmann <marcus@g10code.de>Marcus Brinkmann2009-09-211-43/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tests/fdpassing.c: Update to new API. * configure.ac: Check for stdint.h and inttypes.h. Invoke AC_TYPE_UINTPTR_T. doc/ 2009-09-21 Marcus Brinkmann <marcus@g10code.de> * assuan.texi: Update to new API. src/ 2009-09-19 Marcus Brinkmann <marcus@g10code.de> * src/libassuan.vers, src/libassuan.def: Update to new API. * assuan.c, context.c, system.c, debug.c: New files. * Makefile.am (common_sources): Add assuan.c, context.c, system.c and debug.c. * assuan.h: Include <stdarg.h>. Fix inclusion of <gpg-error.h>. (_ASSUAN_EXT_SYM_PREFIX, _ASSUAN_PREFIX1, _ASSUAN_PREFIX2) (_ASSUAN_PREFIX): Remove support for renaming the whole library, now that we have a stable shared library interface that can evolve to cover all needs (particularly those of GPGME). (assuan_malloc_hooks, assuan_malloc_hooks_t, assuan_log_cb_t) (assuan_io_monitor_t): New types. (ASSUAN_LOG_INIT, ASSUAN_LOG_CTX, ASSUAN_LOG_ENGINE) (ASSUAN_LOG_DATA, ASSUAN_LOG_SYSIO, ASSUAN_IO_FROM_PEER) (ASSUAN_IO_TO_PEER, ASSUAN_IO_MONITOR_NOLOG) (ASSUAN_IO_MONITOR_IGNORE): New symbols. (assuan_set_gpg_err_source, assuan_get_gpg_err_source) (assuan_get_malloc_hooks, assuan_set_log_cb, assuan_get_log_cb) (assuan_new, assuan_new_ext, assuan_release): New function prototypes. (assuan_init_pipe_server, assuan_init_socket_server) (assuan_init_socket_server_ext, assuan_pipe_connect) (assuan_pipe_connect_ext, assuan_socket_connect) (assuan_socket_connect_ext): Take a context argument instead of pointer to context. (assuan_deinit_server, assuan_disconnect) (assuan_set_assuan_err_source): Remove function prototypes. * assuan-defs.h (ASSUAN_GCC_A_PURE): Moved here from XXX (_assuan_error): New macro. (struct assuan_context_s): New members err_source, w32_strerror, malloc_hooks, log_cb, log_cb_data: New members. Move confidential into flags. New member engine. (_assuan_log_handler, _assuan_error_default, _assuan_disconnect): New prototypes. (_assuan_new_context): Remove prototype. (_assuan_malloc, _assuan_calloc, _assuan_realloc, _assuan_free): Add context argument to prototype. * assuan-util.c (alloc_func, realloc_func, free_func): Remove global variables. (assuan_set_malloc_hooks, _assuan_malloc, _assuan_realloc) (_assuan_calloc, _assuan_free, assuan_set_pointer) (assuan_get_pointer, assuan_begin_confidential) (assuan_end_confidential, assuan_set_io_monitor, assuan_set_flag) (assuan_get_flag): Move functions to ... * assuan-client.c: Add ctx argument to all invocations of _assuan_error. * assuan-socket-server.c, assuan-socket-connect.c, assuan-connect.c: Likewise. * assuan-buffer.c: Likewise. Also update access to confidential flag. * assuan-uds.c: Add ctx argument to all invocations of _assuan_malloc, _assuan_realloc, _assuan_calloc, _assuan_free and _assuan_error. * assuan_listen.c, assuan-inquire.c, assuan-handler.c: Likewise. * assuan-error.c (err_source): Remove global variable. (assuan_set_assuan_err_source): Removed function. (_assuan_w32_strerror): Moved here from assuan-logging.c and made thread-safe. (_assuan_error): Removed function (is now macro). * assuan-handler.c: Update access to confidential flag. * assuan-socket-server.c (accept_connection_bottom): Update access to confidential flag in context. (assuan_init_socket_server, assuan_init_socket_server_ext): Take ctx argument instead of pointer to ctx. * assuan-inquire.c (init_membuf, put_membuf, get_membuf) (free_membuf): Take context argument and change all callers. * assuan-socket-server.c (assuan_socket_connect) (assuan_socket_connect_ext): Take ctx argument instead of pointer to ctx. * assuan-pipe-connect.c (initial_handshake, pipe_connect_unix) (socketpair_connect, assuan_pipe_connect) (assuan_pipe_connect_ext): Likewise. (socketpair_connect): Now that ctx is not a pointer argument anymore, return if we are server or client in the argv argument. * assuan-logging.c (_assuan_log_handler): New function. (_assuan_w32_strerror): Move to assuan-error.c * assuan-connect.c (assuan_disconnect): Renamed to ... (_assuan_disconnect): ... this. * assuan-pipe-server.c (_assuan_new_context): Removed function. (assuan_init_pipe_server): Take ctx argument instead of pointer to ctx. (_assuan_release_context): Removed function. (_assuan_deinit_server): Reimplement.
* doc/Marcus Brinkmann2009-09-011-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-09-01 Marcus Brinkmann <marcus@g10code.de> * assuan.texi: (External I/O Loop Server): Document assuan_process_done. (assuan_register_post_cmd_notify): Change type of ERR from int to gpg_error_t. (assuan_set_error): Likewise. (assuan_register_option_handler): Change types in callback handler from int to gpg_error_t. (assuan_inquire_ext): Likewise. src/ 2009-09-01 Marcus Brinkmann <marcus@g10code.de> * assuan.h: Change types in all functions from int to gpg_error_t where relevant. * assuan-listen.c (assuan_accept): Change type of RC from int to gpg_error_t. * assuan-pipe-server.c (accept_connection, finish_connection): Change return type to gpg_error_t. * assuan-socket-server.c (accept_connection_bottom) (accept_connection, finish_connection): Likewise. (assuan_init_connected_socket_server): Remove. * assuan-defs.h (struct assuan_context_s): Change return type of accept_handler and finish_handler to gpg_error_t. * assuan-pipe-connect.c (do_finish): Change to void. * assuan-inquire.c (_assuan_inquire_ext_cb): Change type of RC from int to gpg_error_t. * assuan-handler.c: Change return codes and RC variables from int to gpg_error_t where appropriate. * assuan-buffer.c (_assuan_read_line): Fix error code on EOF.
* 2009-08-26 Marcus Brinkmann <marcus@g10code.de>Marcus Brinkmann2009-08-261-41/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Test for versioned symbols support. (LIBASSUAN_LT_CURRENT, LIBASSUAN_LT_AGE) (LIBASSUAN_LT_REVISION): New, set to 0. (LIBASSUAN_CONFIG_API_VERSION): Bump to 2. (AC_CONFIG_MACRO_DIR, AC_DISABLE_STATIC, AC_LIBTOOL_WIN32_DLL) (AC_LIBTOOL_RC, AC_PROG_LIBTOOL, AM_PATH_GPG_ERROR): Invoke. (AC_PROG_RANLIB): Don't invoke. (HAVE_W32_SYSTEM): New AM conditional. (AC_CONFIG_FILES): Add src/versioninfo.rc. * ltmain.sh, m4/libtool.m4, m4/ltoptions.m4, m4/ltsugar.m4, m4/ltversion.m4, m4/lt~obsolete.m4: New files from libtool 2.2.6. * tests/Makefile.am (AM_CFLAGS, LDADD): Add gpg-error. * tests/fdpassing.c: Change error values to gpg-error ones. src/ 2009-08-26 Marcus Brinkmann <marcus@g10code.de> * libassuan-config.in: Add gpg-error. * assuan-buffer.c, assuan-inquire.c, assuan-handler.c, assuan-util.c, assuan-client.c, assuan-socket-connect.c, assuan-pipe-connect.c, assuan-defs.h, assuan-socket.c, assuan-connect.c, assuan-uds.c, assuan-socket-server.c, assuan-listen.c, assuan-pipe-server.c: Return gpg_error_t instead assuan_error_t everywhere. Return gpg error codes everywhere. Replace xtrymalloc, xfree, etc with _assuan_malloc, _assuan_free etc. Protect include <config.h> by HAVE_CONFIG_H where not done so already. * versioninfo.rc.in, libassuan.vers, libassuan.def, assuan-error.c: New files. * Makefile.am: Add libtool handling and gpg-error (also for W32). (EXTRA_DIST): Remove mkerrors, add libassuan.vers, versioninfo.rc.in and libassuan.def. (BUILT_SOURCES, MOSTLYCLEANFILES): Removed. (common_sources): Remove assuan-errors.c, add assuan-error.c. * assuan.h: Include <gpg-error.h>. [_ASSUAN_ONLY_GPG_ERRORS]: Feature removed. (assuan_init_connected_socket_server, assuan_strerror) (assuan_pipe_connect2): Removed obsolete interfaces. (assuan_error_t): Removed type. (assuan_flag_t): Changed from enum to unsigned int. (ASSUAN_NO_WAITPID, ASSUAN_CONFIDENTIAL): Changed from enum to macro. (assuan_process): Return gpg_error_t instead of int. (assuan_set_assuan_err_source): Change argument type from int to gpg_err_source_t. * assuan-defs.h (_assuan_error): Change types to gpg_error_t. (err_code, err_is_eof, xtrymalloc, xtrycalloc, xtryrealloc) (xfree): Removed. (set_error): Adjust for gpg-error codes. (_assuan_gpg_strerror_r, _assuan_gpg_strsource): Removed. (struct assuan_context_s): Remove member os_errno. * assuan-socket-server.c (accept_connection): Don't set CTX->os_errno. * mkerrors: Removed file. * assuan-io-pth.c (_assuan_simple_sendmsg) (_assuan_simple_recvmsg), assuan-io.c (_assuan_simple_sendmsg, _assuan_simple_recvmsg): Set errno instead returning error directly (and return -1). * assuan-handler.c (assuan_process_done): Remove handling for old style error values. (process_request, assuan_process): Change return type from int to gpg_error_t. * assuan-client.c (assuan_transact): Remove support for old style error values. * assuan-pipe-connect.c (assuan_pipe_connect2): Removed. * assuan-logging.c (my_strerror_r, my_strsource) (load_libgpg_error, _assuan_gpg_strerror_r) (_assuan_gpg_strsource): Removed.
* Add hack for the inquiry feature.Werner Koch2009-02-241-2/+5
|
* 2007-10-05 Marcus Brinkmann <marcus@g10code.de>Marcus Brinkmann2007-10-051-2/+7
| | | | | | | | | | * assuan-defs.h (_assuan_error_is_eagain): New prototype. * mkerrors (_assuan_error_is_eagain): New function. * assuan-handler.c (process_next): Leave on EAGAIN. * assuan-handler.c (process_request), assuan-client.c (_assuan_read_from_server), assuan-buffer.c (assuan_read_line): Busy loop over EAGAIN.
* 2007-10-05 Marcus Brinkmann <marcus@g10code.de>Marcus Brinkmann2007-10-051-4/+16
| | | | | | | | | * assuan-defs.h (_assuan_sock_wsa2errno) [HAVE_W32_SYSTEM]: Add prototype. * assuan-uds.c (wsa2errno) [HAVE_W32_SYSTEM]: Move and rename to ... * assuan-socket.c (_assuan_sock_wsa2errno) [HAVE_W32_SYSTEM]: ... this. (_assuan_close, _assuan_sock_new, _assuan_sock_connect, _assuan_sock_bind): Always set errno on error.
* Better error mapping.Werner Koch2007-10-041-2/+3
|
* Preparing 1.0.3Werner Koch2007-08-241-1/+1
|
* Introduced new type for better support of W32 HADNLES vs. file descriptors.Werner Koch2007-07-121-12/+12
|
* Switched to LGPLv3.libassuan-1.0.2Werner Koch2007-07-051-4/+2
|
* New functions assuan_set_io_monitor and assuan_register_post_cmd_notifyWerner Koch2006-11-141-12/+45
|
* portability fixeslibassuan-0.9.3Werner Koch2006-10-101-0/+9
|
* 2006-09-19 Marcus Brinkmann <marcus@g10code.de>Marcus Brinkmann2006-09-191-3/+3
| | | | | | | | | | * mkerrors (_assuan_error): Change return type to assuan_error_t. * assuan-buffer.c (_assuan_read_line): Change return type to assuan_error_t. Map returned value of -1. (_assuan_write_line): Change type of RC to assuan_error_t. * assuan-defs.h (_assuan_read_line, _assuan_error): Likewise for prototypes.
* Preparing a new releaselibassuan-0.9.0Werner Koch2006-09-141-11/+11
|
* More tweaks for descriptor passing.Werner Koch2006-09-131-1/+5
| | | | | gpg-connect-agent may now be used as a test program.
* Changes to support gpg-error style error codes.Werner Koch2006-09-061-33/+41
|
* Fixed and clarified copyright noticesWerner Koch2005-10-241-1/+2
|
* (struct assuan_io): Renamed elements READ andWerner Koch2005-03-221-2/+2
| | | | | | WRITE to READFNC and WRITEFNC to avoid problems with read defined as macros. Changed callers. Noted by Ville Skytt��.
* * configure.ac: Define HAVE_W32_SYSTEM and HAVE_DOSISH_SYSTEM.Werner Koch2004-12-071-1/+1
| | | | | | | | | | Add -lwsock2 to the config lib flags for W32. * assuan-logging.c, assuan-io.c: Include config.h * assuan-pipe-connect.c (assuan_pipe_connect2) [_WIN32]: Return error Not Imlemented.
* 2004-11-23 Timo Schulz <twoaday@g10code.com>Timo Schulz2004-11-241-9/+12
| | | | | | | | | | | | | | | | | | * assuan-socket.c (_assuan_sock_connect): Get local port from the sun_path[] file. (_assuan_sock_bind): Write local port to the sun_path[] file. * assuan-socket-connect.c (assuan_socket_connect): Use DIRSEP_C for a better portability. (assuan-defs.h): Define DIRSEP_C. 2004-11-22 Timo Schulz <twoaday@g10code.com> * assuan-io.c (_assuan_simple_read, _assuan_simple_write): W32 support. * assuan-socket.c (_assuan_close): New. (_assuan_sock_new): New. (_assuan_sock_bind): New.
* * assuan-listen.c (assuan_set_hello_line, assuan_accept): AllowWerner Koch2004-05-111-21/+57
| | | | | | | | for multi line hello strings. * assuan-buffer.c (_assuan_write_line): New with parts of .. (assuan_write_line): .. factored out.
* * assuan-socket-connect.c: Include string.h.Werner Koch2004-04-291-1/+1
| | | | | * assuan-logging.c: Ditto.
* (_assuan_cookie_write_data): Return theWerner Koch2004-01-141-3/+4
| | | | | | requested size to indicate successful operation. Fixes a spurious bug we previously fixed using fflush().
* * assuan-buffer.c: Changed formatting of the debug output prefix.Werner Koch2003-12-161-14/+21
| | | | | | | | * assuan-util.c (assuan_set_log_stream): Set global log stream if it has not been done yet. * assuan-logging.c (_assuan_set_default_log_stream): New. (assuan_set_assuan_log_prefix): New.
* 2003-02-17 Neal H. Walfield <neal@g10code.de>Neal Walfield2003-02-181-38/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile.am (lib_LIBRARIES): Use this instead of . . . (noinst_LIBRARIES): . . . this. (include_HEADERS): New variable. (libassuan_a_SOURCES): Remove assuan.h, add assuan-logging.c. * assuan.h (assuan_set_assuan_log_stream): New prototype. (assuan_get_assuan_log_stream): Likewise. (assuan_get_assuan_log_prefix): Likewise. * assuan-logging.c: New file. * assuan-buffer.c [HAVE_JNLIB_LOGGIN]: Do not include "../jnlib/logging.h". (my_log_prefix): Remove function. (_assuan_read_line): Use assuan_get_assuan_log_prefix in lieu of my_log_prefix. (assuan_write_line): Likewise. (_assuan_cookie_write_data): Likewise. (_assuan_cookie_write_flush): Likewise. * assuan-domain-connect.c (LOGERROR, LOGERROR1, LOGERROR2, LOGERRORX): Remove. (LOG): New macro. (domain_reader): Use it. (domain_writer): Likewise. (domain_sendfd): Likewise. (domain_receivefd): Likewise. (_assuan_domain_init): Likewise. (assuan_domain_connect): Likewise. * assuan-pipe-connect.c [HAVE_JNLIB_LOGGIN]: Do not include "../jnlib/logging.h". (LOGERROR, LOGERROR1, LOGERROR2, LOGERRORX): Remove. (LOG): New macro. (assuan_pipe_connect): Use it. * assuan-socket-connect.c [HAVE_JNLIB_LOGGIN]: Do not include "../jnlib/logging.h". (LOGERROR, LOGERROR1, LOGERROR2, LOGERRORX): Remove. (LOG): New macro. (assuan_socket_connect): Use it. (socket_reader): Remove dead code. (socket_writer): Likewise. * assuan-util.c [HAVE_JNLIB_LOGGIN]: Do not include "../jnlib/logging.h". (_assuan_log_sanitized_string): Use assuan_get_assuan_log_stream, not jnlib.
* 2002-11-24 Neal H. Walfield <neal@cs.uml.edu>Neal Walfield2002-11-241-0/+20
| | | | | | | | | | | | | | | | | | | | | | | * assuan.h (assuan_sendfd): New prototype. (assuan_receivefd): New prototype. * assuan-buffer.c (assuan_sendfd): New function. (assuan_receivefd): New function. * assuan-handler.c (parse_cmd_input_output): Recognize incoming file descriptors and act appropriately. * assuan-defs.h (struct assuan_io): Add fields sendfd and receivefd. (struct assuan_context_s): Add fields pendingfds and pendingfdscount. * assuan-pipe-server.c (_assuan_new_context): Update IO to reflect new features. * assuan-domain-connect.c (do_deinit): Cleanup any unreceived file descriptors. (domain_reader): Receive file descriptors. (domain_sendfd): New function. (domain_receivefd): New function. (_assuan_domain_init): Update initialization code to reflect new features.
* 2002-11-23 Neal H. Walfield <neal@g10code.de>Neal Walfield2002-11-231-54/+58
| | | | | | * assuan-buffer.c (readline): Use memrchr. (_assuan_read_line): Rewritten to use the string functions.
* 2002-11-20 Neal H. Walfield <neal@g10code.de>Neal Walfield2002-11-211-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * assuan-defs.h (struct assuan_io): New structure. (struct assuan_context_s): New field, io. (_assuan_read): Depreciated. (_assuan_write): Likewise. * assuan-pipe-server.c: Include <unistd.h>. (pipe_reader): New function. (pipe_writer): Likewise. (_assuan_new_context.IO): New local static. Set to pipe_reader and pipe_writer. Use it to initialize new context. * assuan-socket-connect.c (socket_reader): New function. (socket_writer): New function. (assuan_socket_connect.IO): New local static. Set to socket_reader and socket_writer. Use it to initialize new context. * assuan-buffer.c (writen): Take an ASSUAN_CONTEXT rather than a file descriptor. Do not use _assuan_write but the write method in the supplied context. (readline): Likewise for _assuan_read. (assuan_write_line): When calling writen, pass CTX; not the file descriptor directly. (_assuan_cookie_write_data): Likewise. (_assuan_cookie_write_flush): Likewise. (_assuan_read_line): Likewise for readline. * Makefile.am (libassuan_a_SOURCES): Remove assuan-io.c. * assuan-io.c: Removed.
* 2002-09-05 Neal H. Walfield <neal@g10code.de>Neal Walfield2002-10-291-18/+9
| | | | | | | | | | | | | | | | | | | | | | | | | * assuan-defs.h (_assuan_read_wrapper): Depreciated. * assuan-util.c (_assuan_read_wrapper): Removed. * assuan-defs.h (_assuan_write_wrapper): Depreciated. * assuan-util.c (_assuan_write_wrapper): Removed. * assuan.h (assuan_set_io_fun): Depreciated. * assuan-util.c (assuan_set_io_fun): Removed. * assuan-defs.h (_assuan_read): New function. (_assuan_write): Likewise. * assuan-io.c: New file. * assuan-buffer.c (writen): Use _assuan_write rather than doing the work here. (readline): Likewise for _assuan_read. * Makefile.am (libassuan_a_SOURCES): Add assuan-io.c. 2002-09-05 Neal H. Walfield <neal@cs.uml.edu> * gpg-agent.c (main) [USE_GNU_PTH]: No need to call assuan_set_io_func as assuan is smart.
* Changed the lincese for Assuan to LGPL.V0-3-10NEWPG-0-3-10Werner Koch2002-07-301-13/+13
|
* * assuan-buffer.c (assuan_write_line): Make sure we neverWerner Koch2002-06-261-5/+13
| | | | | accidently print an extra LF.
* * assuan-util.c (assuan_set_io_func): New.V0-3-8V0-3-7NEWPG-0-3-8NEWPG-0-3-7Werner Koch2002-05-231-13/+7
| | | | | | | | | * assuan-buffer.c (writen, readline): Use the new functions instead of pth. * assuan-socket-server.c (accept_connection): Don't use the pth_accept - using the assuan included accept code would be a bad idea within Pth so we don't need a replacement function.
* * assuan-buffer.c (my_log_prefix): New. Use it for all i/o debug output.V0-3-6V0-3-5NEWPG-0-3-6NEWPG-0-3-5Werner Koch2002-04-091-8/+23
|
* * assuan-buffer.c (writen,readline) [USE_GNU_PT]: Use pth_read/write.Werner Koch2002-02-121-1/+11
| | | | | * assuan-socket-server.c (accept_connection) [USE_GNU_PTH]: Ditto.