18#ifndef PKGLIB_ACQUIRE_WORKER_H
19#define PKGLIB_ACQUIRE_WORKER_H
22#include <apt-pkg/weakptr.h>
106 int PrivSepSocketFdChild;
264 APT_HIDDEN
bool ReplyAux(pkgAcquire::ItemDesc
const &Item);
281 inline const MethodConfig *
GetConf()
const {
return Config;};
316 APT_HIDDEN
void PrepareFiles(
char const *
const caller, pkgAcquire::Queue::QItem
const *
const Itm);
317 APT_HIDDEN
void HandleFailure(std::vector<pkgAcquire::Item *>
const &ItmOwners,
319 std::string
const &Message,
bool const errTransient,
bool const errAuthErr);
A monitor object for downloads controlled by the pkgAcquire class. {{{.
Definition acquire.h:711
Represents the process by which a pkgAcquire object should retrieve a file or a collection of files.
Definition acquire-item.h:59
std::string Access
The access method to be used by this worker.
Definition acquire-worker.h:84
bool OutReady
Set to true if the worker is in a state in which it is legal to send commands to it.
Definition acquire-worker.h:120
bool ReadMessages()
Retrieve any available messages from the subprocess.
bool RunMessages()
Parse and dispatch pending messages.
std::string OutQueue
Buffers pending writes to the subprocess.
Definition acquire-worker.h:134
bool OutFdReady()
Send any pending commands to the subprocess.
int InFd
A file descriptor connected to the standard output of the subprocess.
Definition acquire-worker.h:94
MethodConfig * Config
The configuration of this method. On startup, the target of this pointer is filled in with basic data...
Definition acquire-worker.h:78
bool QueueItem(pkgAcquire::Queue::QItem *Item)
Tell the subprocess to download the given item.
Worker * NextAcquire
The next link on the Acquire list.
Definition acquire-worker.h:64
pid_t Process
The PID of the subprocess.
Definition acquire-worker.h:87
bool InFdReady()
Read and dispatch any pending messages from the subprocess.
bool MediaChange(std::string Message)
Handle a 403 Media Change message.
void ItemDone()
Invoked when a fetch job is completed, either successfully or unsuccessfully.
Worker * NextQueue
The next link on the Queue list.
Definition acquire-worker.h:61
pkgAcquireStatus * Log
The download progress indicator to which progress messages should be sent.
Definition acquire-worker.h:72
bool InReady
Set to true if the worker is in a state in which it might generate data or command responses.
Definition acquire-worker.h:113
bool MethodFailure()
Invoked when the worked process dies unexpectedly.
Queue * OwnerQ
The Queue with which this worker is associated.
Definition acquire-worker.h:67
void Construct()
Common code for the constructor.
bool Capabilities(std::string Message)
Handle a 100 Capabilities response from the subprocess.
bool Start()
Start up the worker and fill in Config.
Worker(Queue *OwnerQ, MethodConfig *Config, pkgAcquireStatus *Log)
Create a new Worker to download files.
const MethodConfig * GetConf() const
Definition acquire-worker.h:281
bool Debug
Definition acquire-worker.h:123
std::vector< std::string > MessageQueue
The raw text values of messages received from the worker, in sequence.
Definition acquire-worker.h:128
int PrivSepSocketFd
The socket to send SCM_RIGHTS message through.
Definition acquire-worker.h:105
pkgAcquire::Queue::QItem * CurrentItem
The queue entry that is currently being downloaded.
Definition acquire-worker.h:247
std::string Status
The most recent status string received from the subprocess.
Definition acquire-worker.h:252
Worker(MethodConfig *Config)
Create a new Worker that should just retrieve information about the fetch method.
virtual ~Worker()
Clean up this worker.
void Pulse()
Update the worker statistics (CurrentSize, TotalSize, etc).
int OutFd
A file descriptor connected to the standard input of the subprocess.
Definition acquire-worker.h:101
bool SendConfiguration()
Send a 601 Configuration message (containing the APT configuration) to the subprocess.