cleanup dead code

This commit is contained in:
Howard Chu 2006-03-31 21:07:53 +00:00
parent 28191d7642
commit aa87b9ad2e
3 changed files with 67 additions and 64 deletions

View file

@ -452,58 +452,6 @@ ldap_set_option(
}
} return LDAP_OPT_SUCCESS;
/* Only accessed from inside this function by ldap_set_rebind_proc() */
case LDAP_OPT_REBIND_PROC: {
lo->ldo_rebind_proc = (LDAP_REBIND_PROC *)invalue;
} return LDAP_OPT_SUCCESS;
case LDAP_OPT_REBIND_PARAMS: {
lo->ldo_rebind_params = (void *)invalue;
} return LDAP_OPT_SUCCESS;
/* Only accessed from inside this function by ldap_set_nextref_proc() */
case LDAP_OPT_NEXTREF_PROC: {
lo->ldo_nextref_proc = (LDAP_NEXTREF_PROC *)invalue;
} return LDAP_OPT_SUCCESS;
case LDAP_OPT_NEXTREF_PARAMS: {
lo->ldo_nextref_params = (void *)invalue;
} return LDAP_OPT_SUCCESS;
}
if(invalue == NULL) {
/* no place to set from */
return LDAP_OPT_ERROR;
}
/* options which cannot withstand invalue == NULL */
switch(option) {
case LDAP_OPT_API_INFO:
case LDAP_OPT_DESC:
/* READ ONLY */
break;
case LDAP_OPT_DEREF:
lo->ldo_deref = * (const int *) invalue;
return LDAP_OPT_SUCCESS;
case LDAP_OPT_SIZELIMIT:
lo->ldo_sizelimit = * (const int *) invalue;
return LDAP_OPT_SUCCESS;
case LDAP_OPT_TIMELIMIT:
lo->ldo_timelimit = * (const int *) invalue;
return LDAP_OPT_SUCCESS;
case LDAP_OPT_PROTOCOL_VERSION: {
int vers = * (const int *) invalue;
if (vers < LDAP_VERSION_MIN || vers > LDAP_VERSION_MAX) {
/* not supported */
break;
}
lo->ldo_version = vers;
} return LDAP_OPT_SUCCESS;
case LDAP_OPT_HOST_NAME: {
const char *host = (const char *) invalue;
LDAPURLDesc *ludlist = NULL;
@ -594,6 +542,57 @@ ldap_set_option(
return rc;
}
/* Only accessed from inside this function by ldap_set_rebind_proc() */
case LDAP_OPT_REBIND_PROC: {
lo->ldo_rebind_proc = (LDAP_REBIND_PROC *)invalue;
} return LDAP_OPT_SUCCESS;
case LDAP_OPT_REBIND_PARAMS: {
lo->ldo_rebind_params = (void *)invalue;
} return LDAP_OPT_SUCCESS;
/* Only accessed from inside this function by ldap_set_nextref_proc() */
case LDAP_OPT_NEXTREF_PROC: {
lo->ldo_nextref_proc = (LDAP_NEXTREF_PROC *)invalue;
} return LDAP_OPT_SUCCESS;
case LDAP_OPT_NEXTREF_PARAMS: {
lo->ldo_nextref_params = (void *)invalue;
} return LDAP_OPT_SUCCESS;
}
if(invalue == NULL) {
/* no place to set from */
return LDAP_OPT_ERROR;
}
/* options which cannot withstand invalue == NULL */
switch(option) {
case LDAP_OPT_API_INFO:
case LDAP_OPT_DESC:
/* READ ONLY */
break;
case LDAP_OPT_DEREF:
lo->ldo_deref = * (const int *) invalue;
return LDAP_OPT_SUCCESS;
case LDAP_OPT_SIZELIMIT:
lo->ldo_sizelimit = * (const int *) invalue;
return LDAP_OPT_SUCCESS;
case LDAP_OPT_TIMELIMIT:
lo->ldo_timelimit = * (const int *) invalue;
return LDAP_OPT_SUCCESS;
case LDAP_OPT_PROTOCOL_VERSION: {
int vers = * (const int *) invalue;
if (vers < LDAP_VERSION_MIN || vers > LDAP_VERSION_MAX) {
/* not supported */
break;
}
lo->ldo_version = vers;
} return LDAP_OPT_SUCCESS;
case LDAP_OPT_ERROR_NUMBER: {
int err = * (const int *) invalue;

View file

@ -93,7 +93,6 @@ ldap_send_initial_request(
BerElement *ber,
ber_int_t msgid)
{
LDAPURLDesc *servers;
int rc;
Debug( LDAP_DEBUG_TRACE, "ldap_send_initial_request\n", 0, 0, 0 );
@ -112,14 +111,6 @@ ldap_send_initial_request(
0, 0, 0 );
}
{
/*
* use of DNS is turned off or this is an X.500 DN...
* use our default connection
*/
servers = NULL;
}
#ifdef LDAP_CONNECTIONLESS
if (LDAP_IS_UDP(ld)) {
if (msgtype == LDAP_REQ_BIND) {
@ -136,12 +127,10 @@ ldap_send_initial_request(
ldap_pvt_thread_mutex_lock( &ld->ld_req_mutex );
#endif
rc = ldap_send_server_request( ld, ber, msgid, NULL,
servers, NULL, NULL );
NULL, NULL, NULL );
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock( &ld->ld_req_mutex );
#endif
if (servers)
ldap_free_urllist(servers);
return(rc);
}

View file

@ -3235,6 +3235,21 @@ ldap_str2nameform( LDAP_CONST char * s,
seen_obsolete = 1;
nf->nf_obsolete = LDAP_SCHEMA_YES;
parse_whsp(&ss);
} else if ( !strcasecmp(sval,"OC") ) {
LDAP_FREE(sval);
if ( seen_class ) {
*code = LDAP_SCHERR_DUPOPT;
*errp = ss;
ldap_nameform_free(nf);
return(NULL);
}
seen_class = 1;
nf->nf_objectclass = parse_woid(&ss,code);
if ( !nf->nf_objectclass ) {
*errp = ss;
ldap_nameform_free(nf);
return NULL;
}
} else if ( !strcasecmp(sval,"MUST") ) {
LDAP_FREE(sval);
if ( seen_must ) {