mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-22 21:50:51 -05:00
ws_connect(), query_boxes_info() and start_print() set expires_after() deadlines, then made synchronous Beast calls. Beast only applies those deadlines to async operations, so none of them fired. A printer that accepted the websocket and then stopped answering blocked the caller forever. That froze the GUI thread when the Creality send dialog opened or the sidebar synced filaments, and left uploads stuck after the file arrived. Run every websocket call as an async operation on the local io_context, so the deadlines apply. run_until_done() and the per-address connect loop move from MoonrakerPrinterAgent.cpp into AsioUtils.hpp, and both files share them. Each resolved address gets its own connect deadline, and start_print() gets a reply deadline for its commands. A start-print timeout shows the translated timeout message that HTTP timeouts already use, now shared through PrintHost::timed_out_message(), and other websocket errors drop Boost's source location. The websocket port and deadlines move into a protected ws_settings member, so the tests can use a local port and short deadlines. The new tests run CrealityPrint against a fake printer that goes silent before or after the handshake.
OrcaSlicer tests
Building, running and writing tests is documented on the wiki, under How to Test.
Two files here rather than there, because coding agents only read what is in the repository: