![]() |
HttpResponse Class Reference#include <HttpResponse.h>
Inheritance diagram for HttpResponse:
![]()
Collaboration diagram for HttpResponse:
![]()
Detailed DescriptionDefinition at line 46 of file HttpResponse.h. Constructor & Destructor Documentation
Definition at line 57 of file HttpResponse.cpp. 00057 : HttpTransaction() 00058 , m_http_version( version ) 00059 , m_http_status_code(0) 00060 , m_file( new MemFile ) 00061 { 00062 }
Definition at line 66 of file HttpResponse.cpp. 00066 : HttpTransaction(src) 00067 , m_http_version( src.m_http_version ) 00068 , m_http_status_code( src.m_http_status_code ) 00069 , m_http_status_msg( src.m_http_status_msg ) 00070 , m_cookie( src.m_cookie ) 00071 , m_file( src.m_file ) 00072 { 00073 }
Member Function Documentation
Definition at line 83 of file HttpResponse.cpp. References m_cookie, m_file, m_http_status_code, m_http_status_msg, and m_http_version. 00084 { 00085 m_http_version = src.m_http_version; 00086 m_http_status_code = src.m_http_status_code; 00087 m_http_status_msg = src.m_http_status_msg; 00088 m_cookie = src.m_cookie; 00089 m_file = src.m_file; 00090 00091 HttpTransaction::operator=(src); 00092 00093 return *this; 00094 }
HTTP/1.x.
Definition at line 98 of file HttpResponse.cpp. References m_http_version. 00099 { 00100 m_http_version = value; 00101 }
Definition at line 105 of file HttpResponse.cpp. References m_http_version. Referenced by HttpBaseSocket::IHttpServer_Respond(). 00106 { 00107 return m_http_version; 00108 }
Definition at line 113 of file HttpResponse.cpp. References m_http_status_code. 00114 { 00115 m_http_status_code = value; 00116 }
Definition at line 119 of file HttpResponse.cpp. References m_http_status_code. Referenced by HttpBaseSocket::IHttpServer_Respond(), and Ajp13Socket::IHttpServer_Respond(). 00120 { 00121 return m_http_status_code; 00122 }
Definition at line 127 of file HttpResponse.cpp. References m_http_status_msg. 00128 { 00129 m_http_status_msg = value; 00130 }
Definition at line 133 of file HttpResponse.cpp. References m_http_status_msg. Referenced by HttpBaseSocket::IHttpServer_Respond(), and Ajp13Socket::IHttpServer_Respond(). 00134 { 00135 return m_http_status_msg; 00136 }
Definition at line 140 of file HttpResponse.cpp. References DEB, Parse::getword(), and m_cookie. 00141 { 00142 Parse pa(value, "="); 00143 std::string name = pa.getword(); 00144 m_cookie[name] = value; 00145 DEB(fprintf(stderr, "HttpResponse::Set-Cookie<%s>: %s\n", name.c_str(), value.c_str());) 00146 }
Definition at line 149 of file HttpResponse.cpp. Referenced by HttpBaseSocket::IHttpServer_Respond(), and Ajp13Socket::IHttpServer_Respond(). 00150 { 00151 Utility::ncmap<std::string>::const_iterator it = m_cookie.find(name); 00152 DEB(fprintf(stderr, "HttpResponse; get value of Cookie<%s>: ", name.c_str());) 00153 if (it != m_cookie.end()) 00154 { 00155 DEB(fprintf(stderr, "%s\n", it -> second.c_str());) 00156 return it -> second; 00157 } 00158 DEB(fprintf(stderr, "\n");) 00159 return ""; 00160 }
Definition at line 163 of file HttpResponse.cpp. Referenced by HttpBaseSocket::IHttpServer_Respond(), and Ajp13Socket::IHttpServer_Respond(). 00164 { 00165 std::list<std::string> vec; 00166 DEB(fprintf(stderr, "HttpResponse::CookieNames; ");) 00167 for (Utility::ncmap<std::string>::const_iterator it = m_cookie.begin(); it != m_cookie.end(); ++it) 00168 { 00169 DEB(fprintf(stderr, " %s", it -> first.c_str());) 00170 vec.push_back(it -> first); 00171 } 00172 DEB(fprintf(stderr, "\n");) 00173 return vec; 00174 }
Definition at line 179 of file HttpResponse.cpp. 00180 { 00181 Write( str.c_str(), str.size() ); 00182 }
Definition at line 186 of file HttpResponse.cpp. References m_file. 00187 { 00188 m_file -> fwrite( buf, 1, sz ); 00189 }
Definition at line 193 of file HttpResponse.cpp. References m_file. 00194 { 00195 va_list ap; 00196 va_start(ap, format); 00197 char tmp[10000]; 00198 vsnprintf(tmp, sizeof(tmp), format, ap); 00199 va_end(ap); 00200 m_file -> fwrite( tmp, 1, strlen(tmp) ); 00201 }
Definition at line 205 of file HttpResponse.cpp. References m_file. Referenced by HttpBaseSocket::IHttpServer_Respond(), Ajp13Socket::IHttpServer_Respond(), HttpBaseSocket::OnTransferLimit(), and Ajp13Socket::OnTransferLimit(). 00206 { 00207 return *m_file; 00208 }
Definition at line 212 of file HttpResponse.cpp. References m_file. 00213 { 00214 return *m_file; 00215 }
Replace memfile with another IFile.
Definition at line 227 of file HttpResponse.cpp. References m_file. 00228 { 00229 m_file = std::auto_ptr<IFile>(f); 00230 }
Reimplemented from HttpTransaction. Definition at line 234 of file HttpResponse.cpp. References m_cookie, m_file, m_http_status_code, m_http_status_msg, m_http_version, and HttpTransaction::Reset(). Referenced by Ajp13Socket::Reset(). 00235 { 00236 HttpTransaction::Reset(); 00237 m_http_version = ""; 00238 m_http_status_code = 0; 00239 m_http_status_msg = ""; 00240 while (!m_cookie.empty()) 00241 { 00242 m_cookie.erase(m_cookie.begin()); 00243 } 00244 m_file = std::auto_ptr<IFile>(new MemFile); 00245 }
Member Data Documentation
Definition at line 84 of file HttpResponse.h. Referenced by HttpVersion(), operator=(), Reset(), and SetHttpVersion().
Definition at line 85 of file HttpResponse.h. Referenced by HttpStatusCode(), operator=(), Reset(), and SetHttpStatusCode().
Definition at line 86 of file HttpResponse.h. Referenced by HttpStatusMsg(), operator=(), Reset(), and SetHttpStatusMsg().
Definition at line 87 of file HttpResponse.h. Referenced by Cookie(), CookieNames(), operator=(), Reset(), and SetCookie().
Definition at line 88 of file HttpResponse.h. Referenced by GetFile(), operator=(), Reset(), SetFile(), Write(), and Writef().
The documentation for this class was generated from the following files: |