WebSockets orderly/clean close frame.

- When a packet with only '\xff\x00' is received, this means the
  client is doing an orderly shutdown. (WebSockets spec version 76)
This commit is contained in:
Joel Martin
2010-08-03 13:21:00 -05:00
parent 208c832b28
commit 801482be6a
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -169,6 +169,11 @@ void do_proxy(ws_ctx_t *ws_ctx, int target) {
if (bytes <= 0) {
fprintf(stderr, "client closed connection\n");
break;
} else if ((bytes == 2) &&
(tbuf_tmp[0] == '\xff') &&
(tbuf_tmp[1] == '\x00')) {
fprintf(stderr, "client sent orderly close frame");
break;
}
if (recordfd) {
write(recordfd, "'", 1);