remove logging from pingpong
This commit is contained in:
@@ -95,8 +95,6 @@
|
||||
|
||||
// Send the pong frame directly through the socket
|
||||
[asyncSocket writeData:pongFrame withTimeout:TIMEOUT_NONE tag:TAG_PONG_SENT];
|
||||
|
||||
NSLog(@"Sent pong frame with payload length: %lu", (unsigned long)[payload length]);
|
||||
}
|
||||
|
||||
#pragma mark - Override AsyncSocket Delegate
|
||||
@@ -106,8 +104,6 @@
|
||||
NSData *maskingKey = [self valueForKey:@"maskingKey"];
|
||||
BOOL nextFrameMasked = [[self valueForKey:@"nextFrameMasked"] boolValue];
|
||||
NSUInteger nextOpCode = [[self valueForKey:@"nextOpCode"] unsignedIntValue];
|
||||
|
||||
NSLog(@"tag: %ld, nextOpCode: %lu", tag, (unsigned long)nextOpCode);
|
||||
|
||||
// Handle our custom ping payload tag
|
||||
if (tag == TAG_PING_PAYLOAD) {
|
||||
@@ -126,7 +122,6 @@
|
||||
payload = [unmaskedPayload copy];
|
||||
}
|
||||
|
||||
NSLog(@"Sending pong response to ping with payload length: %lu", (unsigned long)[payload length]);
|
||||
[self sendPongWithPayload:payload];
|
||||
|
||||
// Continue reading the next frame
|
||||
@@ -149,8 +144,6 @@
|
||||
nextFrameMasked = masked;
|
||||
currentPayloadLength = length;
|
||||
|
||||
NSLog(@"Processing ping/pong frame, masked: %d, length: %lu", masked, (unsigned long)length);
|
||||
|
||||
if (length <= 125) {
|
||||
if (nextFrameMasked) {
|
||||
[asyncSocket readDataToLength:4 withTimeout:TIMEOUT_NONE tag:TAG_MSG_MASKING_KEY];
|
||||
@@ -158,7 +151,6 @@
|
||||
[asyncSocket readDataToLength:length withTimeout:TIMEOUT_NONE tag:TAG_PING_PAYLOAD];
|
||||
} else {
|
||||
// Empty payload, no masking - handle immediately
|
||||
NSLog(@"Handling empty unmasked ping payload");
|
||||
[self sendPongWithPayload:[NSData data]];
|
||||
[asyncSocket readDataToLength:1 withTimeout:TIMEOUT_NONE tag:TAG_PAYLOAD_PREFIX];
|
||||
}
|
||||
@@ -175,14 +167,12 @@
|
||||
if (tag == TAG_MSG_MASKING_KEY) {
|
||||
// Store the masking key
|
||||
maskingKey = [data copy];
|
||||
NSLog(@"Stored masking key for ping/pong frame");
|
||||
|
||||
// Now read the payload (or handle empty payload)
|
||||
if (currentPayloadLength > 0) {
|
||||
[asyncSocket readDataToLength:currentPayloadLength withTimeout:TIMEOUT_NONE tag:TAG_PING_PAYLOAD];
|
||||
} else {
|
||||
// Empty payload - send pong immediately
|
||||
NSLog(@"Sending pong for empty masked ping payload");
|
||||
[self sendPongWithPayload:[NSData data]];
|
||||
[asyncSocket readDataToLength:1 withTimeout:TIMEOUT_NONE tag:TAG_PAYLOAD_PREFIX];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user