everything related to duct tape audio suite (dtas)
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: <dtas-all@nongnu.org>
Cc: Eric Wong <e@80x24.org>
Subject: [PATCH] favor recv and recv_nonblock over recvmsg variants
Date: Tue, 16 Jun 2015 00:36:51 +0000
Message-ID: <1434415011-23055-1-git-send-email-e@80x24.org> (raw)

We never use the full return value of the recvmsg* methods,
so those allocations are wasted.
 lib/dtas/unix_accepted.rb | 2 +-
 lib/dtas/unix_client.rb   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/dtas/unix_accepted.rb b/lib/dtas/unix_accepted.rb
index c08d431..a0000cf 100644
--- a/lib/dtas/unix_accepted.rb
+++ b/lib/dtas/unix_accepted.rb
@@ -56,7 +56,7 @@ class DTAS::UNIXAccepted # :nodoc:
-        msg, _, _ = io.recvmsg_nonblock(nread, 0, 0)
+        msg = io.recv_nonblock(nread)
       rescue Errno::EAGAIN
         return :wait_readable
       rescue EOFError, SystemCallError
diff --git a/lib/dtas/unix_client.rb b/lib/dtas/unix_client.rb
index fbb1510..2c8ba43 100644
--- a/lib/dtas/unix_client.rb
+++ b/lib/dtas/unix_client.rb
@@ -41,6 +41,6 @@ class DTAS::UNIXClient # :nodoc:
     IO.select([@to_io], nil, nil, timeout)
     nr = @to_io.nread
     nr > 0 or raise EOFError, "unexpected EOF from server"
-    @to_io.recvmsg(nr, 0, 0)[0]
+    @to_io.recv(nr)

                 reply	other threads:[~2015-06-16  0:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:

  List information: https://80x24.org/dtas/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1434415011-23055-1-git-send-email-e@80x24.org \
    --to=e@80x24.org \
    --cc=dtas-all@nongnu.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

everything related to duct tape audio suite (dtas)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://80x24.org/dtas-all
	git clone --mirror http://ou63pmih66umazou.onion/dtas-all

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 dtas-all dtas-all/ https://80x24.org/dtas-all \
	public-inbox-index dtas-all

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git