THRIFT-5385 XML-HTTP client reports IsOpen=TRUE even if it is not
Client: Delphi
Patch: Jens Geyer
diff --git a/lib/delphi/src/Thrift.Transport.MsxmlHTTP.pas b/lib/delphi/src/Thrift.Transport.MsxmlHTTP.pas
index bdc65d1..a3f387b 100644
--- a/lib/delphi/src/Thrift.Transport.MsxmlHTTP.pas
+++ b/lib/delphi/src/Thrift.Transport.MsxmlHTTP.pas
@@ -197,7 +197,7 @@
function TMsxmlHTTPClientImpl.GetIsOpen: Boolean;
begin
- Result := True;
+ Result := Assigned(FOutputStream);
end;
procedure TMsxmlHTTPClientImpl.Open;
@@ -264,7 +264,9 @@
procedure TMsxmlHTTPClientImpl.Write( const pBuf : Pointer; off, len : Integer);
begin
- FOutputStream.Write( pBuf, off, len);
+ if FOutputStream <> nil
+ then FOutputStream.Write( pBuf, off, len)
+ else raise TTransportExceptionNotOpen.Create('Transport closed');
end;