Re: [reSIProcate] DnsUtil.cxx
Hi,
I also had a small problem with getLocalHostName() being called on
application startup.
On my windows box my application shows the following log-message on startup:
INFO | 20120810-134241.423 | | RESIP:DNS | 8048 | DnsUtil.cxx:156 |
local hostname does not contain a domain part gabriel-laptop
This message can not be supppressed, since the corresponding code runs
before the first line in main(). Making the localhostname a
function-scope static as suggested by Byron solved the problem for me.
The patch is attached.
Best reagrds,
gabriel
Am 06.08.2012 19:45, schrieb Byron Campen:
Shouldn't this be a function-scope static anyway?
Best regards,
Byron Campen
On Aug 6, 2012 9:22 AM, "Mike Hubbard" <mike.hubbard@xxxxxxx> wrote:
Hi Scott,****
** **
The delay occurs every time I start the application. It is the
getaddrinfo() API call that is causing the delay.****
** **
Mike****
** **
*From:* slgodin@xxxxxxxxx [mailto:slgodin@xxxxxxxxx] *On Behalf Of *Scott
Godin
*Sent:* Monday, August 06, 2012 9:17 AM
*To:* Mike Hubbard
*Cc:* resiprocate-devel@xxxxxxxxxxxxxxx
*Subject:* Re: [reSIProcate] DnsUtil.cxx****
** **
Hi Mike,****
** **
I have not noticed this problem on my systems (Windows 7 with IPv6
enabled). I have some applications using resip statically and some using
it in a DLL. Does the delay only happen when the machine is starting up,
or everytime you start your application? Are you able to put a break point
in DnsUtil::getLocalHostName to see which API is causing the delay? Note:
getLocalHostName also calls initNetwork - which calls WSAStartup.****
** **
Scott****
On Sat, Aug 4, 2012 at 1:38 PM, Mike Hubbard <mike.hubbard@xxxxxxx> wrote:
****
Hello,****
****
I noticed in the most recent version of reciprocate that the routine
getLocalHostName() in the file DnsUtil.cxx has changed. This routine seems
to be called by Helper.cxx in the following line of code:****
****
static Data localhostname = DnsUtil::getLocalHostName();****
****
This occurs when my .dll is loaded even before the first line of the
main() routine is executed in the .exe. On certain machines (mostly
Windows 7 with IPv6 enabled) the new call to getaddrinfo() is taking over 2
minutes to return. Then my code breaks on the first line of the main()
function.****
****
Is anyone else experiencing a similar problem? If so, do you have any
advice?****
****
Thanks in advance,****
Mike****
_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/resiprocate-devel****
** **
_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/resiprocate-devel
_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/resiprocate-devel
Index: resip/stack/Helper.cxx
===================================================================
--- resip/stack/Helper.cxx (revision 9866)
+++ resip/stack/Helper.cxx (working copy)
@@ -645,10 +645,10 @@
}
-static Data localhostname = DnsUtil::getLocalHostName();
Data
Helper::computeCallId()
{
+ static Data localhostname = DnsUtil::getLocalHostName();
Data hostAndSalt(localhostname + Random::getRandomHex(16));
#ifndef USE_SSL // .bwc. None of this is neccessary if we're using openssl
#if defined(__linux__) || defined(__APPLE__)