Differences From Artifact [2ce21e69b2]:
- File src/tls/OFOpenSSLTLSStream.m — part of check-in [da02ae46f0] at 2022-03-10 19:37:44 on branch trunk — OFOpenSSLTLSStream: Fix stuck reads (user: js, size: 10508) [annotate] [blame] [check-ins using]
To Artifact [f8706b398d]:
- File
src/tls/OFOpenSSLTLSStream.m
— part of check-in
[4b3d25ac76]
at
2022-03-24 21:00:03
on branch trunk
— OFOpenSSLTLSStream: Copy from _writeBIO in a loop
_writeBIO might contain more data than we can write at once, which could
then result in forever waiting on the next read because _writeBIO has
never been fully written to the underlying stream. (user: js, size: 10526) [annotate] [blame] [check-ins using] [more...]
︙ | |||
122 123 124 125 126 127 128 | 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | - + | if (e.errNo != EWOULDBLOCK && e.errNo != EAGAIN) @throw e; } } ret = SSL_read_ex(_SSL, buffer, length, &bytesRead); |
︙ | |||
174 175 176 177 178 179 180 | 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | - + | @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length bytesWritten: bytesWritten errNo: errNo]; } |
︙ | |||
254 255 256 257 258 259 260 | 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | - + | exceptionWithStream: self host: host errorCode: initFailedErrorCode]; } status = SSL_do_handshake(_SSL); |
︙ | |||
313 314 315 316 317 318 319 | 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | - + | OFEnsure(length <= INT_MAX); OFEnsure(BIO_write(_readBIO, buffer, (int)length) == (int)length); status = SSL_do_handshake(_SSL); |
︙ | |||
367 368 369 370 371 372 373 | 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | - + - + | { if (exception == nil) { static const OFTLSStreamErrorCode unknownErrorCode = OFTLSStreamErrorCodeUnknown; int status; OFRunLoopMode runLoopMode; |
︙ |