From 9051fc538f93393d9e5540c9f981858178f5a1c1 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 17 Feb 2010 14:32:25 +0000 Subject: [PATCH] PR: 2100 Submitted by: James Baker et al. Workaround for slow Heap32Next on some versions of Windows. --- CHANGES | 5 +++++ crypto/rand/rand_win.c | 1 + 2 files changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 2e093c110c..6ffa4d83a4 100644 --- a/CHANGES +++ b/CHANGES @@ -845,6 +845,11 @@ Changes between 0.9.8l (?) and 0.9.8m (?) [xx XXX xxxx] + *) On some versions of WIN32 Heap32Next is very slow. This can cause + excessive delays in the RAND_poll(): over a minute. As a workaround + include a time check in the inner Heap32Next loop too. + [Steve Henson] + *) The code that handled flushing of data in SSL/TLS originally used the BIO_CTRL_INFO ctrl to see if any data was pending first. This caused the problem outlined in PR#1949. The fix suggested there however can diff --git a/crypto/rand/rand_win.c b/crypto/rand/rand_win.c index 9bad067f43..5198351cf3 100644 --- a/crypto/rand/rand_win.c +++ b/crypto/rand/rand_win.c @@ -527,6 +527,7 @@ int RAND_poll(void) RAND_add(&hentry, hentry.dwSize, 5); while (heap_next(&hentry) + && (!good || (GetTickCount()-starttime) 0); } } -- 2.34.1