1 /* result.c - shell backend result reading function */
15 read_and_send_results(
31 /* read in the result and send it along */
32 buf = (char *) ch_malloc( BUFSIZ );
36 while ( fgets( line, sizeof(line), fp ) != NULL ) {
37 Debug( LDAP_DEBUG_SHELL, "shell search reading line (%s)\n",
39 /* ignore lines beginning with DEBUG: */
40 if ( strncasecmp( line, "DEBUG:", 6 ) == 0 ) {
44 while ( bp + len - buf > bsize ) {
46 buf = (char *) ch_realloc( buf, bsize );
51 /* line marked the end of an entry or result */
52 if ( *line == '\n' ) {
53 if ( strncasecmp( buf, "RESULT", 6 ) == 0 ) {
57 if ( (e = str2entry( buf )) == NULL ) {
58 Debug( LDAP_DEBUG_ANY, "str2entry(%s) failed\n",
61 send_search_entry( be, conn, op, e, attrs,
69 (void) str2result( buf, &err, &matched, &info );
71 /* otherwise, front end will send this result */
72 if ( err != 0 || op->o_tag != LDAP_REQ_BIND ) {
73 send_ldap_result( conn, op, err, matched, info );
89 for ( i = 0; be->be_suffix[i] != NULL; i++ ) {
90 fprintf( fp, "suffix: %s\n", be->be_suffix[i] );