@@ -2610,11 +2610,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
2610
2610
int port = LDAP_DEF_PORT ,
2611
2611
scope ,
2612
2612
rc ,
2613
- msgid ,
2614
2613
size ,
2615
2614
state ,
2616
2615
oldstate ,
2617
2616
i ;
2617
+ #ifndef WIN32
2618
+ int msgid ;
2619
+ #endif
2618
2620
bool found_keyword ;
2619
2621
char * url ,
2620
2622
* hostname ,
@@ -2759,11 +2761,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
2759
2761
2760
2762
/*
2761
2763
* Perform an explicit anonymous bind.
2762
- * LDAP does not require that an anonymous bind is preformed explicitly,
2764
+ *
2765
+ * LDAP does not require that an anonymous bind is performed explicitly,
2763
2766
* but we want to distinguish between the case where LDAP bind does not
2764
2767
* succeed within PGLDAP_TIMEOUT seconds (return 2 to continue parsing
2765
2768
* the service control file) and the case where querying the LDAP server
2766
2769
* fails (return 1 to end parsing).
2770
+ *
2767
2771
* Unfortunately there is no way of setting a timeout that works for
2768
2772
* both Windows and OpenLDAP.
2769
2773
*/
@@ -2776,7 +2780,7 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
2776
2780
ldap_unbind (ld );
2777
2781
return 2 ;
2778
2782
}
2779
- #else /* WIN32 */
2783
+ #else /* ! WIN32 */
2780
2784
/* in OpenLDAP, use the LDAP_OPT_NETWORK_TIMEOUT option */
2781
2785
if (ldap_set_option (ld , LDAP_OPT_NETWORK_TIMEOUT , & time ) != LDAP_SUCCESS )
2782
2786
{
@@ -3031,7 +3035,8 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
3031
3035
3032
3036
return 0 ;
3033
3037
}
3034
- #endif
3038
+
3039
+ #endif /* USE_LDAP */
3035
3040
3036
3041
#define MAXBUFSIZE 256
3037
3042
0 commit comments