lync: speed up autodiscover
commit39d17d6fe7d7d162cb56440fd69290a40266c6cd
authorJakub Adam <jakub.adam@ktknet.cz>
Mon, 24 Oct 2016 10:50:18 +0000 (24 12:50 +0200)
committerJakub Adam <jakub.adam@ktknet.cz>
Thu, 10 Nov 2016 11:26:24 +0000 (10 12:26 +0100)
tree99807a08087aab9d961c2f92cb735de8d9d75a8c
parent775e803aae55c5d36e7a290202d122942c6addd6
lync: speed up autodiscover

Autodiscovery first tries HTTP and if it fails, switches to HTTPS. I've
seen a Lync deployment where LyncDiscoverInternal.domain.com wouldn't
answer on HTTP port (as if server's SYN-ACK reply were dropped by
a firewall along the way) and Sipe had to wait for the underlying TCP
socket to time out before successfully trying HTTPS. Consequently it
took tens of seconds to a minute to log in.

This change eliminates the long timeout by making both HTTP and HTTPS
requests in parallel, processing whichever reply comes first and
canceling the other. Login times are now comparable to the state before
Lync autodiscovery was introduced.

The parallel requests are allowed in [MS-OCDISCWS] 3.2.1.1 Discovery of
Autodiscover.
src/core/sipe-lync-autodiscover.c