Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LimaGroup
Lima-camera-eiger
Commits
31deb1d3
Commit
31deb1d3
authored
Dec 11, 2019
by
Alejandro Homs Puron
Committed by
operator for beamline
Dec 11, 2019
Browse files
Fix Requests::Transfer constructure failure management
parent
0749ee14
Changes
1
Hide whitespace changes
Inline
Side-by-side
sdk/linux/EigerAPI/src/Requests.cpp
View file @
31deb1d3
...
...
@@ -766,17 +766,14 @@ Requests::Transfer::Transfer(Requests& requests,
m_target_file
=
fopen
(
target_path
.
c_str
(),
"w+"
);
if
(
!
m_target_file
)
{
free
(
m_buffer
);
char
str_errno
[
1024
];
strerror_r
(
errno
,
str_errno
,
sizeof
(
str_errno
));
char
error_buffer
[
1024
];
snprintf
(
error_buffer
,
sizeof
(
error_buffer
),
"Can't open destination file : %s"
,
str_errno
);
THROW_EIGER_EXCEPTION
(
error_buffer
,
""
);
std
::
ostringstream
error_buffer
;
error_buffer
<<
"Can't open destination file "
<<
target_path
;
THROW_EIGER_EXCEPTION
(
error_buffer
.
str
().
c_str
(),
str_errno
);
}
setbuffer
(
m_target_file
,(
char
*
)
m_buffer
,
buffer_write_size
);
if
(
!
m_target_file
)
THROW_EIGER_EXCEPTION
(
"Can't open target file"
,
target_path
.
c_str
());
curl_easy_setopt
(
m_handle
,
CURLOPT_WRITEFUNCTION
,
_write
);
curl_easy_setopt
(
m_handle
,
CURLOPT_WRITEDATA
,
this
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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