zaphoyd/websocketpp — Issue #54: Policy-Refactor: Problem on multimple clients connections
Author: megabyte1024
Created: 2012-01-24 09:30:34+00:00
State: open

file: uri.cpp
method: the uri class constructor
problem description: if multiple clients call the endpoint's connect method in parallel, then all of them try to instance the static boost::regex expression. The result is an assert and crash somewhere inside of the boost::regex class.
fix:

- static const boost::regex expression("(ws|wss)://([^/:\\[]+|\\[[0-9a-fA-F:.]+\\])(:\\d{1,5})?(/[^#]*)?");
+ const boost::regex expression("(ws|wss)://([^/:\\[]+|\\[[0-9a-fA-F:.]+\\])(:\\d{1,5})?(/[^#]*)?");