mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
http客户端支持简单验证协议 (#1289)
* 加速track的准备速度 * 重命名为isAllTrackReady * 无须缓冲帧时,暂不用转换为可缓存帧 * 支持简单验证协议 * 优化代码 Co-authored-by: 夏楚 <771730766@qq.com>
This commit is contained in:
parent
0b2e55429d
commit
0d5ef99724
@ -9,6 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include "Util/base64.h"
|
||||||
#include "HttpClient.h"
|
#include "HttpClient.h"
|
||||||
#include "Common/config.h"
|
#include "Common/config.h"
|
||||||
|
|
||||||
@ -39,6 +40,13 @@ void HttpClient::sendRequest(const string &strUrl, float fTimeOutSec) {
|
|||||||
if (_path.empty()) {
|
if (_path.empty()) {
|
||||||
_path = "/";
|
_path = "/";
|
||||||
}
|
}
|
||||||
|
auto pos = host.find('@');
|
||||||
|
if (pos != string::npos) {
|
||||||
|
//去除?后面的字符串
|
||||||
|
auto authStr = host.substr(0, pos);
|
||||||
|
host = host.substr(pos + 1, host.size());
|
||||||
|
_header.emplace("Authorization", "Basic " + encodeBase64(authStr));
|
||||||
|
}
|
||||||
auto host_header = host;
|
auto host_header = host;
|
||||||
uint16_t port = atoi(FindField(host.data(), ":", NULL).data());
|
uint16_t port = atoi(FindField(host.data(), ":", NULL).data());
|
||||||
if (port <= 0) {
|
if (port <= 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user