CSV rows for stdout sit in a 4 KB buffer until the run ends
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
Línea de trabajo
Empieza en internal/output/writer.go: ensureCSV envuelve stdout en un csv.NewWriter, y writeCSVRows escribe cada fila sin hacer flush, así que el flush solo ocurre en Finish. Reproduce con -simulate -format csv ... | cat frente a -format jsonl. Se considera terminado cuando cada fila CSV en stdout se vacía al escribirse, y una prueba en el paquete output (usando -simulate o el servidor DNS de prueba local, no un dominio real) lee una fila de stdout antes de que termine la ejecución.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Go
- Estrellas
- 1
- Forks
- 1
- Merge medio
- 6 h 42 min
- PR fusionados (30 d)
- 7
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TMHSDigital/subenum
-
good first issue severity: low tech-debt
Dificultad 2/5 Medio día Aptitud para principiantes 75/100
TMHSDigital/subenum#329 ·
Los mantenedores suelen responder en 1 día
-
area: docs documentation good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
TMHSDigital/subenum#327 ·
Los mantenedores suelen responder en 1 día
-
area: release dependencies good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
TMHSDigital/subenum#324 ·
Los mantenedores suelen responder en 1 día
-
ci good first issue severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
TMHSDigital/subenum#323 ·
Los mantenedores suelen responder en 1 día
-
community documentation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
TMHSDigital/subenum#135 ·
Los mantenedores suelen responder en 1 día
Todos los issues de TMHSDigital/subenum
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
GillMacedo/godebugdiff#13 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
GillMacedo/racesift#14 ·
-
IsTextFile reads the whole file into memory (OOM on large files in the file watcher)Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
gtsteffaniak/filebrowser#3395 ·
Los mantenedores suelen responder en 1 día
-
effort:s impact:low raised-by:worker risk:low
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
medici-finance/assay#6496 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
kind/bug require/reproduce require/severity
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día