nori0428 / mod_websocket

mod_websocket for lighty ( http://www.lighttpd.net/ )
BSD 3-Clause "New" or "Revised" License
103 stars 27 forks source link

chunked multibyte chars problem of mod_websocket #11

Closed nori0428 closed 12 years ago

nori0428 commented 13 years ago
  Fig.1

  +-----------------------+     +-----------------------+
  | browsers              |     | browsers              |
  |                       |     |                       |
  | may show garbled char |     | may show garbled char |
  +-----------------------+     +-----------------------+
              ^                             ^
              |                             |
  +-----------------------+     +-----------------------+
  | Websocket frame       |     | Websocket frame       |
  |                       |     |                       |
  | contains only 2byte   |     | contains only 1byte   |
  +-----------------------+     +-----------------------+
              ^                             ^
              | async write  =>             | async write
  +-----------------------+     +-----------------------+
  | mod_websocket         |     | mod_websocket         |
  |                       |     |                       |
  | construct websocket   |     | construct websocket   |
  | frame w/ only 2bytes  |     | frame w/ only 1byte   |
  +-----------------------+     +-----------------------+
              ^ async read                    async read
              |
  +-----------------------+
  | servers               |
  |                       |
  | send 3bytes           |
  +-----------------------+
nori0428 commented 12 years ago

resolved by using https://github.com/nori0428/msgpack.js and https://github.com/nori0428/msgpack.rpc.js