| 2513 | } |
| 2514 | |
| 2515 | bool RtmpChunkStream::OnError(const RtmpMessageHeader& mh, |
| 2516 | AMFInputStream* istream, |
| 2517 | Socket* socket) { |
| 2518 | uint32_t transaction_id = 0; |
| 2519 | if (!ReadAMFUint32(&transaction_id, istream)) { |
| 2520 | RTMP_ERROR(socket, mh) << "Fail to read _error.TransactionId"; |
| 2521 | return false; |
| 2522 | } |
| 2523 | if (transaction_id < 2) { |
| 2524 | if (transaction_id == 1) { |
| 2525 | connection_context()->OnConnected(-1); |
| 2526 | } // else nothing to do with transaction_id=0 |
| 2527 | return true; |
| 2528 | } |
| 2529 | if (connection_context()->unconnected()) { |
| 2530 | RTMP_ERROR(socket, mh) << "Received _error.TransactionId=" |
| 2531 | << transaction_id << " before connected"; |
| 2532 | } |
| 2533 | RtmpContext* ctx = static_cast<RtmpContext*>(socket->parsing_context()); |
| 2534 | RtmpTransactionHandler* handler = ctx->RemoveTransaction(transaction_id); |
| 2535 | if (handler == NULL) { |
| 2536 | RTMP_WARNING(socket, mh) << "Unknown _error.TransactionId=" |
| 2537 | << transaction_id; |
| 2538 | return false; |
| 2539 | } |
| 2540 | handler->Run(true, mh, istream, socket); |
| 2541 | return true; |
| 2542 | } |
| 2543 | |
| 2544 | bool RtmpChunkStream::OnStatus(const RtmpMessageHeader& mh, |
| 2545 | AMFInputStream* istream, |
nothing calls this directly
no test coverage detected