kgio RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: kgio@librelist.org
Subject: [PATCH 2/2] accept: more informative exception on unknown family
Date: Fri, 16 Aug 2013 02:09:28 +0000	[thread overview]
Message-ID: <1376618968-13492-3-git-send-email-normalperson@yhbt.net> (raw)
In-Reply-To: 1376618968-13492-1-git-send-email-normalperson@yhbt.net

This may help us diagnose issues on strange OSes.
---
 ext/kgio/accept.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ext/kgio/accept.c b/ext/kgio/accept.c
index 503b5e9..67a8ded 100644
--- a/ext/kgio/accept.c
+++ b/ext/kgio/accept.c
@@ -143,7 +143,9 @@ static VALUE in_addr_set(VALUE io, struct sockaddr_storage *addr, socklen_t len)
 		host_len = (long)INET6_ADDRSTRLEN;
 		break;
 	default:
-		rb_raise(rb_eRuntimeError, "unsupported address family");
+		rb_raise(rb_eRuntimeError,
+		         "unsupported address family: ss_family=%lu (socklen=%ld)",
+			 (unsigned long)addr->ss_family, (long)len);
 	}
 	host = rb_str_new(NULL, host_len);
 	host_ptr = RSTRING_PTR(host);
-- 
1.8.2.rc3.2.geae6cf5



  parent reply	other threads:[~2013-08-16  2:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-16  2:09 [PATCH 0/2] minor tweaks for potentially buggy platforms Eric Wong
2013-08-16  2:09 ` [PATCH 1/2] check syscall returns against < 0 instead of == -1 Eric Wong
2013-08-16  2:09 ` Eric Wong [this message]
2013-08-16  2:15 ` [PATCH 0/2] minor tweaks for potentially buggy platforms 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/kgio/

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

  git send-email \
    --in-reply-to=1376618968-13492-3-git-send-email-normalperson@yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=kgio@librelist.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/kgio.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).