Do not call GetAddrInfoW if we just want the hostname
commitafc41a467fdfabb2cd0879be3e4f1879a1d1dc91
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Thu, 10 Dec 2020 08:31:29 +0000 (10 09:31 +0100)
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Thu, 10 Dec 2020 13:21:15 +0000 (10 14:21 +0100)
treec7a5a42c7a656576876b320f16eeb88d1fd70a20
parent248ceefbbc3be28f7192b986d5d34985106268e1
Do not call GetAddrInfoW if we just want the hostname

Calling 'gethostname' already gives us the current host name on Windows.
For some reason, if that name does not contain a dot, GetAddrInfoW is
called, which "provides protocol-independent translation from a Unicode
host name to an address".

So all this function does, is returning an address for a hostname,
while we still only need the hostname and not the address.

This causes a lag when creating the lockfile on opening a document
if the network is flaky/disabled.
See tdf#97931 and tdf#47179 for some problems caused by this.

Change-Id: I0c543ea12c23506b2daa50da40bae1a471f6fe16
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107513
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
sal/osl/w32/socket.cxx