|
XRootD
|
Utility functions for XrdHTTP. More...
#include "XProtocol/XPtypes.hh"#include "XProtocol/XProtocol.hh"#include "XrdSec/XrdSecEntity.hh"#include "XrdOuc/XrdOucIOVec.hh"#include "XrdOuc/XrdOucTUtils.hh"#include <string>#include <cstring>#include <vector>#include <memory>#include <sstream>
Include dependency graph for XrdHttpUtils.hh:
This graph shows which files directly or indirectly include this file: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 | httpStatusToString (int status) |
| std::string | itos (long i) |
| int | mapErrNoToHttp (int err) |
| int | mapXrdErrToHttp (XErrorCode xrdError) |
| 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 252 of file XrdHttpUtils.hh.
| anonymous enum : int |
Definition at line 52 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().
Here is the call graph for this function:
Here is the caller graph for this function:| int compareHash | ( | const char * | h1, |
| const char * | h2 | ||
| ) |
Definition at line 355 of file XrdHttpUtils.cc.
Referenced by XrdHttpProtocol::Process().
Here is the caller graph for this function:
|
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 172 of file XrdHttpUtils.hh.
References unquote().
Referenced by decode_str().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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 210 of file XrdHttpUtils.hh.
References decode_raw().
Referenced by XrdHttpProtocol::Process().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Encodes opaque query string parameters example: authz=Bearer token --> authz=Bearer%20token
| opaque | the opaque query string to encode |
Definition at line 223 of file XrdHttpUtils.hh.
References encode_str(), and XrdOucTUtils::splitString().
Referenced by XrdHttpReq::appendOpaque(), XrdHttpReq::ProcessHTTPReq(), and XrdHttpReq::Redir().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Calls quote() on the string passed in parameter
| str | the string to quote |
Definition at line 187 of file XrdHttpUtils.hh.
References quote().
Referenced by encode_str().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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 197 of file XrdHttpUtils.hh.
References encode_raw().
Referenced by XrdHttpReq::appendOpaque(), encode_opaque(), and XrdHttpReq::Redir().
Here is the call graph for this function:
Here is the caller graph for this function:| char* escapeXML | ( | const char * | str | ) |
Definition at line 461 of file XrdHttpUtils.cc.
Referenced by XrdHttpReq::Error().
Here is the caller graph for this function:| bool Fromhexdigest | ( | const unsigned char * | input, |
| int | length, | ||
| unsigned char * | out | ||
| ) |
Definition at line 169 of file XrdHttpUtils.cc.
References char_to_int().
Here is the call graph for this function:| std::string httpStatusToString | ( | int | status | ) |
Definition at line 582 of file XrdHttpUtils.cc.
| std::string itos | ( | long | i | ) |
Definition at line 183 of file XrdHttpUtils.cc.
| int mapErrNoToHttp | ( | int | err | ) |
Definition at line 509 of file XrdHttpUtils.cc.
References EAUTH, HTTP_BAD_GATEWAY, HTTP_BAD_REQUEST, HTTP_CONFLICT, HTTP_FORBIDDEN, HTTP_GATEWAY_TIMEOUT, HTTP_INSUFFICIENT_STORAGE, HTTP_INTERNAL_SERVER_ERROR, HTTP_LOOP_DETECTED, HTTP_NOT_FOUND, HTTP_NOT_IMPLEMENTED, HTTP_PAYLOAD_TOO_LARGE, HTTP_SERVICE_UNAVAILABLE, HTTP_UNAUTHORIZED, HTTP_UNPROCESSABLE_ENTITY, and HTTP_URI_TOO_LONG.
Referenced by mapXrdErrToHttp().
Here is the caller graph for this function:| int mapXrdErrToHttp | ( | XErrorCode | xrdError | ) |
Definition at line 502 of file XrdHttpUtils.cc.
References mapErrNoToHttp(), and XProtocol::toErrno().
Here is the call graph for this function:| 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.
| char* quote | ( | const char * | str | ) |
Definition at line 402 of file XrdHttpUtils.cc.
Referenced by encode_raw().
Here is the caller graph for this function:| 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().
Here is the call graph for this function:
Here is the caller graph for this function:| char* unquote | ( | char * | str | ) |
Definition at line 370 of file XrdHttpUtils.cc.
Referenced by decode_raw().
Here is the caller graph for this function: