Skip to content

Commit 58bf523

Browse files
authored
Merge pull request #460 from robertomr1969/fix-https-large-response-iocp-winiocp
THttpAsyncServer: fix HTTPS responses >64KB hanging on Windows IOCP+TLS
2 parents d3a55ff + d2943a4 commit 58bf523

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/lib/mormot.lib.openssl11.pas

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11322,6 +11322,12 @@ procedure TOpenSslNetTls.AfterAccept(Socket: TNetSocket;
1132211322
if BoundContext.AcceptCert = nil then
1132311323
raise EOpenSslNetTls.Create('AfterAccept: missing AfterBind');
1132411324
fSsl := SSL_new(BoundContext.AcceptCert);
11325+
// SSL_MODE_ENABLE_PARTIAL_WRITE ($01): SSL_write returns partial count on
11326+
// partial send, so mORMot can advance the buffer pointer correctly and
11327+
// issue a fresh SSL_write for the remainder (no retry-same-buffer constraint)
11328+
// SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER ($02): allow retry with different
11329+
// buffer pointer after WANT_WRITE (mORMot copies pending data to fWr)
11330+
SSL_set_mode(fSsl, $00000003); // ENABLE_PARTIAL_WRITE | ACCEPT_MOVING_WRITE_BUFFER
1132511331
Check('AfterAccept set_fd', SSL_set_fd(fSsl, Socket.Socket));
1132611332
// server TLS negotiation with server
1132711333
Check('AfterAccept accept', SSL_accept(fSsl));

0 commit comments

Comments
 (0)