| 366 | } |
| 367 | |
| 368 | bool http_aclient::handle_websocket() |
| 369 | { |
| 370 | acl_assert(ws_in_); |
| 371 | |
| 372 | if (!ws_in_->is_head_finish()) { |
| 373 | if (!ws_in_->peek_frame_head()) { |
| 374 | if (ws_in_->eof()) { |
| 375 | return false; |
| 376 | } |
| 377 | return true; |
| 378 | } |
| 379 | |
| 380 | // ����������֡ͷʱ�����ݲ�ͬ֡���ͻص���ͬ���� |
| 381 | unsigned char opcode = ws_in_->get_frame_opcode(); |
| 382 | switch (opcode) { |
| 383 | case FRAME_TEXT: |
| 384 | if (!this->on_ws_frame_text()) { |
| 385 | return false; |
| 386 | } |
| 387 | break; |
| 388 | case FRAME_BINARY: |
| 389 | if (!this->on_ws_frame_binary()) { |
| 390 | return false; |
| 391 | } |
| 392 | break; |
| 393 | case FRAME_CLOSE: |
| 394 | this->on_ws_frame_closed(); |
| 395 | return false; |
| 396 | case FRAME_PING: |
| 397 | return true; |
| 398 | case FRAME_PONG: |
| 399 | return true; |
| 400 | default: |
| 401 | return true; |
| 402 | } |
| 403 | } |
| 404 | |
| 405 | unsigned char opcode = ws_in_->get_frame_opcode(); |
| 406 | switch (opcode) { |
| 407 | case FRAME_TEXT: |
| 408 | case FRAME_BINARY: |
| 409 | return handle_ws_data(); |
| 410 | case FRAME_PING: |
| 411 | return handle_ws_ping(); |
| 412 | case FRAME_PONG: |
| 413 | return handle_ws_pong(); |
| 414 | default: |
| 415 | return handle_ws_other(); |
| 416 | } |
| 417 | } |
| 418 | |
| 419 | // SSL ���ֺͶ� Websocket ����֡�Σ��÷������ᱻ��ε��á� |
| 420 | // ������ SSL ģʽʱ���� SSL ���ֽΣ��÷����ᱻ��ε��ã�ֱ�� SSL ���ֳɹ� |
nothing calls this directly
no test coverage detected