1#ifndef ZYPP_NG_MEDIA_CURL_CURL_H_INCLUDED
2#define ZYPP_NG_MEDIA_CURL_CURL_H_INCLUDED
4#include <zypp-core/zyppng/base/zyppglobal.h>
5#include <zypp-core/zyppng/base/Base>
6#include <zypp-core/zyppng/base/signals.h>
7#include <zypp-core/zyppng/core/Url>
9#include <unordered_map>
15 class NetworkRequestDispatcherPrivate;
77 class LIBZYPP_NG_EXPORT NetworkRequestDispatcher :
public Base
79 ZYPP_DECLARE_PRIVATE(NetworkRequestDispatcher)
82 using Ptr = std::shared_ptr<NetworkRequestDispatcher>;
83 using WeakPtr = std::weak_ptr<NetworkRequestDispatcher>;
85 NetworkRequestDispatcher ( );
91 static bool supportsProtocol (
const Url &url );
97 void setMaximumConcurrentConnections (
const int maxConn );
102 int maximumConcurrentConnections ()
const;
108 void enqueue (
const std::shared_ptr<NetworkRequest> &req );
113 void setAgentString (
const std::string &agent );
128 void setHostSpecificHeader (
const std::string &host,
const std::string &headerName,
const std::string &value );
131 using SpecificHeaderMap = std::unordered_map< std::string, std::unordered_map<std::string, std::string >>;
136 const SpecificHeaderMap &hostSpecificHeaders()
const;
142 void cancel ( NetworkRequest &req , std::string reason = std::string() );
147 void cancel ( NetworkRequest &req ,
const NetworkRequestError &err );
167 const NetworkRequestError &lastError()
const;
172 SignalProxy<void ( NetworkRequestDispatcher &, NetworkRequest & )> sigDownloadStarted();
177 SignalProxy<void ( NetworkRequestDispatcher &, NetworkRequest & )> sigDownloadFinished();
182 SignalProxy<void ( NetworkRequestDispatcher & )> sigQueueFinished ();
188 SignalProxy<void ( NetworkRequestDispatcher & )> sigError ();
const char * agentString()