Skip to content

Commit

Permalink
Add WS connection tracing (#3060)
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardnormier authored Nov 5, 2024
1 parent 6c8aa88 commit a8d7095
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cpp/src/Ice/WSTransceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,12 @@ IceInternal::WSTransceiver::initialize(Buffer& readBuffer, Buffer& writeBuffer)
}
assert(_writeBuffer.i == _writeBuffer.b.end());
_state = StateUpgradeResponsePending;

if (_instance->traceLevel() >= 1)
{
Trace out(_instance->logger(), _instance->traceCategory());
out << "sent " << protocol() << " connection HTTP upgrade request\n" << toString();
}
}

while (true)
Expand Down
7 changes: 7 additions & 0 deletions csharp/src/Ice/Internal/WSTransceiver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ public int initialize(Buffer readBuffer, Buffer writeBuffer, ref bool hasMoreDat
}
Debug.Assert(!_writeBuffer.b.hasRemaining());
_state = StateUpgradeResponsePending;

if (_instance.traceLevel() >= 1)
{
_instance.logger().trace(
_instance.traceCategory(),
"sent " + protocol() + " connection HTTP upgrade request\n" + ToString());
}
}

while (true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ public int initialize(Buffer readBuffer, Buffer writeBuffer) {
}
assert (!_writeBuffer.b.hasRemaining());
_state = StateUpgradeResponsePending;

if (_instance.traceLevel() >= 1) {
_instance
.logger()
.trace(
_instance.traceCategory(),
"sent "
+ protocol()
+ " connection HTTP upgrade request\n"
+ toString());
}
}

while (true) {
Expand Down

0 comments on commit a8d7095

Please sign in to comment.