Skip to content
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

Last buffer block doesn't get split into lines. #3

Closed
kiwiroy opened this issue Aug 21, 2019 · 4 comments
Closed

Last buffer block doesn't get split into lines. #3

kiwiroy opened this issue Aug 21, 2019 · 4 comments

Comments

@kiwiroy
Copy link
Contributor

kiwiroy commented Aug 21, 2019

Should the last buffer get split into lines?

$self->{_read_line_close_cb} = $self->on(close => sub {
my $self = shift;
if (length(my $buffer = delete $self->{_read_line_buffer} // '')) {
$self->emit(read_line => $buffer);
}
});

@Grinnz
Copy link
Owner

Grinnz commented Aug 21, 2019

Good catch!

@kiwiroy
Copy link
Contributor Author

kiwiroy commented Aug 21, 2019

I have e4ba6bd, which passes current tests. I don't currently have a good test for the change though.

@Grinnz
Copy link
Owner

Grinnz commented Aug 22, 2019

It seems only possible to happen if the line separator is changed after reading and before the close event. Should be fixed by 5f89b20

Grinnz added a commit that referenced this issue Aug 22, 2019
  - Handle multiple lines in buffer on close in the case where the line separator was changed (#3, kiwiroy)
@Grinnz Grinnz closed this as completed Aug 22, 2019
@kiwiroy
Copy link
Contributor Author

kiwiroy commented Aug 23, 2019

Yes, that's fixed it. Thanks

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

No branches or pull requests

2 participants