Vely logo install
examples
documentation

Vely 15.2.0 released on Jan 18, 2023
Articles updated Jan 17, 2023

exit-request


Issues with this documentation page? Report here.

Purpose:


Exit current request processing.

Syntax:



exit-request


Description:


Exits current request by transferring control directly after the top-level request dispatcher. If there is an after_request_handler, it will still execute, unless exit-request is called from before_request_handler. exit-request will have no effect in startup_handler because that handler runs before any requests.

exit-request is useful when your request handler has called other functions (i.e. those implemented in non_request source files), which may have called others (etc.), and there is no need to return in the reverse order, nor to pass any further data back to them; in which case returning one step at a time may be cumbersome and error prone.

In other words, exit-request jumps to the top-level request dispatcher, and the stack of functions called to get to exit-request will be bypassed, thus those functions will not get control back; and they will not perform any additional work, rather simply the next request will be processed immediately.

Never user C's exit() function, as it will terminate the server process and prevent exit-code from functioning properly.

Examples:



#include "vely.h"

void req_handler()
{
    ...
    exit-request
    ...
}


See also:


Program flow ( exit-request  )  SEE ALL (documentation)



Copyright (c) 2022 DaSoftver LLC. Vely is a trademark of Dasoftver LLC. The software and information herein are provided "AS IS" and without any warranties or guarantees of any kind. Vely elephant logo (c) 2022 DaSoftver LLC. This web page is licensed under CC-BY-SA-4.0.