xrootd
|
#include <PMarkManager.hh>
Classes | |
class | SocketInfo |
Public Member Functions | |
PMarkManager (XrdNetPMark *pmark) | |
void | addFd (int fd, const struct sockaddr *sockP) |
void | startTransfer (XrdHttpExtReq *req) |
void | beginPMarks () |
void | endPmark (int fd) |
virtual | ~PMarkManager ()=default |
Private Attributes | |
std::queue< SocketInfo > | mSocketInfos |
std::map< int, std::unique_ptr< XrdNetPMark::Handle > > | mPmarkHandles |
XrdNetPMark * | mPmark |
bool | mTransferWillStart |
XrdHttpExtReq * | mReq |
int | mInitialFD = -1 |
This class will manage packet marking handles for TPC transfers
Each time a socket will be opened by curl (via the opensocket_callback), the manager will register the related information to the socket.
Once the transfer will start we will start the packet marking by creating XrdNetPMark::Handle objects from the socket information previously registered.
In the case of multi-stream HTTP TPC transfers, a packet marking handle will be created for each stream. The first one will be created as a basic one. The other will be created using the first packet marking handle as a basis.
PMarkManager::PMarkManager | ( | XrdNetPMark * | pmark | ) |
|
virtualdefault |
void PMarkManager::addFd | ( | int | fd, |
const struct sockaddr * | sockP | ||
) |
Add the connected socket information that will be used for packet marking to this manager class Note: these info will only be added if startTransfer(...) has been called. It allows to ensure that the connection will be related to the data transfers and not for anything else. We only want to mark the traffic of the transfers.
fd | the socket file descriptor |
sockP | the structure describing the address of the socket |
void PMarkManager::beginPMarks | ( | ) |
Creates the different packet marking handles allowing to mark the transfer packets
Call this after the curl_multi_perform() has been called.
void PMarkManager::endPmark | ( | int | fd | ) |
This function deletes the PMark handle associated to the fd passed in parameter Use this before closing the associated socket! Otherwise the information contained in the firefly (e.g sent bytes or received bytes) will have values equal to 0.
fd | the fd of the socket to be closed |
void PMarkManager::startTransfer | ( | XrdHttpExtReq * | req | ) |
Calling this function will indicate that the connections that will happen will be related to the data transfer. The addFd(...) function will then register any socket that is created after this function will be called.
req | the request object that will be used later on to get some information about the transfer |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |