capture path/uri when connecting, and pass it back through callbacks in the openInfo member

This commit is contained in:
Benjamin Sergeant
2019-01-03 17:44:10 -08:00
parent 6ac3bdb94a
commit bd1c8873d0
13 changed files with 64 additions and 42 deletions

View File

@@ -40,9 +40,8 @@ namespace ix
[this](uint16_t code, const std::string& reason, size_t wireSize)
{
_onMessageCallback(WebSocket_MessageType_Close, "", wireSize,
WebSocketErrorInfo(),
WebSocketCloseInfo(code, reason),
WebSocketHttpHeaders());
WebSocketErrorInfo(), WebSocketOpenInfo(),
WebSocketCloseInfo(code, reason));
}
);
}
@@ -119,8 +118,9 @@ namespace ix
}
_onMessageCallback(WebSocket_MessageType_Open, "", 0,
WebSocketErrorInfo(), WebSocketCloseInfo(),
status.headers);
WebSocketErrorInfo(),
WebSocketOpenInfo(status.uri, status.headers),
WebSocketCloseInfo());
return status;
}
@@ -138,8 +138,9 @@ namespace ix
}
_onMessageCallback(WebSocket_MessageType_Open, "", 0,
WebSocketErrorInfo(), WebSocketCloseInfo(),
status.headers);
WebSocketErrorInfo(),
WebSocketOpenInfo(status.uri, status.headers),
WebSocketCloseInfo());
return status;
}
@@ -184,8 +185,8 @@ namespace ix
connectErr.reason = status.errorStr;
connectErr.http_status = status.http_status;
_onMessageCallback(WebSocket_MessageType_Error, "", 0,
connectErr, WebSocketCloseInfo(),
WebSocketHttpHeaders());
connectErr, WebSocketOpenInfo(),
WebSocketCloseInfo());
std::this_thread::sleep_for(duration);
}
@@ -240,8 +241,8 @@ namespace ix
webSocketErrorInfo.decompressionError = decompressionError;
_onMessageCallback(webSocketMessageType, msg, wireSize,
webSocketErrorInfo, WebSocketCloseInfo(),
WebSocketHttpHeaders());
webSocketErrorInfo, WebSocketOpenInfo(),
WebSocketCloseInfo());
WebSocket::invokeTrafficTrackerCallback(msg.size(), true);
});