提交 f44f652c 编写于 作者: A Alexey Milovidov

███████████: addition to prev. revision [#CONV-2546].

上级 450be4a9
......@@ -71,7 +71,7 @@ public:
try
{
nextImpl();
next();
}
catch (...)
{
......
......@@ -93,7 +93,7 @@ public:
try
{
nextImpl();
next();
Poco::Net::HTTPResponse response;
std::istream & istr = session.receiveResponse(response);
......
......@@ -31,11 +31,24 @@ public:
if (!offset())
return;
bytes += offset();
nextImpl();
try
{
nextImpl();
}
catch (...)
{
/** Если вызов nextImpl() был неудачным, то переместим курсор в начало,
* чтобы потом (например, при развёртке стека) не было второй попытки записать данные.
*/
pos = working_buffer.begin();
throw;
}
pos = working_buffer.begin();
}
/** желательно в наследниках поместить в деструктор вызов nextImpl(),
/** желательно в наследниках поместить в деструктор вызов next(),
* чтобы последние данные записались
*/
virtual ~WriteBuffer() {}
......
......@@ -53,7 +53,7 @@ public:
try
{
nextImpl();
next();
}
catch (...)
{
......
......@@ -39,7 +39,7 @@ public:
try
{
nextImpl();
next();
}
catch (...)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册