cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH] Re: info about connection (ip/port)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 28 May 2010 00:34:09 +0200 (CEST)

On Thu, 27 May 2010, Frank Meier wrote:

> here's a new patch with fixed formatting. I don't know what was wrong with
> line 73 of the old one, maybe I messed something up. But I applied this one
> against an untouched curl-7.20.1 dir (patch -p1 < curl-withipinfo.patch2) ,
> and no problem occurred.

Right, this didn't have that bad line but it doesn't apply cleanly to current
git. I had to do some minor manual tweaks to get it applied. It'll be easier
for us if you work against that version...

A few comments:

A) 'struct sockaddr_storage' cannot be assumed to be around universally. You
    can however use 'struct Curl_sockaddr_storage' instead. You'll find that
    you need to adapt the code slightly to that.

B) inet_ntop() cannot be assumed, use Curl_inet_ntop().

C) conn->ip_addr_str already contains the remote IP address of the current
    connection you can copy it from there!

D) I'd like to see these new informational options to also get documented
    in the curl_easy_getinfo.3 man page so that people will be able to use
    them!

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-05-28