Skip to content

WebSocket: oversized client messages cause std::terminate crash #155

@MisterGC

Description

@MisterGC

Drogon's default WebSocket client message size limit is 128 KB. When a client (e.g. erdblick) sends a tile request that exceeds this limit, Drogon rejects the message and shuts down the connection. This triggers a cascade of errors:

  1. The size of the WebSocket message is too large! (Drogon rejects incoming frame)
  2. Unknown frame type (corrupted buffer parsing after rejection)
  3. Connection is not connected, give up sending (mapget tries to send on dead connection)
  4. std::terminate called, aborting (core dump)

The crash happens because Drogon calls handleNewMessage() and handleConnectionClosed() with no exception protection. Any exception propagating from mapget's WebSocket handlers terminates the process.

Two fixes needed:

  • Raise the client WS message size limit (128 KB is too small for large tile requests)
  • Add try-catch around WebSocket handler callbacks and conn->send() to prevent std::terminate

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions