mirror of https://github.com/aria2/aria2
Added geom parameter to --stream-piece-selector option.
parent
201af99501
commit
7318c361bc
|
@ -58,6 +58,7 @@
|
||||||
#include "RarestPieceSelector.h"
|
#include "RarestPieceSelector.h"
|
||||||
#include "DefaultStreamPieceSelector.h"
|
#include "DefaultStreamPieceSelector.h"
|
||||||
#include "InorderStreamPieceSelector.h"
|
#include "InorderStreamPieceSelector.h"
|
||||||
|
#include "GeomStreamPieceSelector.h"
|
||||||
#include "array_fun.h"
|
#include "array_fun.h"
|
||||||
#include "PieceStatMan.h"
|
#include "PieceStatMan.h"
|
||||||
#include "wallclock.h"
|
#include "wallclock.h"
|
||||||
|
@ -83,11 +84,11 @@ DefaultPieceStorage::DefaultPieceStorage
|
||||||
const std::string& pieceSelectorOpt =
|
const std::string& pieceSelectorOpt =
|
||||||
option_->get(PREF_STREAM_PIECE_SELECTOR);
|
option_->get(PREF_STREAM_PIECE_SELECTOR);
|
||||||
if(pieceSelectorOpt.empty() || pieceSelectorOpt == A2_V_DEFAULT) {
|
if(pieceSelectorOpt.empty() || pieceSelectorOpt == A2_V_DEFAULT) {
|
||||||
streamPieceSelector_ = SharedHandle<StreamPieceSelector>
|
streamPieceSelector_.reset(new DefaultStreamPieceSelector(bitfieldMan_));
|
||||||
(new DefaultStreamPieceSelector(bitfieldMan_));
|
|
||||||
} else if(pieceSelectorOpt == V_INORDER) {
|
} else if(pieceSelectorOpt == V_INORDER) {
|
||||||
streamPieceSelector_ = SharedHandle<StreamPieceSelector>
|
streamPieceSelector_.reset(new InorderStreamPieceSelector(bitfieldMan_));
|
||||||
(new InorderStreamPieceSelector(bitfieldMan_));
|
} else if(pieceSelectorOpt == A2_V_GEOM) {
|
||||||
|
streamPieceSelector_.reset(new GeomStreamPieceSelector(bitfieldMan_));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -859,7 +859,8 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
|
||||||
TEXT_STREAM_PIECE_SELECTOR,
|
TEXT_STREAM_PIECE_SELECTOR,
|
||||||
A2_V_DEFAULT,
|
A2_V_DEFAULT,
|
||||||
A2_V_DEFAULT,
|
A2_V_DEFAULT,
|
||||||
V_INORDER));
|
V_INORDER,
|
||||||
|
A2_V_GEOM));
|
||||||
op->addTag(TAG_FTP);
|
op->addTag(TAG_FTP);
|
||||||
op->addTag(TAG_HTTP);
|
op->addTag(TAG_HTTP);
|
||||||
handlers.push_back(op);
|
handlers.push_back(op);
|
||||||
|
|
|
@ -46,6 +46,7 @@ const std::string V_NONE("none");
|
||||||
const std::string V_MEM("mem");
|
const std::string V_MEM("mem");
|
||||||
const std::string V_ALL("all");
|
const std::string V_ALL("all");
|
||||||
const std::string A2_V_FULL("full");
|
const std::string A2_V_FULL("full");
|
||||||
|
const std::string A2_V_GEOM("geom");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General preferences
|
* General preferences
|
||||||
|
|
|
@ -50,6 +50,8 @@ extern const std::string V_NONE;
|
||||||
extern const std::string V_MEM;
|
extern const std::string V_MEM;
|
||||||
extern const std::string V_ALL;
|
extern const std::string V_ALL;
|
||||||
extern const std::string A2_V_FULL;
|
extern const std::string A2_V_FULL;
|
||||||
|
extern const std::string A2_V_GEOM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General preferences
|
* General preferences
|
||||||
*/
|
*/
|
||||||
|
@ -216,7 +218,7 @@ extern const std::string PREF_RETRY_WAIT;
|
||||||
extern const std::string PREF_ASYNC_DNS_SERVER;
|
extern const std::string PREF_ASYNC_DNS_SERVER;
|
||||||
// value: true | false
|
// value: true | false
|
||||||
extern const std::string PREF_SHOW_CONSOLE_READOUT;
|
extern const std::string PREF_SHOW_CONSOLE_READOUT;
|
||||||
// value: default | inorder
|
// value: default | inorder | geom
|
||||||
extern const std::string PREF_STREAM_PIECE_SELECTOR;
|
extern const std::string PREF_STREAM_PIECE_SELECTOR;
|
||||||
// value: true | false
|
// value: true | false
|
||||||
extern const std::string PREF_TRUNCATE_CONSOLE_READOUT;
|
extern const std::string PREF_TRUNCATE_CONSOLE_READOUT;
|
||||||
|
|
Loading…
Reference in New Issue