On Wed, Nov 02, 2022 at 04:38:00PM +0100, Claudio Jeker wrote: > Based on Job's work lets introduce conn_info() which prints the URI / > host plus the IP address. This may be helpful to better understand errors. > > With this ip_info() becomes much simpler. I also decided to not check > snprintf returns because the buffer is big enough and afaik encoding > errors can't happen with %s.
Yes, it should just copy the bytes over. > In http_connect() when hitting the error case after the for () loop needs > a to set conn->res to the last valid res used else it will print (unknown) > for the IP (since conn->res is NULL at that time). All makes sense. I like it. ok tb This could go on a single line: > @@ -818,7 +825,7 @@ http_do(struct http_connection *conn, en > break; > default: > errx(1, "%s: unexpected function return", > - http_info(conn->host)); > + conn_info(conn)); > } > } >