httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 44806] Set the IP address+port used for backend proxy requests.
Date Tue, 03 Jun 2008 19:29:34 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=44806





--- Comment #20 from D. Stussy <apache+bugreports@kd6lvw.ampr.org>  2008-06-03 12:29:33
PST ---
One last thing that I noticed:

apr_sockaddr_info_get(&(psf->bind_addr), ...

If NO DNS records matched, psf->bind_addr would be set to NULL, and we should
probably issue an error - and KEEP any prior list we happen to have (but I
don't think we will have a prior list - wouldn't the [prior] config pool be
released before the re-read?).  Should a second occurance of this command in
the same context be flagged as an error or just overwrite the first occurance?

Code:
...
+    /* Preparse the address */
+    apr_sockaddr_info_get(&(psf->bind_addr), host, APR_UNSPEC, port, 0,
parms->pool);
++   if (psf->bind_addr == NULL)
++       return "ProxyBindAddress:  Hostname did not resolve";
++  /* If an address literal was specified, that should have resolved. */
+
+    psf->bind_port = port;
...

Even if it's unnecessary, I don't see any harm in passing "port" to the
resolver.  Granted that if non-zero, it is lowest numbered port to use, but
zero vs. non-zero uses could be significant in the future.  You've questioned
why pass it?  I say why not?

> call_resolver seems to be doing a freeaddrinfo ...

Apr_sockaddr_info_get() sets it to NULL before call_resolver ever sees it. 
However, you seem to be correct in that the getaddrinfo() list does seem to be
freed.  We should release the copy of it allocated to the pool, as we may have
a memory leak - but it appears that such gets released only when the pool is
terminated as there's no way to release individual items allocated from a pool.
 If we know that the prior pool has already been released when the parser is
called, then I don't see a problem.  (I wish I were more familiar with Apache's
overall design.)


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message