Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent crash when receiving GET requests #11

Closed
Anulo2 opened this issue Mar 31, 2024 · 1 comment
Closed

Prevent crash when receiving GET requests #11

Anulo2 opened this issue Mar 31, 2024 · 1 comment

Comments

@Anulo2
Copy link

Anulo2 commented Mar 31, 2024

context: https://discord.com/channels/353303527587708932/752593231681683657/1224110662247121088

was trying to do some http requests to intiface-engine to see if it supported it and the sw crashed. It should only handle ws requests and ignore http methods to prevent these crashes

replicate the bug:

start intiface-engine

In another terminal:

curl http://localhost:12345

error log:

024-03-31T21:59:12.692338Z TRACE tungstenite::handshake::server: Server handshake initiated.
2024-03-31T21:59:12.692350Z TRACE tungstenite::handshake::machine: Doing handshake round.
2024-03-31T21:59:12.692452Z ERROR buttplug::core::connector::transport::websocket::websocket_server: Websocket server accept error: Protocol(MissingConnectionUpgradeHeader)
2024-03-31T21:59:12.692510Z ERROR intiface_engine::engine: Process Error: ConnectorError("TransportSpecificError(TungsteniteError(Protocol(MissingConnectionUpgradeHeader)))")
2024-03-31T21:59:12.692521Z INFO intiface_engine::engine: Client forcefully disconnected from server.
2024-03-31T21:59:12.692527Z INFO intiface_engine::engine: Breaking out of event loop in order to exit
2024-03-31T21:59:12.692533Z INFO intiface_engine::engine: Shutting down server...
2024-03-31T21:59:12.692570Z INFO intiface_engine::engine: Exiting
2024-03-31T21:59:12.692585Z TRACE buttplug::server::device::server_device_manager_event_loop: Got device command message StopScanning
2024-03-31T21:59:12.692630Z DEBUG buttplug::server::device::server_device_manager_event_loop: Device event loop cancelled, exiting.
2024-03-31T21:59:12.692638Z DEBUG buttplug::server::device::server_device_manager_event_loop: Exiting Device Manager Loop
2024-03-31T21:59:12.694270Z ERROR buttplug::server::device::hardware::communication::btleplug::btleplug_adapter_task: Stop scanning request failed: No discovery started
2024-03-31T21:59:12.694286Z DEBUG buttplug::server::device::hardware::communication::btleplug::btleplug_adapter_task: Command stream closed. Exiting btleplug adapter loop.
2024-03-31T21:59:12.794684Z INFO buttplug::server::device::server_device_manager: Dropping device manager!

@qdot
Copy link
Contributor

qdot commented Apr 1, 2024

Yeah the engine gets VERY unhappy when the handshake is wrong. I'm gonna close this because this issue is actually back in the main library: buttplugio/buttplug#570

@qdot qdot closed this as completed Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants