Skip to content

Commit

Permalink
Use correct size for wire protocol message (#372)
Browse files Browse the repository at this point in the history
* Use correct size for wire protocol message

* Bump drachtio-srf version to 5.0.0 in test/package.json
  • Loading branch information
sip2thefuture authored Sep 18, 2024
1 parent ad1366d commit 4339e80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ namespace drachtio {

/* send response if indicated */
if( !msgResponse.empty() ) {
int len = utf8_strlen(msgResponse);
int len = std::size(msgResponse);
auto forthelifeofsend = std::make_shared<std::string>(
std::to_string(len) + std::string("#") + msgResponse
);
Expand Down Expand Up @@ -449,7 +449,7 @@ namespace drachtio {

template<typename T, typename S>
void Client<T,S>::send( const string& str ) {
int len = utf8_strlen(str);
int len = std::size(str);

if (0 == len) {
DR_LOG(log_info) << "Client::send - we are unable to send this message back to client" << str;
Expand Down
2 changes: 1 addition & 1 deletion test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"blue-tape": "^1.0.0",
"body-parser": "^1.18.3",
"debug": "^3.1.0",
"drachtio-srf": "^4.4.63",
"drachtio-srf": "^5.0.0",
"express": "4.16.3",
"minimist": "^1.2.0",
"pino": "^6.6.1",
Expand Down

0 comments on commit 4339e80

Please sign in to comment.