diff --git a/ChangeLog b/ChangeLog index c6ca1edcd..3c2e568c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2021-05-15 Richard Frith-Macdonald + + * Source/GSFileHandle.m: + * Source/win32/GSFileHandle.m: + When we receive an event telling us the handle is writable, repeatedly + write until either all the data we have is written or until the write + attempt doesn't write anything. On mswindows this copes with the case + of the gnutls write only writing 16KB chunks at a time. + 2021-05-05 Richard Frith-Macdonald * configure.ac: Check for declaration of CURLOPT_MAXAGE_CONN diff --git a/Source/GSFileHandle.m b/Source/GSFileHandle.m index c8cc9651c..ede5318fc 100644 --- a/Source/GSFileHandle.m +++ b/Source/GSFileHandle.m @@ -2264,7 +2264,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; item = [info objectForKey: NSFileHandleNotificationDataItem]; length = [item length]; ptr = [item bytes]; - if (writePos < length) + while (writePos < length) { int written; diff --git a/Source/win32/GSFileHandle.m b/Source/win32/GSFileHandle.m index f01cd1800..e7332b0bc 100644 --- a/Source/win32/GSFileHandle.m +++ b/Source/win32/GSFileHandle.m @@ -2220,7 +2220,7 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; item = [info objectForKey: NSFileHandleNotificationDataItem]; length = [item length]; ptr = [item bytes]; - if (writePos < length) + while (writePos < length) { int written;