From: Eric Wong <e@80x24.org>
To: mogilefs-client-public@bogomips.org
Subject: [PATCH 1/3] avoid pointless capture in regexp
Date: Thu, 29 Dec 2016 07:42:13 +0000 [thread overview]
Message-ID: <20161229074215.12425-2-e@80x24.org> (raw)
In-Reply-To: <20161229074215.12425-1-e@80x24.org>
We do not emit any sort of message on successful 2XX responses,
so there's no need to save the actual response after writing.
---
lib/mogilefs/new_file/common.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/mogilefs/new_file/common.rb b/lib/mogilefs/new_file/common.rb
index c102901..44eee69 100644
--- a/lib/mogilefs/new_file/common.rb
+++ b/lib/mogilefs/new_file/common.rb
@@ -23,7 +23,7 @@ def read_response(sock)
start_time = @opts[:start_time] and tout -= MogileFS.now - start_time
set_socket_options(sock)
case line = sock.timed_read(23, "", tout > 0.0 ? tout : 0)
- when %r{^HTTP/\d\.\d\s+(2\d\d)\s} # success!
+ when %r{^HTTP/\d\.\d\s+(?:2\d\d)\s} # success!
when nil
raise EmptyResponseError, 'Unable to read response line from server'
when %r{^HTTP/\d\.\d\s+(\d+)}
--
EW
next prev parent reply other threads:[~2016-12-29 7:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-29 7:42 [PATCH 0/3] misc cleanups Eric Wong
2016-12-29 7:42 ` Eric Wong [this message]
2016-12-29 7:42 ` [PATCH 2/3] use opt_str_freeze to avoid allocations in a few places Eric Wong
2016-12-29 7:42 ` [PATCH 3/3] new_file/common: simplify empty class declarations Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://yhbt.net/mogilefs-client/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161229074215.12425-2-e@80x24.org \
--to=e@80x24.org \
--cc=mogilefs-client-public@bogomips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhbt.net/mogilefs-client.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).