Merge pull request #1 from helloIAmPau/master

Websocket server URL with no path in the end are not parsed! (but now they are)
This commit is contained in:
David Baird
2013-04-27 10:34:32 -07:00
+2
View File
@@ -265,6 +265,8 @@ WebSocket::pointer WebSocket::from_url(std::string url) {
else if (sscanf(url.c_str(), "ws://%[^/]/%s", host, path) == 2) { else if (sscanf(url.c_str(), "ws://%[^/]/%s", host, path) == 2) {
port = 80; port = 80;
} }
else if (sscanf(url.c_str(), "ws://%[^:]:%d", host, &port) == 2) {
}
else { else {
fprintf(stderr, "ERROR: Could not parse WebSocket url: %s\n", url.c_str()); fprintf(stderr, "ERROR: Could not parse WebSocket url: %s\n", url.c_str());
return NULL; return NULL;