aboutsummaryrefslogtreecommitdiffstats
path: root/common/estream.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2014-08-26Switch to the libgpg-error provided estream.Werner Koch1-4561/+0
* configure.ac (NEED_GPG_ERROR_VERSION): Reguire 1.14. (GPGRT_ENABLE_ES_MACROS): Define. (estream_INIT): Remove. * m4/estream.m4: Remove. * common/estream-printf.c, common/estream-printf.h: Remove. * common/estream.c, common/estream.h: Remove. * common/init.c (_init_common_subsystems): Call gpgrt initialization.
2014-08-17estream: Change license from GPL to LPGL.Werner Koch1-6/+6
* common/estream-printf.c, common/estream-printf.h: Change license. * common/estream.c, common/estream.h: Ditto. -- g10 Code is the sole copyright holder of Libestream and thus as CEO I have the rights to to change the license. This copy here in GnuPG is currently the most current one thus the change is recorded in this repository. This change is also deemed valid for all older versions. Signed-off-by: Werner Koch <[email protected]>
2014-05-02common: Cleanup the use of USE_NPTH and HAVE_NPTH macros.Werner Koch1-14/+14
* configure.ac (HAVE_NPTH): New ac_define. * common/estream.c: Use USE_NPTH instead of HAVE_NPTH. * common/http.c: Ditto. Replace remaining calls to pth by npth calls. (connect_server): Remove useless _(). * common/exechelp-posix.c, common/exechelp-w32.c * common/exechelp-w32ce.c: Use HAVE_PTH to include npth.h. * common/init.c (_init_common_subsystems): Remove call to pth_init. * common/sysutils.c (gnupg_sleep): Use npth_sleep. * scd/ccid-driver.c (my_sleep): Ditto. -- USE_NPTH is used in case were we may build with and without nPth. The missing definition HAVE_NPTH didn't allowed us to build outher sources with nPTh support.
2014-04-30estream: Implement "samethread" mode keyword.Werner Koch1-54/+107
* src/estream.c (estream_internal): Add field SAMETHREAD. (init_stream_lock, lock_stream, trylock_stream, unlock_stream): Use it. (parse_mode): Add arg SAMETHREAD and parse that keyword. (es_initialize): Rename to ... (init_stream_obj): this. Add arg SAMETHREAD. (es_create): Add arg SAMETHREAD. Call init_stream_lock after init_stream_obj. (doreadline): Call es_create with samethread flag. (es_fopen, es_mopen, es_fopenmem, es_fopencookie, do_fdopen) (do_fpopen, do_w32open): Implement "samethread" keyword. (es_freopen): Take samthread flag from old stream. (es_tmpfile): Call es)_create w/o samethread. -- Note: Unfortunately es_tmpfile has no mode arg so that we can't use samethread.
2014-04-30estream: Fix deadlock in es_fileno.Werner Koch1-1/+1
* src/estream.c (es_fileno_unlocked): Call the unlocked functions.
2014-04-30estream: Add debug code to the lock functions.Werner Koch1-3/+39
* common/estream.c (dbg_lock_0, dbg_lock_1, dbg_lock_1): New.
2014-04-30estream: Replace locking macros by functions.Werner Koch1-148/+186
* common/estream.c: Replace most macros. -- The macros were too hard to read and actually blew up the source.
2014-04-30estream: Migrate from Pth to nPth.Werner Koch1-23/+22
-- Actually the mutex stuff was never used since we switched to nPth.
2014-04-16Two minor code cleanups and one NULL deref on error fix.Werner Koch1-1/+1
* common/estream.c (es_freopen): Remove useless check for STREAM. * kbx/keybox-blob.c (_keybox_create_x509_blob): Remove useless check for BLOB. * tools/sockprox.c (run_proxy): Do not fclose(NULL). -- Found by Hans-Christoph Steiner with cppcheck.
2014-03-07w32: Include winsock2.h to silence warnings.Werner Koch1-0/+3
2014-03-07common: Fix build problem with Sun Studio compiler.Werner Koch1-4/+6
* common/estream.c (ESTREAM_MUTEX_UNLOCK): Use int dummy dummy functions. (ESTREAM_MUTEX_INITIALIZE): Ditto. -- GnuPG-bug-id: 1566 Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 571bcd4662a351cfa55bbf1a79ed1bc26da5780f) Reolved conflicts: common/estream.c Warning: estream.c still uses pth_mutex_* which is definitely wrong. Needs to be investigated.
2013-04-19Make sure to call fflush if estream_t is backed with stdioDaiki Ueno1-0/+1
* common/estream.c (es_func_fp_write): Call fflush after fwrite.
2012-06-05Change all quotes in strings and comments to the new GNU standard.Werner Koch1-1/+1
The asymmetric quotes used by GNU in the past (`...') don't render nicely on modern systems. We now use two \x27 characters ('...'). The proper solution would be to use the correct Unicode symmetric quotes here. However this has the disadvantage that the system requires Unicode support. We don't want that today. If Unicode is available a generated po file can be used to output proper quotes. A simple sed script like the one used for en@quote is sufficient to change them. The changes have been done by applying sed -i "s/\`\([^'\`]*\)'/'\1'/g" to most files and fixing obvious problems by hand. The msgid strings in the po files were fixed with a similar command.
2012-01-25Port to npth.Marcus Brinkmann1-17/+12
* configure.ac: Don't check for PTH but for NPTH. (AH_BOTTOM): Remove PTH_SYSCALL_SOFT. (have_pth): Rename to ... (have_npth): ... this. (USE_GNU_NPTH): Rename to ... (USE_GNU_PTH): ... this. * m4/npth.m4: New file. * agent/Makefile.am, agent/cache.c, agent/call-pinentry.c, agent/call-scd.c, agent/findkey.c, agent/gpg-agent.c, agent/trustlist.c, common/Makefile.am, common/estream.c, common/exechelp-posix.c, common/exechelp-w32.c, common/exechelp-w32ce.c, common/http.c, common/init.c, common/sysutils.c, dirmngr/Makefile.am, dirmngr/crlfetch.c, dirmngr/dirmngr.c, dirmngr/dirmngr_ldap.c, dirmngr/ldap-wrapper-ce.c, dirmngr/ldap-wrapper.c, dirmngr/ldap.c, g13/Makefile.am, g13/call-gpg.c, g13/g13.c, g13/runner.c, scd/Makefile.am, scd/apdu.c, scd/app.c, scd/ccid-driver.c, scd/command.c, scd/scdaemon.c, tools/Makefile.am: Port to npth.
2011-12-15estream: New function es_fclose_snatch.Werner Koch1-0/+106
* common/estream.c (cookie_ioctl_function_t): New type. (es_fclose_snatch): New function. (COOKIE_IOCTL_SNATCH_BUFFER): New constant. (struct estream_internal): Add field FUNC_IOCTL. (es_initialize): Clear FUNC_IOCTL. (es_func_mem_ioctl): New function. (es_fopenmem, es_fopenmem_init): Init FUNC_IOCTL.
2011-11-30* common/estream.c (es_fopenmem_init): New.Werner Koch1-2/+35
* common/estream.h (es_fopenmem_init): New.
2011-11-30Add parameter checks and extend documentation of estream.Werner Koch1-10/+31
* estream.c (func_mem_create): Don't set FUNC_REALLOC if GROW is not set. Require FUNC_REALLOC if DATA is NULL and FUNC_FREE is given.
2011-08-10Fixed set but unused variable bugsWerner Koch1-4/+2
2011-03-03Simplify the management of the stream list in estream.cWerner Koch1-66/+72
2011-02-08Add finger support to dirmngr.Werner Koch1-3/+8
The basic network code from http.c is used for finger. This keeps the network related code at one place and we are able to use the somewhat matured code form http.c. Unfortunately I had to enhance the http code for more robustness and probably introduced new bugs. Test this code using gpg --fetch-key finger:[email protected] (I might be the last user of finger ;-)
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-95/+95
We better do this once and for all instead of cluttering all future commits with diffs of trailing white spaces. In the majority of cases blank or single lines are affected and thus this change won't disturb a git blame too much. For future commits the pre-commit scripts checks that this won't happen again.
2011-01-18Fix es_fopenmem and es_mopen bug.Werner Koch1-1/+1
2011-01-18Fix computation of NEWSIZE in es_func_mem_write.Werner Koch1-1/+1
The function used to fail and return EINVAL when enlarging the buffer.
2010-09-012010-09-01 Marcus Brinkmann <[email protected]>Marcus Brinkmann1-1/+1
* estream.c (_es_set_std_fd): Disable debug output.
2010-08-26Fix for W32.Werner Koch1-0/+2
2010-08-26.Werner Koch1-67/+136
2010-08-23gpgconf does now work for Wince.Werner Koch1-1/+84
2010-08-20Reworked the posix and w32 exechelpers.Werner Koch1-36/+435
2010-08-18Fix regression in logging.Werner Koch1-20/+37
Add a registry key to enable catch-all remote debugging for W32. Replace more stdio stuff by estream.
2010-08-02Add code for a threaded LDAP access to replace the wrapper process.Werner Koch1-1/+22
Currently used for W32 and W32CE.
2010-07-26Fixed couple of build problems. However the W32 version is currentlyWerner Koch1-6/+6
under work.
2010-07-24Add new set_binary feature to estreamWerner Koch1-0/+33
2010-07-16Some work on porting dirmngr (unfinished)Werner Koch1-12/+4
Ported gpgtar to W32.
2010-06-102010-06-10 Marcus Brinkmann <[email protected]>Marcus Brinkmann1-1/+1
* server.c (SERVER_STDIN, SERVER_STDOUT): New macros. (gpgsm_server): Use them with assuan_fdopen.
2010-06-07Add unfinished gpgtar.Werner Koch1-3/+86
Collected changes and ports of bug fixes from stable.
2010-05-04Auto starting the agent does now work on CE.Werner Koch1-26/+63
2010-04-21More changes on the way to remove secring.gpg.Werner Koch1-2/+13
2010-04-14Whole lot of changes to support CE.Werner Koch1-0/+3
2010-03-22More chnages to use estream. Add a way to replace the standardWerner Koch1-4/+37
descriptors.
2010-03-15Finished the bulk of changes to use estream in most places instead ofWerner Koch1-35/+103
stdio.
2010-03-11Use a custom log handler for libassuan.Werner Koch1-2/+4
2010-03-10Change logging to use estream. The makes logging to a socket alsoWerner Koch1-13/+54
work on Solaris etc. Further changes required.. This is just a first step.
2010-03-02First steps towards the W32CE portWerner Koch1-22/+88
2010-01-08Add dummu option --passwd for gpg.Werner Koch1-1/+1
Collected changes.
2009-09-03Update estream.Werner Koch1-1/+39
2009-06-29Reworked the estream memory buffer allocation.Werner Koch1-35/+50
Committed already posted patches for the v2 card.
2009-06-29The variable is called RET and not RC.Werner Koch1-4/+43
2009-06-25Fixed stupid typo.Werner Koch1-1/+1
2009-06-24Fixed a bunch of little bugs as reported by Fabian Keil.Werner Koch1-5/+7
Still one problem left; marked with a gcc #warning.
2009-06-03Fixed an fopen problem on Windows Vista.Werner Koch1-51/+33