1
// parse_http_response.cpp,v 1.2 2003/11/01 11:15:22 dhinton Exp
3
#include "HTTPU/parse_http_response.h"
4
#include "ace/OS_NS_string.h"
5
#include "ace/OS_NS_stdlib.h"
7
Parse_HTTP_Response::Parse_HTTP_Response (const char *response)
17
this->init (response);
20
Parse_HTTP_Response::~Parse_HTTP_Response (void)
23
ACE_OS::free (this->response_);
30
Parse_HTTP_Response::init (const char *response)
32
this->response_ = ACE_OS::strdup (response);
33
if (this->response_ == 0)
35
this->error_ = NO_MEMORY;
39
int n = ::sscanf (this->response_, "HTTP/%d.%d %d %*s",
40
&(this->major_version_),
41
&(this->minor_version_),
46
char *p = this->response_;
48
while (*p == ' ' || *p == '\t')
53
while (*p != ' ' && *p != '\t')
58
while (*p == ' ' || *p == '\t')
63
while (*p && !ACE_OS::strchr (" \t\r\n", *p))
69
this->error_ = BAD_RESPONSE;
72
#if !defined (ACE_HAS_INLINED_OSCALLS)
73
# include "HTTPU/parse_http_response.i"
74
#endif /* ACE_HAS_INLINED_OS_CALLS */