@@ -3362,11 +3362,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
33623362 int port = LDAP_DEF_PORT ,
33633363 scope ,
33643364 rc ,
3365- msgid ,
33663365 size ,
33673366 state ,
33683367 oldstate ,
33693368 i ;
3369+ #ifndef WIN32
3370+ int msgid ;
3371+ #endif
33703372 bool found_keyword ;
33713373 char * url ,
33723374 * hostname ,
@@ -3511,11 +3513,13 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
35113513
35123514 /*
35133515 * Perform an explicit anonymous bind.
3514- * LDAP does not require that an anonymous bind is preformed explicitly,
3516+ *
3517+ * LDAP does not require that an anonymous bind is performed explicitly,
35153518 * but we want to distinguish between the case where LDAP bind does not
35163519 * succeed within PGLDAP_TIMEOUT seconds (return 2 to continue parsing
35173520 * the service control file) and the case where querying the LDAP server
35183521 * fails (return 1 to end parsing).
3522+ *
35193523 * Unfortunately there is no way of setting a timeout that works for
35203524 * both Windows and OpenLDAP.
35213525 */
@@ -3528,7 +3532,7 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
35283532 ldap_unbind (ld );
35293533 return 2 ;
35303534 }
3531- #else /* WIN32 */
3535+ #else /* ! WIN32 */
35323536 /* in OpenLDAP, use the LDAP_OPT_NETWORK_TIMEOUT option */
35333537 if (ldap_set_option (ld , LDAP_OPT_NETWORK_TIMEOUT , & time ) != LDAP_SUCCESS )
35343538 {
@@ -3783,7 +3787,8 @@ ldapServiceLookup(const char *purl, PQconninfoOption *options,
37833787
37843788 return 0 ;
37853789}
3786- #endif
3790+
3791+ #endif /* USE_LDAP */
37873792
37883793#define MAXBUFSIZE 256
37893794
0 commit comments