added case path null
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user