message: code beautification
diff: @@ -254,7 +254,7 @@ int swWebSocket_dispatch_frame(swConnection *conn, char *data, uint32_t length)
  case WEBSOCKET_OPCODE_TEXT_FRAME:
  case WEBSOCKET_OPCODE_BINARY_FRAME:
  - offset = length - ws.payload_length - 2;
  + offset = length - ws.payload_length - SW_WEBSOCKET_HEADER_LEN;
  data[offset] = 1;
  data[offset + 1] = ws.header.OPCODE;
  if (!ws.header.FIN)
  @@ -273,18 +273,18 @@ int swWebSocket_dispatch_frame(swConnection *conn, char *data, uint32_t length)
  break;
  case WEBSOCKET_OPCODE_PING:
  - if (length >= (sizeof(buf) - 2))
  + if (length >= (sizeof(buf) - SW_WEBSOCKET_HEADER_LEN))
  {
  swWarn("ping frame application data is too big. remote_addr=%s:%d.", swConnection_get_ip(conn), swConnection_get_port(conn));
  return SW_ERR;
  }
  - else if (length == 2)
  + else if (length == SW_WEBSOCKET_HEADER_LEN)
  {
  swWebSocket_encode(&send_frame, NULL, 0, WEBSOCKET_OPCODE_PONG, 1, 0);
  }
  else
  {
  - offset = ws.header.MASK ? 6 : 2;
  + offset = ws.header.MASK ? SW_WEBSOCKET_HEADER_LEN + SW_WEBSOCKET_MASK_LEN : SW_WEBSOCKET_HEADER_LEN;
  swWebSocket_encode(&send_frame, data += offset, length - offset, WEBSOCKET_OPCODE_PONG, 1, 0);
  }
  swConnection_send(conn, send_frame.str, send_frame.length, 0);
  