yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
* [PATCH] http_client: do not warn on do_pread overreach
@ 2018-12-08 11:39 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2018-12-08 11:39 UTC (permalink / raw)
  To: yahns-public

Without sendfile, we can hit EOFError on IO#pread
if a file we're serving gets truncated mid-response.
This was causing test_truncated_sendfile failures;
but I didn't notice before because I forgot to set
SENDFILE_BROKEN=1 to disable the test.
---
 lib/yahns/http_client.rb | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/yahns/http_client.rb b/lib/yahns/http_client.rb
index d55a0db..8744053 100644
--- a/lib/yahns/http_client.rb
+++ b/lib/yahns/http_client.rb
@@ -332,7 +332,6 @@ def do_pread(io, count, offset)
       io.read(count, buf)
     end
   rescue EOFError
-    warn "BUG: do_pread overreach:\n #{caller.join("\n ")}\n"
     nil
   end
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-12-08 11:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-08 11:39 [PATCH] http_client: do not warn on do_pread overreach Eric Wong

Code repositories for project(s) associated with this inbox:

	../../../yahns.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).