-
Notifications
You must be signed in to change notification settings - Fork 165
Open
Labels
Element: WebBrokerIssues related to TIdHTTPWebBrokerBridgeIssues related to TIdHTTPWebBrokerBridgeStatus: Review NeededIssue needs further review to decide next statusIssue needs further review to decide next statusType: BugIssue is a bug in existing codeIssue is a bug in existing code
Description
I found a bug in TIdCustomHTTPServer.DoExecute, which I believe is related to its use with TIdHTTPWebBrokerBridge: when the connection is closed by the remote client before the response has been written, the stream field of the TIdHTTPResponseInfo object can be assigned but is no longer valid (due to a mechanism I haven't explored that causes WebBroker to free the stream when the connection is closed). This causes an access violation in WriteContent and the system becomes very unstable.
I found that checking connected adding this line at current line 1500 of IdCustomHTTPServer.pas, (before the call to writeContent) solve the problem:
if not LConn.Socket.Connected then
break;
before of:
// Write even though WriteContent will, may be a redirect or other
if not LResponseInfo.HeaderHasBeenWritten then begin
LResponseInfo.WriteHeader;
end;
Metadata
Metadata
Assignees
Labels
Element: WebBrokerIssues related to TIdHTTPWebBrokerBridgeIssues related to TIdHTTPWebBrokerBridgeStatus: Review NeededIssue needs further review to decide next statusIssue needs further review to decide next statusType: BugIssue is a bug in existing codeIssue is a bug in existing code