Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Private Attributes
Arc::HTTPResponseHeader Class Reference

#include <HTTPSClient.h>

Collaboration diagram for Arc::HTTPResponseHeader:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 HTTPResponseHeader (bool alive=true)
void reset (bool alive=true)
bool set (const char *name, const char *value)
bool haveContentRange (void) const
bool haveContentLength (void) const
bool haveExpires (void) const
bool haveLastModified (void) const
unsigned long long int ContentLength (void) const
unsigned long long int ContentStart (void) const
unsigned long long int ContentEnd (void) const
unsigned long long int ContentSize (void) const
Time Expires (void) const
Time LastModified (void) const
bool KeepAlive (void) const

Private Attributes

bool keep_alive
bool content_length_passed
unsigned long long int content_length
bool content_range_passed
unsigned long long int content_size
unsigned long long int content_start
unsigned long long int content_end
Time expires
Time last_modified

Detailed Description

Definition at line 30 of file HTTPSClient.h.


Constructor & Destructor Documentation

Definition at line 5 of file HTTPSHeader.cpp.


Member Function Documentation

unsigned long long int Arc::HTTPResponseHeader::ContentEnd ( void  ) const [inline]

Definition at line 63 of file HTTPSClient.h.

unsigned long long int Arc::HTTPResponseHeader::ContentLength ( void  ) const [inline]

Definition at line 54 of file HTTPSClient.h.

Here is the caller graph for this function:

unsigned long long int Arc::HTTPResponseHeader::ContentSize ( void  ) const [inline]

Definition at line 68 of file HTTPSClient.h.

unsigned long long int Arc::HTTPResponseHeader::ContentStart ( void  ) const [inline]

Definition at line 59 of file HTTPSClient.h.

                                                    {
      if(content_range_passed) return content_start;
      return 0;
    };

Here is the caller graph for this function:

Time Arc::HTTPResponseHeader::Expires ( void  ) const [inline]

Definition at line 73 of file HTTPSClient.h.

{ return expires; };
bool Arc::HTTPResponseHeader::haveContentLength ( void  ) const [inline]

Definition at line 51 of file HTTPSClient.h.

{ return content_length_passed; };

Here is the caller graph for this function:

bool Arc::HTTPResponseHeader::haveContentRange ( void  ) const [inline]

Definition at line 50 of file HTTPSClient.h.

{ return content_range_passed; };

Here is the caller graph for this function:

bool Arc::HTTPResponseHeader::haveExpires ( void  ) const [inline]

Definition at line 52 of file HTTPSClient.h.

{ return expires != 0; };
bool Arc::HTTPResponseHeader::haveLastModified ( void  ) const [inline]

Definition at line 53 of file HTTPSClient.h.

{ return last_modified != 0; };
bool Arc::HTTPResponseHeader::KeepAlive ( void  ) const [inline]

Definition at line 75 of file HTTPSClient.h.

{ return keep_alive; };

Here is the caller graph for this function:

Time Arc::HTTPResponseHeader::LastModified ( void  ) const [inline]

Definition at line 74 of file HTTPSClient.h.

{ return last_modified; };
void Arc::HTTPResponseHeader::reset ( bool  alive = true)

Definition at line 7 of file HTTPSHeader.cpp.

                                           {
    keep_alive=alive;
    content_length_passed=false;
    content_range_passed=false;
    expires=(time_t)0; last_modified=(time_t)0;
  }

Here is the caller graph for this function:

bool Arc::HTTPResponseHeader::set ( const char *  name,
const char *  value 
)

Definition at line 14 of file HTTPSHeader.cpp.

                                                                 {
    if(strcasecmp("Connection:",name) == 0) {
      if(strcasecmp("close",value) == 0) { keep_alive=0; }
      else if(strcasecmp("keep-alive",value) == 0) { keep_alive=1; }
      else { return false; };
      return true;
    } else if(strcasecmp("Content-Length:",name) == 0) {
      content_length_passed=false;
      char *e;
      content_length=strtoull(value,&e,10);
      if((*e) != 0) return false;
      content_length_passed=true;
      return true;
    } else if(strcasecmp("Content-Range:",name) == 0) {
      content_range_passed=false;
      content_size=0;
      const char* p = value; for(;*p;p++) if(isspace(*p)) break;
      if(strncasecmp("bytes",value,p-value) != 0) return false;
      for(;*p;p++) if(!isspace(*p)) break;
      char *e;
      content_start=strtoull(p,&e,10);
      if((*e) != '-') return false; 
      p=e+1; content_end=strtoull(p,&e,10); p=e;
      if(((*e) != '/') && ((*e) != 0)) return false;
      if(content_start > content_end) return false;
      if((*p) == '/') {
        p++; content_size=strtoull(p,&e,10);
        if((*e) != 0) { return false; }
      };
      content_range_passed=true;
      return true;
    } else if(strcasecmp("Expires:",name) == 0) {
      expires=Time(value);
    } else if(strcasecmp("Last-Modified:",name) == 0) {
      last_modified=Time(value);
    };
    return true;
  }

Here is the caller graph for this function:


Member Data Documentation

unsigned long long int Arc::HTTPResponseHeader::content_end [private]

Definition at line 40 of file HTTPSClient.h.

unsigned long long int Arc::HTTPResponseHeader::content_length [private]

Definition at line 35 of file HTTPSClient.h.

Definition at line 34 of file HTTPSClient.h.

Definition at line 37 of file HTTPSClient.h.

unsigned long long int Arc::HTTPResponseHeader::content_size [private]

Definition at line 38 of file HTTPSClient.h.

unsigned long long int Arc::HTTPResponseHeader::content_start [private]

Definition at line 39 of file HTTPSClient.h.

Definition at line 42 of file HTTPSClient.h.

Definition at line 32 of file HTTPSClient.h.

Definition at line 44 of file HTTPSClient.h.


The documentation for this class was generated from the following files: