CSV rows for stdout sit in a 4 KB buffer until the run ends
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 76/100
Direção de pesquisa
Comece em internal/output/writer.go: ensureCSV envolve o stdout em um csv.NewWriter, e writeCSVRows escreve cada linha sem fazer flush, então o flush só acontece em Finish. Reproduza com -simulate -format csv ... | cat em comparação com -format jsonl. Está pronto quando cada linha CSV no stdout é descarregada (flushed) assim que é escrita, e um teste no pacote output (usando -simulate ou o servidor de DNS de teste local, não um domínio real) lê uma linha do stdout antes de a execução terminar.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Summary
With -format csv, results reach stdout only when 4 KB has accumulated or the run finishes, unlike text, JSON and JSONL, which are written as each result is found; a force quit loses the buffered rows.
Where
internal/output/writer.go:328internal/output/writer.go:354internal/output/writer.go:390internal/output/writer.go:30
Details
ensureCSV wraps stdout in csv.NewWriter(w.stdOut()) (line 328) and writeCSVRows only calls w.csvStdout.Write(row) (line 355). encoding/csv.Writer buffers through a bufio.Writer and is flushed in exactly one place, Finish (lines 390-392; git grep "Flush()" confirms). Text, JSONL and even the JSON array (w.stdOut().Write(data), line 279) are written to stdout as each result is found. The FormatCSV doc comment says it "streams" rows (line 30).
Impact
With -format csv, nothing reaches stdout until 4 KB of rows have accumulated or the run finishes: a consumer on a pipe sees no live results, on a terminal the rows appear after the "Scan complete" breakdown instead of as they are found, and a force quit (the second Ctrl+C, which main_session.go:519-521 deliberately restores) loses every buffered row. The other three formats do not behave this way.
Steps to reproduce
subenum -simulate -hit-rate 100 -rate 2 -format csv -w examples/sample_wordlist.txt example.com | cat prints nothing until the scan ends; the same command with -format jsonl prints a line per hit.
Suggested fix
Call w.csvStdout.Flush() at the end of writeCSVRows when w.csvStdout != nil (stdout only; the file writer already sits on the -o bufio.Writer and can stay buffered).
Acceptance criteria
- Each CSV row written to stdout is flushed when it is written
- A test reads a row from stdout before the run finishes
Getting started
- Relevant files:
internal/output/writer.go - How to run tests:
make test(orgo test ./...). Tests must stay hermetic: use-simulate,-simulate-zoneor the local DNS test server, never a live domain. - Related docs:
docs/DEVELOPER_GUIDE.md,docs/ARCHITECTURE.md
Filed by repo-audit/full-audit at d0c56f0. Severity: low. Effort: S. audit-key: bug|internal/output/writer.go|writeCSVRows
- Linguagem predominante
- Go
- Estrelas
- 1
- Forks
- 1
- Merge médio
- 6h 42min
- PRs com merge (30d)
- 7
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de TMHSDigital/subenum
-
good first issue severity: low tech-debt
Dificuldade 2/5 Meio dia Facilidade para iniciantes 75/100
TMHSDigital/subenum#329 ·
Mantenedores costumam responder em até 1 dia
-
area: docs documentation good first issue severity: low
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
TMHSDigital/subenum#327 ·
Mantenedores costumam responder em até 1 dia
-
area: release dependencies good first issue severity: low
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
TMHSDigital/subenum#324 ·
Mantenedores costumam responder em até 1 dia
-
ci good first issue severity: low
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
TMHSDigital/subenum#323 ·
Mantenedores costumam responder em até 1 dia
-
community documentation good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
TMHSDigital/subenum#135 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de TMHSDigital/subenum
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
GillMacedo/godebugdiff#13 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
GillMacedo/racesift#14 ·
-
IsTextFile reads the whole file into memory (OOM on large files in the file watcher)Talvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
gtsteffaniak/filebrowser#3395 ·
Mantenedores costumam responder em até 1 dia
-
effort:s impact:low raised-by:worker risk:low
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 70/100
medici-finance/assay#6496 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
kind/bug require/reproduce require/severity
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia