| 2987 | } |
| 2988 | |
| 2989 | bool RtmpChunkStream::OnCloseStream(const RtmpMessageHeader& mh, |
| 2990 | AMFInputStream* istream, |
| 2991 | Socket* socket) { |
| 2992 | if (!connection_context()->is_server_side()) { |
| 2993 | RTMP_ERROR(socket, mh) << "Client should not receive `closeStream'"; |
| 2994 | return false; |
| 2995 | } |
| 2996 | uint32_t transaction_id = 0; |
| 2997 | if (!ReadAMFUint32(&transaction_id, istream)) { |
| 2998 | RTMP_ERROR(socket, mh) << "Fail to read closeStream.TransactionId"; |
| 2999 | return false; |
| 3000 | } |
| 3001 | if (!ReadAMFNull(istream)) { // command object |
| 3002 | RTMP_ERROR(socket, mh) << "Fail to read closeStream.CommandObject"; |
| 3003 | return false; |
| 3004 | } |
| 3005 | butil::intrusive_ptr<RtmpStreamBase> stream; |
| 3006 | if (!connection_context()->FindMessageStream(mh.stream_id, &stream)) { |
| 3007 | // TODO: frequent, commented now |
| 3008 | //RTMP_WARNING(socket, mh) << "Fail to find stream_id=" << mh.stream_id; |
| 3009 | return false; |
| 3010 | } |
| 3011 | if (!stream->_paused) { |
| 3012 | stream->_paused = true; |
| 3013 | // TODO(gejun): Run in execq. |
| 3014 | static_cast<RtmpServerStream*>(stream.get())->OnPause(true, 0); |
| 3015 | } |
| 3016 | return true; |
| 3017 | } |
| 3018 | |
| 3019 | class OnPublishContinuation : public google::protobuf::Closure { |
| 3020 | public: |
nothing calls this directly
no test coverage detected