mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-30 23:02:24 +08:00
更新zltoolkit,适配最新代码
This commit is contained in:
@@ -176,7 +176,7 @@ void HttpClient::onRecv(const Buffer::Ptr &pBuf) {
|
||||
HttpRequestSplitter::input(pBuf->data(), pBuf->size());
|
||||
}
|
||||
|
||||
void HttpClient::onErr(const SockException &ex) {
|
||||
void HttpClient::onError(const SockException &ex) {
|
||||
onResponseCompleted_l(ex);
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ protected:
|
||||
//// TcpClient override ////
|
||||
void onConnect(const toolkit::SockException &ex) override;
|
||||
void onRecv(const toolkit::Buffer::Ptr &pBuf) override;
|
||||
void onErr(const toolkit::SockException &ex) override;
|
||||
void onError(const toolkit::SockException &ex) override;
|
||||
void onFlush() override;
|
||||
void onManager() override;
|
||||
|
||||
|
||||
@@ -367,7 +367,7 @@ static void accessFile(Session &sender, const Parser &parser, const MediaInfo &m
|
||||
replace(const_cast<string &>(media_info._streamid), kHlsSuffix, "");
|
||||
}
|
||||
|
||||
weak_ptr<Session> weakSession = sender.shared_from_this();
|
||||
weak_ptr<Session> weakSession = static_pointer_cast<Session>(sender.shared_from_this());
|
||||
//判断是否有权限访问该文件
|
||||
canAccessPath(sender, parser, media_info, false, [cb, file_path, parser, is_hls, media_info, weakSession](const string &err_msg, const HttpServerCookie::Ptr &cookie) {
|
||||
auto strongSession = weakSession.lock();
|
||||
|
||||
@@ -612,7 +612,7 @@ void HttpSession::sendResponse(int code,
|
||||
}
|
||||
|
||||
//发送http body
|
||||
AsyncSenderData::Ptr data = std::make_shared<AsyncSenderData>(shared_from_this(), body, bClose);
|
||||
AsyncSenderData::Ptr data = std::make_shared<AsyncSenderData>(static_pointer_cast<Session>(shared_from_this()), body, bClose);
|
||||
getSock()->setOnFlush([data]() { return AsyncSender::onSocketFlushed(data); });
|
||||
AsyncSender::onSocketFlushed(data);
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ protected:
|
||||
/**
|
||||
* tcp连接断开
|
||||
*/
|
||||
void onErr(const toolkit::SockException &ex) override {
|
||||
void onError(const toolkit::SockException &ex) override {
|
||||
// tcp断开或者shutdown导致的断开
|
||||
onWebSocketException(ex);
|
||||
}
|
||||
@@ -350,7 +350,7 @@ private:
|
||||
// 握手成功之后的中途断开
|
||||
_onRecv = nullptr;
|
||||
if (auto strong_ref = _weak_delegate.lock()) {
|
||||
strong_ref->onErr(ex);
|
||||
strong_ref->onError(ex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user