gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 50/125: openssl: Disable file buffering for Win32 S


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 50/125: openssl: Disable file buffering for Win32 SSLKEYLOGFILE
Date: Sun, 21 Jan 2018 23:41:45 +0100

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit 7ab4e7adb9143f3a3eef708693a526c93b2c97ee
Author: Jay Satiro <address@hidden>
AuthorDate: Sun Dec 10 02:48:41 2017 -0500

    openssl: Disable file buffering for Win32 SSLKEYLOGFILE
    
    Prior to this change SSLKEYLOGFILE used line buffering on WIN32 just
    like it does for other platforms. However, the Windows CRT does not
    actually support line buffering (_IOLBF) and will use full buffering
    (_IOFBF) instead. We can't use full buffering because multiple processes
    may be writing to the file and that could lead to corruption, and since
    full buffering is the only buffering available this commit disables
    buffering for Windows SSLKEYLOGFILE entirely (_IONBF).
    
    Ref: https://github.com/curl/curl/pull/1346#issuecomment-350530901
---
 lib/vtls/openssl.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index 4659c7997..6d9e81d3b 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -948,7 +948,11 @@ static int Curl_ossl_init(void)
   if(keylog_file_name && !keylog_file_fp) {
     keylog_file_fp = fopen(keylog_file_name, FOPEN_APPENDTEXT);
     if(keylog_file_fp) {
+#ifdef WIN32
+      if(setvbuf(keylog_file_fp, NULL, _IONBF, 0)) {
+#else
       if(setvbuf(keylog_file_fp, NULL, _IOLBF, 4096)) {
+#endif
         fclose(keylog_file_fp);
         keylog_file_fp = NULL;
       }

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]