From: Brian W. <bwe...@xb...> - 2011-12-12 00:48:45
|
On Nov 29, 2011, at 5:41 AM, Bauersachs Ingo wrote: > Hey Brian > > I'm trying to integrate DNSJAVA's SPI in Jitsi and had a few issues: > - Some JVM internals (seed generation for randomness) call InetAddress.getLocalHost. This causes a lookup to the configured DNS server, which usually doesn't know of localhost (or on Windows, my machine name). I'm not sure if this is usually the case. It's the case sometimes, but it depends on a lot of things. > - SSL/TLS sockets try to obtain the hostname from InetAddress objects, which causes PTR query when the InetAdresses object was not pre-initialized with the hostname. > > Attached is a patch to DNSJAVA that solves these issues. Would you mind applying it to trunk? I think some of it can be applied, but not all. The changes to ARecord/AAAARecord look ok. I believe someone else suggested similar changes at some point, and I don't think there are any downsides. I'll commit this part. The change in Address might be ok, but I don't know why setting the hostname to a literal address representation is an improvement over not being set. If it is a good idea, then all the other places in Address doing the same things should also be changed. The SPI changes are not backwards compatible in the case where a lookup of localhost would work, which is almost always the case on non-Windows machine, and often the case on Windows machines. Specifically, an application looking up "localhost" might get any combination of 127.0.0.1, ::1, or a routable address, depending on the configuration of the machine and the local DNS server. This also uses undocumented internal classes, and I have no way of knowing whether the code would work at all across the set of supported platforms and Java versions. > The unit tests all ran fine (apart from DNSSECWithLunaProviderTest which I excluded because of the dependency; and an IP of a colorado.edu server changed). > > More of a general question: The project uses a very unusual file-layout for Java projects and the Ant buildscript also needed some modifications to get the stuff running. Would it be an option to bring that in a more "standard"-compliant layout? I'd help of course if you're interested. :-) The dnsjava code base precedes whichever standard you're talking about, and in the 13 years or so that I've been developing it, there have been more standards than I can count. I don't see any reason to change everything to comply with the current one. Brian |