yaws
yaws copied to clipboard
when reconfiguring, no check for changed appmods is done
https://github.com/erlyaws/yaws/blob/d54b360aebe1130c8ecb39cd54acd7487be7ef24/src/yaws_api.erl#L2698
When running Yaws in embedded mode, and you want to disable an appmod; using the yaws_api:setconf/2 does not seem to take into account that any appmod config may have changed. Hence, the appmod may be still be invoked (or not) even if it has been removed (added).
To test my hypothesis, in our application code I called yaws_config:hard_setconfig/2 instead of yaws_api:setconf/2 and now, since the currently running processes are killed, it works as expected to add/remove appmods when reconfiguring.
So I'm not sure if it is ok to change the behaviour of the current yaws_api:setconf/2 function, or if we should add a new function "yaws_api:hard_setconf/2" (or just call yaws_config:hard_setconfig/2 , but that is a bit ugly imo...).
Cheers, Tobbe
Thanks for the details, will take a closer look.
Seems like we should change yaws_config:soft_setconf/4
to examine appmods for each server config and deal with them appropriately. I'll make this change on a branch so you can try it out.
[update] This really means that the yaws_server
calls for updating, deleting, and adding server configs, or functions they call, will have to be taught to handle appmods.
ok, perhaps a simple first approach could be to just open up yaws_api.erl to have a function for hard_setconf/2.