-
-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change use of ReadWriteStream*
to IDataSourceStream*
where appropriate
#1588
Conversation
@@ -174,22 +173,25 @@ bool HttpResponse::sendDataStream(ReadWriteStream* newDataStream, const String& | |||
} | |||
stream = newDataStream; | |||
|
|||
if(!headers.contains(HTTP_HEADER_TRANSFER_ENCODING) && stream->available() < 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible change to behaviour; perhaps revert for now
stream = nullptr; | ||
} | ||
|
||
FileStream* fileStream; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should follow original more closely
bool TcpClient::send(const char* data, uint16_t len, bool forceCloseAfterSent /* = false*/) | ||
{ | ||
if(state != eTCS_Connecting && state != eTCS_Connected) | ||
return false; | ||
|
||
if(stream == NULL) | ||
stream = new MemoryDataStream(); | ||
if(buffer != nullptr) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this follow original more closely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this follow original more closely?
There are a few places I could reduce changes to existing code
I would say yes.
There are a few places I could reduce changes to existing code; I've more extensive changes planned in subsequent PRs, wishing to avoid any side effects here. |
b6d1f39
to
c4f404c
Compare
@mikee47 Can you rebase that PR on the latest develop? I want to be sure that the CS check passes before I merge it into develop? |
…riate Changes to parameter types, member variables `MultiStream`and `StreamTransformer` classes now inherit from `IDataSourceStream` instead of `ReadWriteStream`; this affects all inherited classes With `TcpClient`, a stream is used for outgoing data so should be inherited from IDataSourceStream, not ReadWriteStream. An additional internal 'buffer' ReadWriteStream is used where necessary. This is also done for the `HttpResponse`class.
c4f404c
to
c04e588
Compare
OK, have rebased & pushed. |
Changes to parameter types, member variables
MultiStream
andStreamTransformer
classes now inherit fromIDataSourceStream
instead ofReadWriteStream
; this affects all inherited classesWith
TcpClient
, a stream is used for outgoing data so should be inherited from IDataSourceStream, not ReadWriteStream. An additional internal 'buffer' ReadWriteStream is used where necessary.This is also done for the
HttpResponse
class.