72 while (curr < buf.
Length()-2) {
75 if (next ==
kNPOS)
break;
77 if (buf.
Index(name, curr) != curr) {
82 if ((value==0) && doing_set) {
84 buf.
Remove(curr, next-curr+2);
89 while ((curr < next) && (buf[curr] !=
':')) curr++;
91 while ((curr < next) && (buf[curr] ==
' ')) curr++;
93 if (value==0)
return buf(curr, next-curr);
94 buf.
Remove(curr, next-curr);
112 while (curr < buf.
Length()-2) {
115 if (next ==
kNPOS)
break;
119 Int_t separ = curr + 1;
120 while ((separ < next) && (buf[separ] !=
':')) separ++;
121 return buf(curr, separ-curr);
142 if (data!=0) *(((
char*) data) +
length) = 0;
171 if (fullpath == 0)
return;
173 const char *rslash = strrchr(fullpath,
'/');
177 while ((fullpath != rslash) && (*fullpath ==
'/')) fullpath++;
189 if ((name == 0) || (*name == 0))
return TString();
191 if (strcmp(name,
"Content-Type") == 0)
return fContentType;
204 if ((name == 0) || (*name == 0) || (strcmp(name,
"Content-Length") == 0))
return;
206 if (strcmp(name,
"Content-Type") == 0)
217 if (kind == 0) kind =
"HTTP/1.1";
220 hdr.
Form(
"%s 404 Not Found\r\n"
221 "Content-Length: 0\r\n"
222 "Connection: close\r\n\r\n", kind);
224 hdr.
Form(
"%s 200 OK\r\n"
225 "Content-Type: %s\r\n"
226 "Connection: keep-alive\r\n"
227 "Content-Length: %ld\r\n"
244 unsigned long objcrc = R__crc32(0,
NULL, 0);
245 objcrc = R__crc32(objcrc, (
const unsigned char *) objbuf, objlen);
248 Int_t buflen = 10 + objlen + 8;
249 if (buflen < 512) buflen = 512;
253 char *bufcur = (
char *) buffer;
269 memcpy(dummy, bufcur - 6, 6);
272 unsigned long ziplen = R__memcompress(bufcur - 6, objlen + 6, objbuf, objlen);
274 memcpy(bufcur - 6, dummy, 6);
276 bufcur += (ziplen - 6);
278 *bufcur++ = objcrc & 0xff;
279 *bufcur++ = (objcrc >> 8) & 0xff;
280 *bufcur++ = (objcrc >> 16) & 0xff;
281 *bufcur++ = (objcrc >> 24) & 0xff;
283 *bufcur++ = objlen & 0xff;
284 *bufcur++ = (objlen >> 8) & 0xff;
285 *bufcur++ = (objlen >> 16) & 0xff;
286 *bufcur++ = (objlen >> 24) & 0xff;
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
Long_t GetContentLength() const
void * fBinData
indicate if content should be zipped
TString & Insert(Ssiz_t pos, const char *s)
void SetContentType(const char *typ)
const void * GetContent() const
const char * Data() const
void SetEncoding(const char *typ)
ClassImp(THttpCallArg) THttpCallArg
constructor
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
void SetPostData(void *data, Long_t length)
set data, posted with the request buffer should be allocated with malloc(length+1) call...
void SetPathAndFileName(const char *fullpath)
set complete path of requested http element For instance, it could be "/folder/subfolder/get.bin" Here "/folder/subfolder/" is element path and "get.bin" requested file.
TString fContentType
condition used to wait for processing
void Clear()
Clear string without changing its capacity.
TString fPathName
request method like GET or POST
TString & Append(const char *cs)
Long_t fPostDataLength
binary data received with post request
Long_t fBinDataLength
binary data, assigned with http call
void SetBinData(void *data, Long_t length)
set binary data, which will be returned as reply body
Double_t length(const TVector2 &v)
TString AccessHeader(TString &buf, const char *name, const char *value=0, Bool_t doing_set=kFALSE)
method used to get or set http header in the string buffer Header has following format: field1 : valu...
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
void * fPostData
additional arguments
TString & Remove(Ssiz_t pos)
TString CountHeader(const TString &buf, Int_t number=-1111) const
method used to counter number of headers or returns name of specified header
TString fHeader
complete header, provided with request
static RooMathCoreReg dummy
Mother of all ROOT objects.
TString fContent
response header like ContentEncoding, Cache-Control and so on
void AddHeader(const char *name, const char *value)
Set name: value pair to reply header Content-Type field handled separately - one should use SetConten...
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Vc_ALWAYS_INLINE_L T *Vc_ALWAYS_INLINE_R malloc(size_t n)
Allocates memory on the Heap with alignment and padding suitable for vectorized access.
~THttpCallArg()
destructor
TString fFileName
item path
Bool_t CompressWithGzip()
compress reply data with gzip compression
TString GetHeader(const char *name)
return specified header
void FillHttpHeader(TString &buf, const char *header=0)
fill HTTP header
const char * GetContentType() const