9 #include "EventStorage/EventStorageIssues.h"
14 static int TDavixFile_http_authn_cert_X509(
void *userdata,
const Davix::SessionInfo &
info, Davix::X509Credential *cert, Davix::DavixError **
err) {
19 std::string ucert, ukey;
24 if (ucert.empty() || ukey.empty()) {
25 Davix::DavixError::setupError(
err,
"fReadDavix.cxx",
26 Davix::StatusCode::AuthentificationError,
27 "Could not set the user's proxy or certificate");
30 return cert->loadFromFilePEM(ukey, ucert,
"",
err);
41 m_pos =
new Davix::DavPosix(&
m_c);
46 const char *env_var = NULL;
47 if( ( env_var =
std::getenv(
"X509_CERT_DIR")) == NULL){
48 env_var =
"/etc/grid-security/certificates/";
52 m_cert =
new Davix::X509Credential();
53 m_davixParam->setClientCertCallbackX509(&TDavixFile_http_authn_cert_X509, NULL);
76 Davix::DavixError* err2 = NULL;
78 if(pfd == 0)
return false;
79 m_pos->close(pfd, &err2);
100 if (sizeBytes==0)
return;
103 unsigned int totalRead=0,ntry=0;
104 while(sizeBytes > totalRead)
108 std::stringstream mystream;
109 mystream <<
"fReadDavix::readData: can not read data with davix " <<
m_err->getErrMsg().c_str() <<
" " <<
m_err->getStatus();
110 Davix::DavixError::clearError(&
m_err);
111 EventStorage::ReadingIssue ci(ERS_HERE, mystream.str().c_str());
117 totalRead += ret; ++ntry;
119 std::stringstream mystream;
120 mystream <<
"Problem reading from the data file. "
121 <<
"fReadDavix::readData asked to read "<<sizeBytes
122 <<
" bytes and managed to read only "<<totalRead
124 EventStorage::ReadingIssue ci(ERS_HERE, mystream.str().c_str());
148 ret = m_pos->lseek64(
m_fd,
p, SEEK_END, &
m_err);