mirror of https://github.com/aria2/aria2
Fix missing value in serialized pause option
parent
1596e83a83
commit
910e40f128
|
@ -281,7 +281,8 @@ bool SessionSerializer::save(BufferedFile& fp) const
|
||||||
// PREF_PAUSE was removed from option, so save it here looking
|
// PREF_PAUSE was removed from option, so save it here looking
|
||||||
// property separately.
|
// property separately.
|
||||||
if(rg->isPauseRequested()) {
|
if(rg->isPauseRequested()) {
|
||||||
if (fp.write(" ", 1) != 1 || fp.write(PREF_PAUSE->k) == 0 || fp.write("\n", 1) != 1) {
|
if (fp.write(" ", 1) != 1 || fp.write(PREF_PAUSE->k) == 0 ||
|
||||||
|
fp.write("=true\n", 6) != 6) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,7 @@ void SessionSerializerTest::testSave()
|
||||||
option->put(PREF_DIR, "/tmp");
|
option->put(PREF_DIR, "/tmp");
|
||||||
createRequestGroupForUri(result, option, uris);
|
createRequestGroupForUri(result, option, uris);
|
||||||
CPPUNIT_ASSERT_EQUAL((size_t)5, result.size());
|
CPPUNIT_ASSERT_EQUAL((size_t)5, result.size());
|
||||||
|
result[4]->getOption()->put(PREF_PAUSE, A2_V_TRUE);
|
||||||
option->put(PREF_MAX_DOWNLOAD_RESULT, "10");
|
option->put(PREF_MAX_DOWNLOAD_RESULT, "10");
|
||||||
SharedHandle<RequestGroupMan> rgman
|
SharedHandle<RequestGroupMan> rgman
|
||||||
(new RequestGroupMan(result, 1, option.get()));
|
(new RequestGroupMan(result, 1, option.get()));
|
||||||
|
@ -116,6 +117,8 @@ void SessionSerializerTest::testSave()
|
||||||
std::getline(ss, line);
|
std::getline(ss, line);
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string(" dir=/tmp"), line);
|
CPPUNIT_ASSERT_EQUAL(std::string(" dir=/tmp"), line);
|
||||||
std::getline(ss, line);
|
std::getline(ss, line);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(std::string(" pause=true"), line);
|
||||||
|
std::getline(ss, line);
|
||||||
CPPUNIT_ASSERT(!ss);
|
CPPUNIT_ASSERT(!ss);
|
||||||
#endif // defined(ENABLE_BITTORRENT) && defined(ENABLE_METALINK)
|
#endif // defined(ENABLE_BITTORRENT) && defined(ENABLE_METALINK)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue