Skip to content

Commit

Permalink
Fixed regression from commit 1e116d0 preventing stdin data piping.
Browse files Browse the repository at this point in the history
  • Loading branch information
allinurl committed Dec 22, 2023
1 parent 399837d commit b49fb8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/goaccess.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@ parse_tail_follow (GLog *glog, FILE *fp) {
#endif
pthread_mutex_lock (&gdns_thread.mutex);
logitem = parse_line (glog, buf, 0);
printf("%s\n", buf);
if (logitem != NULL) {
if (logitem->errstr == NULL)
process_log (logitem);
Expand Down
8 changes: 6 additions & 2 deletions src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -2078,7 +2078,7 @@ read_lines (FILE *fp, GLog *glog, int dry_run) {
}

b = 0;
while (!feof (fp)) { // b = 0 or 1
while (1) { /* b = 0 or 1 */
for (k = 1; k < conf.jobs || (conf.jobs == 1 && k == 1); k++) {
#ifdef WITH_GETLINE
while ((jobs[b][k].lines[jobs[b][k].p] = fgetline (fp)) != NULL) {
Expand Down Expand Up @@ -2132,10 +2132,14 @@ read_lines (FILE *fp, GLog *glog, int dry_run) {
if (conf.stop_processing)
break;

/* check for EOF */
if (s == NULL)
break;

/* flip from block A/B to B/A */
if (conf.jobs > 1)
b = b ^ 1;
} // while (!eof)
} // while (1)

/* After eof, process last data */
for (b = 0; b < 2; b++) {
Expand Down

0 comments on commit b49fb8b

Please sign in to comment.