]> git.sur5r.net Git - openldap/blobdiff - libraries/librewrite/context.c
(Partial) Sync with HEAD
[openldap] / libraries / librewrite / context.c
index 281fbb4550c7761a3830a17f12801f0dcc788d88..bfa1b77d17c5604aeecd212b3a68faf8e3c03523 100644 (file)
@@ -357,6 +357,15 @@ rewrite_context_apply(
                                                        goto rc_end_of_context;
                                                }
                                                break;
+
+                                       /*
+                                        * This ends the rewrite context
+                                        * and returns a user-defined
+                                        * error code
+                                        */
+                                       case REWRITE_ACTION_USER:
+                                               return_code = ((int *)action->la_args)[ 0 ];
+                                               goto rc_end_of_context;
                                        
                                        default:
                                                /* ... */
@@ -385,10 +394,17 @@ rewrite_context_apply(
                 * This will instruct the server to return
                 * an `unwilling to perform' error message
                 */
-                case REWRITE_REGEXEC_UNWILLING:
+               case REWRITE_REGEXEC_UNWILLING:
                        return_code = REWRITE_REGEXEC_UNWILLING;
                        goto rc_end_of_context;
 
+               /*
+                * A user-defined error code has propagated ...
+                */
+               default:
+                       assert( rc >= REWRITE_REGEXEC_USER );
+                       goto rc_end_of_context;
+
                }
                
 rc_continue:;  /* sent here by actions that require to continue */