Fix fail to get Sources in RTSP. the string msg although initially reserved to ZM_NETWORK_BUFSIZ, after use it's capacity is changed whatever it's contents are. So need to re-reserve.
This commit is contained in:
parent
3cc243b9a8
commit
26ae5052f4
|
@ -245,6 +245,7 @@ class Socket : public CommsBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ssize_t recv(std::string &msg) const {
|
virtual ssize_t recv(std::string &msg) const {
|
||||||
|
msg.reserve(ZM_NETWORK_BUFSIZ);
|
||||||
std::vector<char> buffer(msg.capacity());
|
std::vector<char> buffer(msg.capacity());
|
||||||
ssize_t nBytes;
|
ssize_t nBytes;
|
||||||
if ((nBytes = ::recv(mSd, buffer.data(), buffer.size(), 0)) < 0) {
|
if ((nBytes = ::recv(mSd, buffer.data(), buffer.size(), 0)) < 0) {
|
||||||
|
|
Loading…
Reference in New Issue