1 #include "HTTPU/parse_http_response.h"
2 #include "ace/OS_NS_string.h"
3 #include "ace/OS_NS_stdlib.h"
5 Parse_HTTP_Response::Parse_HTTP_Response (const char *response
)
15 this->init (response
);
18 Parse_HTTP_Response::~Parse_HTTP_Response ()
21 ACE_OS::free (this->response_
);
28 Parse_HTTP_Response::init (const char *response
)
30 this->response_
= ACE_OS::strdup (response
);
31 if (this->response_
== 0)
33 this->error_
= NO_MEMORY
;
37 int n
= ::sscanf (this->response_
, "HTTP/%d.%d %d %*s",
38 &(this->major_version_
),
39 &(this->minor_version_
),
44 char *p
= this->response_
;
46 while (*p
== ' ' || *p
== '\t')
51 while (*p
!= ' ' && *p
!= '\t')
56 while (*p
== ' ' || *p
== '\t')
61 while (*p
&& !ACE_OS::strchr (" \t\r\n", *p
))
67 this->error_
= BAD_RESPONSE
;
70 #if !defined (ACE_HAS_INLINED_OSCALLS)
71 # include "HTTPU/parse_http_response.inl"
72 #endif /* ACE_HAS_INLINED_OSCALLS */