Skip to content

Support lines of length more than 4096 bytes#24

Merged
srid merged 2 commits intohpcloud:masterfrom
masahide:add-test-over4096byte-line
Apr 12, 2014
Merged

Support lines of length more than 4096 bytes#24
srid merged 2 commits intohpcloud:masterfrom
masahide:add-test-over4096byte-line

Conversation

@masahide
Copy link
Contributor

Merged funkygao/tail@c5abc6d to correct the problem that occurs in the line of more than 4096 bytes.
And add test code.

Copy link
Contributor

Choose a reason for hiding this comment

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

it may be best to make readLine return a slice of lines by splitting read lines per Config.MaxLineSize, as otherwise there is no limit on how much buf can grow.

Copy link
Contributor

Choose a reason for hiding this comment

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

@masahide sorry - it looks like i overlooked something. two months ago, i noted above that the buf variable can grow unbounded, as the for loop doesn't split it per the MaxLineSize setting and return a slice of lines. did you make any code changes for this? i don't see it in the current diff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please try View full changes.

    if !isPrefix || tail.MaxLineSize > 0 {
        return line, err
    }

for loop is not performed if MaxLineSize is greater than or equal to zero.
Does this have a problem?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems that "the diff display" is wrong by "git push -f."

@masahide
Copy link
Contributor Author

👍
Indeed!

@srid srid mentioned this pull request Feb 19, 2014
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it contains the buffer newlines code, add 2 bytes of CR/LF.

@masahide
Copy link
Contributor Author

Please confirm it, tried to change to be set MaxLineSize to the bufio.reader.

@srid
Copy link
Contributor

srid commented Mar 22, 2014

@masahide looks good. please rebase your branch, and then i'll merge it.

@masahide
Copy link
Contributor Author

The rebasing.
May this be sufficient?
Or is it better to collect more?

@srid
Copy link
Contributor

srid commented Apr 4, 2014

you need to rebase the master branch. your branch is outdated,
https://github.com/masahide/tail/commits/add-test-over4096byte-line

compare to,
https://github.com/ActiveState/tail/commits/master

try:

git remote add upstream git@github.com:ActiveState/tail.git
git fetch upstream
git rebase upstream/master

@srid srid changed the title Problem that occurs in the line of more than 4096 bytes. Support lines of length more than 4096 bytes Apr 4, 2014
@masahide
Copy link
Contributor Author

masahide commented Apr 6, 2014

I am sorry.
I was mistaken.
I've rebase the master.
Please confirm.

@srid
Copy link
Contributor

srid commented Apr 6, 2014

@masahide - see my line note abvove.

srid pushed a commit that referenced this pull request Apr 12, 2014
Support lines of length more than 4096 bytes
@srid srid merged commit 9f7054d into hpcloud:master Apr 12, 2014
@srid
Copy link
Contributor

srid commented Apr 12, 2014

all good, thanks for the work @masahide

srid pushed a commit that referenced this pull request Apr 12, 2014
@masahide
Copy link
Contributor Author

thanks!

daniel-ayvar pushed a commit to daniel-ayvar/tail that referenced this pull request Feb 21, 2024
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.

3 participants