Re: [dev] Re: iim - ii improved and rewriten
Cool, thanks.
On Mon, Jan 7, 2013 at 9:09 PM, Ivan Kanakarakis <ivan.kanak_AT_gmail.com> wrote:
> I've been tweaking ii's code lately, mainly cleaning it up
> and fixing a couple of things I noticed, but ended up
> rewriting it from scratch.
> Thus resulted iim[0] (name given by ^7heo on irc - thanks)
Can we add IPv6 support? I think this does it, though I'm not a pro.
It works for me, at least...
diff --git a/iim.c b/iim.c
index 436621f..7d224ae 100644
--- a/iim.c
+++ b/iim.c
_AT_@ -78,7 +78,7 @@ static int connect_to_irc(const char *host, const
char *port) {
if (getaddrinfo(host, port, &hints, &res) != 0) return 0;
for (struct addrinfo *ai = res; ai; ai = ai->ai_next) {
- if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) continue;
+ if ((sockfd = socket(ai->ai_family, SOCK_STREAM, 0))
== -1) continue;
if (connect(sockfd, res->ai_addr, res->ai_addrlen) == 0) break;
close(sockfd);
}
Received on Tue Jan 08 2013 - 04:45:08 CET
This archive was generated by hypermail 2.3.0
: Tue Jan 08 2013 - 04:48:04 CET