Skip to content

MessageBufferOutput#reset shouldn't close an output passed as a paramete... - #169

Merged
xerial merged 3 commits into
v07-developfrom
fix_msgbufoutput_reset
Jan 11, 2015
Merged

MessageBufferOutput#reset shouldn't close an output passed as a paramete...#169
xerial merged 3 commits into
v07-developfrom
fix_msgbufoutput_reset

Conversation

@komamitsu

Copy link
Copy Markdown
Member

...r

(ChannelBufferOutput|OutputStreamBufferOutput)#reset close WritableByteChannel or OutputStream passed as a parameter. As a result, when outputting to a file, it causes a write error because the file is already closed.

@komamitsu

Copy link
Copy Markdown
Member Author

@xerial Can you review this PR?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code should be:

this.channel.close();

@xerial

xerial commented Jan 11, 2015

Copy link
Copy Markdown
Member

My intention was to close the previously assigned output/channel (not the on in the input argument). So simply modifying the code to use this.out.close() is sufficient?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have been:

this.out.close();

@komamitsu

Copy link
Copy Markdown
Member Author

Sounds nice. I changed reset() again to close the previous output.

xerial added a commit that referenced this pull request Jan 11, 2015
MessageBufferOutput#reset shouldn't close an output passed as a paramete...
@xerial
xerial merged commit 59bc83b into v07-develop Jan 11, 2015
@xerial

xerial commented Jan 11, 2015

Copy link
Copy Markdown
Member

thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants