On Wednesday, 15 March 2023 at 02:02:26 UTC+3 Vitaly Orekhov wrote:

   - If pidfile is defined in Prosody configuration, closing Prosody by 
   clicking Close button or killing the server via Task Manager will keep 
   pidfile in the filesystem
      - This might prevent Prosody from starting, falsely claiming that 
      pidfile is already occupied. Double check that Prosody isn't running (or 
      pidfile is not write-protected) and delete it. After that, Prosody will 
      start normally.
   
Got a bit of time to revisit the problem.
SetConsoleCtrlHandler 
<https://learn.microsoft.com/en-us/windows/console/setconsolectrlhandler> 
allows 
me to add a handler that will trigger when user closes the window 
containing the running instance of Prosody. Thus it gives us an option to 
close the server cleanly, as "server-stopping" event is properly fired. But 
I have something to clarify: in the current implementation of the handler, 
lua_State* is exposed 
<https://prosody.im/pastebin/abf9299c-133c-4308-bb04-997ff0897849> to the 
global scope, and there is no way (by Windows API design) to throw thing 
directly into the handler. Not sure if I am too paranoid on this, but could 
this do anything bad from any of perspectives, including security?

In the meantime, I'm cleaning up the Visual Studio solution to prepare it 
to get into prosody-windows <https://hg.prosody.im/windows/> repository. 
There's still stuff to redo.

-- 
You received this message because you are subscribed to the Google Groups 
"prosody-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to prosody-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prosody-dev/812e079e-124b-4298-a3c7-5fec7f05a50fn%40googlegroups.com.

Reply via email to