NCBI C++ ToolKit
|
#include <ncbi_pch.hpp>
#include "filetrack.hpp"
#include <connect/services/ns_output_parser.hpp>
#include <connect/ncbi_http_session.hpp>
#include <util/random_gen.hpp>
#include <util/util_exception.hpp>
#include <corelib/rwstream.hpp>
#include <corelib/request_status.hpp>
#include <corelib/resource_info.hpp>
#include <corelib/request_ctx.hpp>
#include <time.h>
#include <sstream>
#include <functional>
#include <map>
#include <atomic>
Go to the source code of this file.
Go to the SVN repository for this file.
Classes | |
struct | SUrl |
Macros | |
#define | CHECK_HTTP_STATUS(http, object_loc, ...) |
#define | CHECK_IO_STATUS(io, object_loc, when, already_failed) |
Functions | |
CNetStorageException::EErrCode | s_HttpStatusToErrCode (int http_code) |
void | s_ThrowHttpStatus (const CDiagCompileInfo &info, const string object_loc, int http_code, const string &http_text, const string when) |
void | s_ThrowIoStatus (const CDiagCompileInfo &info, const string object_loc, EIO_Status io_code, const string when) |
static EHTTP_HeaderParse | s_HTTPParseHeader_SaveStatus (const char *, void *, int) |
static void | s_ApplyMyNcbiId (function< void(const string &)> apply) |
void | s_ThrowHttpStatus (const CDiagCompileInfo &info, const string object_loc, int http_code, const string &http_text, const string &from, const string &) |
const string | s_GetSection (const string §ion) |
const STimeout | s_GetDefaultTimeout (unsigned sec=kDefaultCommTimeout) |
const string | s_GetDecryptedKey (const string &key) |
Variables | |
const THTTP_Flags | kDefaultHttpFlags |
const auto | kMyNcbiIdHeader = "Delegated-From-MyNCBI-ID" |
const auto | kAuthHeader = "Authorization" |
const auto | kAuthPrefix = "Token " |
const unsigned | kDefaultCommTimeout = 30 |
const auto | kUninitialized = CNetStorageObjectLoc::eNumberOfFileTrackSites |
#define CHECK_HTTP_STATUS | ( | http, | |
object_loc, | |||
... | |||
) |
Definition at line 57 of file filetrack.cpp.
#define CHECK_IO_STATUS | ( | io, | |
object_loc, | |||
when, | |||
already_failed | |||
) |
Definition at line 73 of file filetrack.cpp.
Definition at line 236 of file filetrack.cpp.
References Get().
Referenced by SFileTrackUpload::RenameFile(), and SFileTrackAPI::StartUpload().
Definition at line 490 of file filetrack.cpp.
References CNcbiEncrypt::Decrypt(), CNcbiEncrypt::IsEncrypted(), ncbi::grid::netcache::search::fields::key, and NCBI_RETHROW2.
Referenced by SFileTrackConfig::ParseArg().
const STimeout s_GetDefaultTimeout | ( | unsigned | sec = kDefaultCommTimeout | ) |
Definition at line 482 of file filetrack.cpp.
References result.
|
static |
Definition at line 130 of file filetrack.cpp.
References eHTTP_HeaderContinue.
CNetStorageException::EErrCode s_HttpStatusToErrCode | ( | int | http_code | ) |
Definition at line 95 of file filetrack.cpp.
References CRequestStatus::e403_Forbidden, CRequestStatus::e404_NotFound, CNetStorageException::eAuthError, CNetStorageException::eNotExists, and CNetStorageException::eUnknown.
Referenced by s_ThrowHttpStatus().
void s_ThrowHttpStatus | ( | const CDiagCompileInfo & | info, |
const string | object_loc, | ||
int | http_code, | ||
const string & | http_text, | ||
const string & | from, | ||
const string & | |||
) |
Definition at line 298 of file filetrack.cpp.
References info, and s_ThrowHttpStatus().
void s_ThrowHttpStatus | ( | const CDiagCompileInfo & | info, |
const string | object_loc, | ||
int | http_code, | ||
const string & | http_text, | ||
const string | when | ||
) |
Definition at line 108 of file filetrack.cpp.
References info, and s_HttpStatusToErrCode().
Referenced by s_ThrowHttpStatus().
void s_ThrowIoStatus | ( | const CDiagCompileInfo & | info, |
const string | object_loc, | ||
EIO_Status | io_code, | ||
const string | when | ||
) |
Definition at line 119 of file filetrack.cpp.
References CNetStorageException::eIOError, info, and IO_StatusStr().
const auto kAuthHeader = "Authorization" |
Definition at line 233 of file filetrack.cpp.
Referenced by SFileTrackAPI::GetPath(), SFileTrackAPI::Remove(), SFileTrackUpload::RenameFile(), and SFileTrackAPI::StartUpload().
const auto kAuthPrefix = "Token " |
Definition at line 234 of file filetrack.cpp.
Referenced by SFileTrackConfig::ParseArg(), and SFileTrackConfig::SFileTrackConfig().
const unsigned kDefaultCommTimeout = 30 |
Definition at line 480 of file filetrack.cpp.
const THTTP_Flags kDefaultHttpFlags |
Definition at line 136 of file filetrack.cpp.
Referenced by SFileTrackAPI::GetPath(), SFileTrackAPI::Remove(), and SFileTrackUpload::RenameFile().
const auto kMyNcbiIdHeader = "Delegated-From-MyNCBI-ID" |
Definition at line 232 of file filetrack.cpp.
Referenced by SFileTrackUpload::RenameFile(), and SFileTrackAPI::StartUpload().
const auto kUninitialized = CNetStorageObjectLoc::eNumberOfFileTrackSites |
Definition at line 536 of file filetrack.cpp.
Referenced by SFileTrackConfig::SSite::operator TValue().