Browse Source

Ticket 47510 - 389-ds-base does not compile against MozLDAP libraries

Used #ifdef's to remove openldap specific API calls.

Thanks to mvocu for providing the initial patch.

https://fedorahosted.org/389/ticket/47510

Reviewed by: rmeggins(Thanks!)
Mark Reynolds 12 years ago
parent
commit
069657f1b3
2 changed files with 10 additions and 3 deletions
  1. 5 3
      ldap/servers/slapd/daemon.c
  2. 5 0
      ldap/servers/slapd/slapi-plugin.h

+ 5 - 3
ldap/servers/slapd/daemon.c

@@ -2541,8 +2541,9 @@ bail:
 void
 handle_closed_connection(Connection *conn)
 {
-	ber_sockbuf_remove_io(conn->c_sb, &openldap_sockbuf_io,
-		LBER_SBIOD_LEVEL_PROVIDER);
+#ifdef USE_OPENLDAP
+	ber_sockbuf_remove_io(conn->c_sb, &openldap_sockbuf_io,	LBER_SBIOD_LEVEL_PROVIDER);
+#endif
 }
 
 /* NOTE: this routine is not reentrant */
@@ -2628,8 +2629,9 @@ handle_new_connection(Connection_Table *ct, int tcps, PRFileDesc *pr_acceptfd, i
 	}
 #endif /* !USE_OPENLDAP */
 	maxbersize = config_get_maxbersize();
+#if defined(USE_OPENLDAP)
 	ber_sockbuf_ctrl( conn->c_sb, LBER_SB_OPT_SET_MAX_INCOMING, &maxbersize );
-
+#endif
 	if( secure && config_get_SSLclientAuth() != SLAPD_SSLCLIENTAUTH_OFF ) { 
 	    /* Prepare to handle the client's certificate (if any): */
 		int rv;

+ 5 - 0
ldap/servers/slapd/slapi-plugin.h

@@ -374,6 +374,11 @@ NSPR_API(PRUint32) PR_fprintf(struct PRFileDesc* fd, const char *fmt, ...)
 #define LDAP_MAXINT (2147483647)
 #endif
 
+/* for mozldap builds */
+#ifndef LDAP_CANCELLED
+#define LDAP_CANCELLED 0x76
+#endif
+
 /*
  * Sequential access types
  */