1
0
mirror of https://github.com/payden/libwsclient synced 2024-10-27 17:54:01 +00:00

Add notification of unhandled control frames

Send a message to stderr.  I have an inkling one
of my programs is timing out because it's not responding
to server PINGs.  This might tell me that.  Useful anyway.
This commit is contained in:
Payden Sutherland 2012-10-07 16:44:54 -04:00
parent b28c123b01
commit fda4e30b01

View File

@ -104,6 +104,9 @@ void libwsclient_handle_control_frame(wsclient *c, libwsclient_frame *ctl_frame)
c->flags |= CLIENT_SHOULD_CLOSE;
pthread_mutex_unlock(&c->lock);
break;
default:
fprintf(stderr, "Unhandled control frame received. Opcode: %d\n", ctl_frame->opcode);
break;
}
libwsclient_frame *ptr = NULL;
ptr = ctl_frame->prev_frame; //This very well may be a NULL pointer, but just in case we preserve it.