![]() |
XRootD
|
Utility functions for XrdHTTP. More...
#include "XProtocol/XPtypes.hh"
#include "XrdSec/XrdSecEntity.hh"
#include "XrdOuc/XrdOucIOVec.hh"
#include "XrdOuc/XrdOucTUtils.hh"
#include <string>
#include <cstring>
#include <vector>
#include <memory>
#include <sstream>
Go to the source code of this file.
Typedefs | |
typedef std::vector< XrdOucIOVec2 > | XrdHttpIOList |
Functions | |
void | calcHashes (char *hash, const char *fn, kXR_int16 req, XrdSecEntity *secent, time_t tim, const char *key) |
int | compareHash (const char *h1, const char *h2) |
char * | decode_raw (const std::string &str) |
std::string | decode_str (const std::string &str) |
std::string | encode_opaque (const std::string &opaque) |
char * | encode_raw (const std::string &str) |
std::string | encode_str (const std::string &str) |
char * | escapeXML (const char *str) |
bool | Fromhexdigest (const unsigned char *input, int length, unsigned char *out) |
std::string | itos (long i) |
char * | mystrchrnul (const char *s, int c) |
int | parseURL (char *url, char *host, int &port, char **path) |
char * | quote (const char *str) |
void | Tobase64 (const unsigned char *input, int length, char *out) |
char * | unquote (char *str) |
typedef std::vector<XrdOucIOVec2> XrdHttpIOList |
Definition at line 173 of file XrdHttpUtils.hh.
void calcHashes | ( | char * | hash, |
const char * | fn, | ||
kXR_int16 | req, | ||
XrdSecEntity * | secent, | ||
time_t | tim, | ||
const char * | key ) |
Definition at line 219 of file XrdHttpUtils.cc.
References HMAC_CTX_free(), HMAC_CTX_new(), XrdSecEntity::host, XrdSecEntity::moninfo, XrdSecEntity::name, Tobase64(), and XrdSecEntity::vorg.
Referenced by XrdHttpProtocol::Process(), and XrdHttpReq::Redir().
int compareHash | ( | const char * | h1, |
const char * | h2 ) |
Definition at line 355 of file XrdHttpUtils.cc.
Referenced by XrdHttpProtocol::Process().
|
inline |
Creates a non-const copy of the string passed in parameter and calls unquote() on it before returning the pointer to the unquoted string
str | the string to unquote |
Definition at line 99 of file XrdHttpUtils.hh.
References unquote().
Referenced by decode_str().
|
inline |
Decodes the string passed in parameter (converts all XX codes to their 8bit versions) Calls unquote() Returns the std::string containing the decoded string.
Definition at line 137 of file XrdHttpUtils.hh.
References decode_raw().
Referenced by XrdHttpProtocol::Process().
|
inline |
Encodes opaque query string parameters example: authz=Bearer token --> authz=Bearer%20token
opaque | the opaque query string to encode |
Definition at line 150 of file XrdHttpUtils.hh.
References encode_str(), and XrdOucTUtils::splitString().
Referenced by XrdHttpReq::appendOpaque(), XrdHttpReq::ProcessHTTPReq(), and XrdHttpReq::Redir().
|
inline |
Calls quote() on the string passed in parameter
str | the string to quote |
Definition at line 114 of file XrdHttpUtils.hh.
References quote().
Referenced by encode_str().
|
inline |
Encodes the URL passed in parameter (converts all letters consider illegal in URLs to their XX versions). Calls quote() Returns a std::string containing the encoded string
Definition at line 124 of file XrdHttpUtils.hh.
References encode_raw().
Referenced by XrdHttpReq::appendOpaque(), encode_opaque(), and XrdHttpReq::Redir().
char * escapeXML | ( | const char * | str | ) |
Definition at line 458 of file XrdHttpUtils.cc.
Referenced by XrdHttpReq::Error().
bool Fromhexdigest | ( | const unsigned char * | input, |
int | length, | ||
unsigned char * | out ) |
Definition at line 169 of file XrdHttpUtils.cc.
References char_to_int().
std::string itos | ( | long | i | ) |
Definition at line 183 of file XrdHttpUtils.cc.
char * mystrchrnul | ( | const char * | s, |
int | c ) |
Definition at line 193 of file XrdHttpUtils.cc.
int parseURL | ( | char * | url, |
char * | host, | ||
int & | port, | ||
char ** | path ) |
Definition at line 77 of file XrdHttpUtils.cc.
Referenced by XrdHttpReq::ProcessHTTPReq().
char * quote | ( | const char * | str | ) |
Definition at line 399 of file XrdHttpUtils.cc.
Referenced by encode_raw().
void Tobase64 | ( | const unsigned char * | input, |
int | length, | ||
char * | out ) |
Definition at line 121 of file XrdHttpUtils.cc.
References BIO_set_flags().
Referenced by calcHashes().
char * unquote | ( | char * | str | ) |
Definition at line 370 of file XrdHttpUtils.cc.
Referenced by decode_raw().