mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 19:51:49 +08:00
http客户端支持多cookie
This commit is contained in:
@@ -30,12 +30,16 @@
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
#include <mutex>
|
||||
using namespace std;
|
||||
|
||||
namespace mediakit {
|
||||
|
||||
/**
|
||||
* http客户端cookie对象
|
||||
*/
|
||||
class HttpCookie {
|
||||
public:
|
||||
typedef std::shared_ptr<HttpCookie> Ptr;
|
||||
@@ -60,6 +64,9 @@ private:
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* http客户端cookie全局保存器
|
||||
*/
|
||||
class HttpCookieStorage{
|
||||
public:
|
||||
~HttpCookieStorage(){}
|
||||
@@ -69,7 +76,7 @@ public:
|
||||
private:
|
||||
HttpCookieStorage(){};
|
||||
private:
|
||||
unordered_map<string,unordered_map<string,HttpCookie::Ptr> > _all_cookie;
|
||||
unordered_map<string/*host*/,map<string/*cookie path*/,map<string/*cookie_key*/,HttpCookie::Ptr> > > _all_cookie;
|
||||
mutex _mtx_cookie;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user