From fda4e30b01dd75c562bcb5b186bab727ba9d191c Mon Sep 17 00:00:00 2001 From: Payden Sutherland Date: Sun, 7 Oct 2012 16:44:54 -0400 Subject: [PATCH] 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. --- wsclient.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wsclient.c b/wsclient.c index f133a88..0ba125d 100644 --- a/wsclient.c +++ b/wsclient.c @@ -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.