Skip to content

Flush output buffer after writing status/banner to stdout#838

Open
elijahr2411 wants to merge 1 commit intorobertdavidgraham:masterfrom
elijahr2411:master
Open

Flush output buffer after writing status/banner to stdout#838
elijahr2411 wants to merge 1 commit intorobertdavidgraham:masterfrom
elijahr2411:master

Conversation

@elijahr2411
Copy link
Copy Markdown

@elijahr2411 elijahr2411 commented Mar 28, 2026

Currently, masscan does not call fflush on the output handle after writing status/banner. When writing output to a file (where buffering is desirable) or to a console (which is not buffered), this is not an issue. However, when piping masscan's output to a script, the output buffering causes the other end of the pipe to not receive any scan results until either enough have been buffered for the handle to flush itself, or otherwise until the scan is complete and the handle is closed.

This PR fixes this issue by calling fflush after every output write when the output file is stdout.

Resolves #533

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.

"buffer not emptied"

1 participant