Subject | Hash | Author | Date (UTC) |
---|---|---|---|
More debugging for websocket parsing | 66ccde632b280f1aa450610e6b671464b7e56451 | Catalin(ux) M. BOIE | 2018-04-02 21:39:23 |
Raise to 4096 to buffer for logging | a59dee1fdfe087ff13e4c7012fe29f8da99ad75c | Catalin(ux) M. BOIE | 2018-04-02 21:38:11 |
Bump version | 9b635cebfffdd6971eefef0ebad395e21684bb8a | Catalin(ux) M. BOIE | 2018-01-13 18:07:12 |
Added some more compile flags and websocket1 helper files. | fce47295946106956fb70da77244d77ffca09423 | Catalin(ux) M. BOIE | 2018-01-13 18:03:46 |
Lots of changes everywhere | 91b9113e8f92db07c079c005273683f2e868910c | Catalin(ux) M. BOIE | 2018-01-12 19:06:04 |
Require openssl (for websocket) | b4b34eb88f38bfd421187da76611cc54476d7309 | Catalin(ux) M. BOIE | 2017-12-30 23:44:50 |
Very important fixes | 01e33f06a5cdc52fb3795158fd838fcca7055dda | Catalin(ux) M. BOIE | 2017-12-30 23:39:17 |
Bump version to 1.0.37 | 54e8f3bcaf7f7e096c454563039a545a4abb1bf0 | Catalin(ux) M. BOIE | 2017-12-30 22:13:12 |
Lots of small fixes | 4894de0472e571b8c78294de527bf70089096545 | Catalin(ux) M. BOIE | 2017-12-30 22:11:09 |
Checkpoint | b6bf45330f046da40d762b6fd10d1bb97bc40036 | Catalin(ux) M. BOIE | 2017-12-28 00:13:09 |
Fixed libConn*.so instalation. | df1bef9190d30dd11fcd150b41810ce18278b74f | Catalin(ux) M. BOIE | 2015-04-25 14:43:37 |
libConn1.so was not included in spec file. | dd99625a7fb70d66fa5a91371fb4d2eaf7a4f23d | Catalin(ux) M. BOIE | 2015-04-25 14:39:32 |
Small fixes for build system. | ab12cbbe149933cbf1b9a9900be1a45d63ee0b29 | Catalin(ux) M. BOIE | 2015-04-25 14:17:14 |
Build fixes | e7521468199d4da53461fb0c1ffa08e1913c1e9f | Catalin(ux) M. BOIE | 2015-04-24 19:18:42 |
Checkpoint before switching to processes not threads | de43b387557dde215ab1210838d396e7e7b22c4f | Catalin(ux) M. BOIE | 2015-01-14 04:13:00 |
Wpools work now\! | f875d6bea1777c3a290bf9bb1aa047f26c935a63 | Catalin(ux) M. BOIE | 2013-11-13 20:51:13 |
WIP | 1d246f2130d4acf8c267e82051b250a623da6870 | Catalin(ux) M. BOIE | 2013-10-16 19:57:04 |
WIP | 6387026db3ce7983e610887565a282f4124d4092 | Catalin(ux) M. BOIE | 2013-10-14 20:06:49 |
WIP | 15f063f9d34d3f7b7ae9d9e83f59b4077515122b | Catalin(ux) M. BOIE | 2010-09-30 22:01:30 |
Switch licence to LGPLv3+; Do not stupidly close master socket. | d3b1c4ccd591627e7faa0eeaaa3b2bc1ee20709e | Catalin(ux) M. BOIE | 2013-08-14 04:09:36 |
File | Lines added | Lines deleted |
---|---|---|
Conn_web.c | 11 | 8 |
File Conn_web.c changed (mode: 100644) (index 95be3de..2d369bf) | |||
... | ... | int Conn_web_ws_parse(struct Conn_web_ws *w, struct Conn *C) | |
470 | 470 | w->mask = buf[1] >> 7; | w->mask = buf[1] >> 7; |
471 | 471 | w->len = buf[1] & 0x7F; | w->len = buf[1] & 0x7F; |
472 | 472 | Conn_eat(C, 2); | Conn_eat(C, 2); |
473 | Log(20, "%s: fin=%hhu opcode=%hhu mask=%hhu len=%hhu\n", | ||
474 | __func__, w->fin, w->opcode, w->mask, w->len); | ||
473 | 475 | ||
474 | if (w->opcode == 0x8) { | ||
476 | if (unlikely(w->opcode == 0x8)) { | ||
475 | 477 | Conn_set_error("remote sent close opcode"); | Conn_set_error("remote sent close opcode"); |
476 | 478 | return -1; | return -1; |
477 | 479 | } | } |
478 | 480 | ||
479 | if (unlikely(w->opcode != 0x1)) { | ||
480 | Conn_set_error("opcode is not 'text' (%hhu)", w->opcode); | ||
481 | return -1; | ||
482 | } | ||
483 | |||
484 | if (w->mask != 1) { | ||
481 | if (unlikely(w->mask != 1)) { | ||
485 | 482 | Conn_set_error("input is not masked"); | Conn_set_error("input is not masked"); |
486 | 483 | return -1; | return -1; |
487 | 484 | } | } |
... | ... | int Conn_web_ws_parse(struct Conn_web_ws *w, struct Conn *C) | |
520 | 517 | return 0; | return 0; |
521 | 518 | ||
522 | 519 | buf = Conn_ibuf(C); | buf = Conn_ibuf(C); |
523 | len = Conn_iqlen(C); | ||
520 | len = w->len; | ||
524 | 521 | for (i = 0; i < len; i++) | for (i = 0; i < len; i++) |
525 | 522 | buf[i] ^= w->maskkey[i % 4]; | buf[i] ^= w->maskkey[i % 4]; |
526 | 523 | ||
524 | if (unlikely(w->opcode != 0x1)) { | ||
525 | Conn_set_error("opcode is not 'text' (%hhu)", w->opcode); | ||
526 | Conn_dump(buf, len); | ||
527 | return -1; | ||
528 | } | ||
529 | |||
527 | 530 | return len; | return len; |
528 | 531 | } | } |
529 | 532 |