Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
c-dns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Knot projects
c-dns
Commits
067cdce8
Verified
Commit
067cdce8
authored
Aug 12, 2020
by
Pavel Doležal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Encoder/Exporter: Handle exceptions inside destructors
parent
bfd5296a
Pipeline
#67127
passed with stage
in 3 minutes and 3 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
src/cdns.h
src/cdns.h
+8
-2
src/cdns_encoder.h
src/cdns_encoder.h
+7
-1
No files found.
src/cdns.h
View file @
067cdce8
...
...
@@ -13,6 +13,7 @@
#include <string.h>
#include <stdlib.h>
#include <istream>
#include <iostream>
#include <sys/socket.h>
#include "format_specification.h"
...
...
@@ -61,8 +62,13 @@ namespace CDNS {
* if any output is currently open
*/
~
CdnsExporter
()
{
if
(
m_blocks_written
>
0
)
m_encoder
.
write_break
();
try
{
if
(
m_blocks_written
>
0
)
m_encoder
.
write_break
();
}
catch
(
std
::
exception
&
e
)
{
std
::
cerr
<<
"Couldn't write end break to output: "
<<
e
.
what
()
<<
std
::
endl
;
}
}
/** Delete [move] copy constructors and assignment operators */
...
...
src/cdns_encoder.h
View file @
067cdce8
...
...
@@ -67,7 +67,13 @@ namespace CDNS {
* @brief Destroy the CdnsEncoder object and properly close the C-DNS output
*/
~
CdnsEncoder
()
{
flush_buffer
();
try
{
flush_buffer
();
}
catch
(
std
::
exception
&
e
)
{
std
::
cerr
<<
e
.
what
()
<<
std
::
endl
;
}
if
(
m_cos
)
delete
m_cos
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment