Skip to content

Commit

Permalink
Track activity only on read (Issue #338)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Feb 9, 2024
1 parent 93663bc commit 06f8942
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ Changes in v1.4.6
- Fixed reporting of "printer-strings-languages-supported" attribute
(Issue #328)
- Fixed saving of "print-darkness-default" value (Issue #330)
- Fixed incoming "raw" print socket acceptance when max-active-jobs is 0
(Issue #331)
- Fixed incoming "raw" print socket support (Issue #331 and #338)
- Fixed web interface support for "printer-darkness" (Issue #333)
- Fixed some issues discovered by OpenScanHub (Issue #335)
- Fixed localization of command-line (main loop) interface.
Expand Down
6 changes: 3 additions & 3 deletions pappl/printer-raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,18 +168,18 @@ _papplPrinterRunRaw(
break;
}

if ((bytes = poll(&sockp, 1, 1000)) < 0)
if ((bytes = poll(&sockp, 1, 1000)) <= 0)
{
if ((time(NULL) - activity) >= 60)
break;
else
continue;
}

activity = time(NULL);

if (sockp.revents & POLLIN)
{
activity = time(NULL);

if ((bytes = recv(sock, buffer, sizeof(buffer), 0)) > 0)
write(job->fd, buffer, (size_t)bytes);
else
Expand Down

0 comments on commit 06f8942

Please sign in to comment.