Re: [dev] Re: iim - ii improved and rewriten

From: Ivan Kanakarakis <ivan.kanak_AT_gmail.com>
Date: Tue, 8 Jan 2013 11:46:44 +0200

Thanks for trying it out and reporting.
I also changed the hardcoded socket type.
Should be good now.



On 8 January 2013 05:45, Ryan Mullen <rmmullen_AT_gmail.com> wrote:
> 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);
> }
>



-- 
Ivan c00kiemon5ter V Kanakarakis  >:3
Received on Tue Jan 08 2013 - 10:46:44 CET

This archive was generated by hypermail 2.3.0 : Tue Jan 08 2013 - 10:48:05 CET