73 while (curr < buf.
Length()-2) {
76 if (next ==
kNPOS)
break;
78 if (buf.
Index(name, curr) != curr) {
83 if ((value==0) && doing_set) {
85 buf.
Remove(curr, next-curr+2);
90 while ((curr < next) && (buf[curr] !=
':')) curr++;
92 while ((curr < next) && (buf[curr] ==
' ')) curr++;
94 if (value==0)
return buf(curr, next-curr);
95 buf.
Remove(curr, next-curr);
100 if (value==0)
return TString();
113 while (curr < buf.
Length()-2) {
116 if (next ==
kNPOS)
break;
120 Int_t separ = curr + 1;
121 while ((separ < next) && (buf[separ] !=
':')) separ++;
122 return buf(curr, separ-curr);
143 if (data!=0) *(((
char*) data) +
length) = 0;
172 if (fullpath == 0)
return;
174 const char *rslash = strrchr(fullpath,
'/');
178 while ((fullpath != rslash) && (*fullpath ==
'/')) fullpath++;
190 if ((name == 0) || (*name == 0))
return TString();
192 if (strcmp(name,
"Content-Type") == 0)
return fContentType;
205 if ((name == 0) || (*name == 0) || (strcmp(name,
"Content-Length") == 0))
return;
207 if (strcmp(name,
"Content-Type") == 0)
218 if (kind == 0) kind =
"HTTP/1.1";
221 hdr.
Form(
"%s 404 Not Found\r\n"
222 "Content-Length: 0\r\n"
223 "Connection: close\r\n\r\n", kind);
225 hdr.
Form(
"%s 200 OK\r\n"
226 "Content-Type: %s\r\n"
227 "Connection: keep-alive\r\n"
228 "Content-Length: %ld\r\n"
245 unsigned long objcrc = R__crc32(0,
NULL, 0);
246 objcrc = R__crc32(objcrc, (
const unsigned char *) objbuf, objlen);
249 Int_t buflen = 10 + objlen + 8;
250 if (buflen < 512) buflen = 512;
252 void *buffer =
malloc(buflen);
254 char *bufcur = (
char *) buffer;
270 memcpy(dummy, bufcur - 6, 6);
273 unsigned long ziplen = R__memcompress(bufcur - 6, objlen + 6, objbuf, objlen);
275 memcpy(bufcur - 6, dummy, 6);
277 bufcur += (ziplen - 6);
279 *bufcur++ = objcrc & 0xff;
280 *bufcur++ = (objcrc >> 8) & 0xff;
281 *bufcur++ = (objcrc >> 16) & 0xff;
282 *bufcur++ = (objcrc >> 24) & 0xff;
284 *bufcur++ = objlen & 0xff;
285 *bufcur++ = (objlen >> 8) & 0xff;
286 *bufcur++ = (objlen >> 16) & 0xff;
287 *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...
Vc_ALWAYS_INLINE void free(T *p)
Frees memory that was allocated with Vc::malloc.
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