Fix http handler registration (dev → stage) #50
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pre-register handle_request via constructor to fix all routes returning no http handler registered.
elb links without -rdynamic so dlsym(RTLD_DEFAULT, "handle_request") returns NULL at runtime. http_set_handler stores the name as active but never finds a function pointer, causing every request to return "el-runtime: no http handler registered" even after http_serve is called. Fix: add a __attribute__((constructor)) in web_stubs.c that calls el_runtime_register_handler("handle_request", handle_request) directly, bypassing dlsym entirely. The handler is in the registry before main() runs, so http_lookup_active() finds it on the first request.