The base class for browser and server nodes.
More...
#include <HttpNodeBase.h>
The base class for browser and server nodes.
See the derived classes HttpBrowserBase and HttpServerBase for details
- See also
- HttpBrowserBase
-
HttpServerBase
- Author
- Kristjan V. Jonsson (krist.nosp@m.janv.nosp@m.j@gma.nosp@m.il.c.nosp@m.om)
inet::httptools::HttpNodeBase::HttpNodeBase |
( |
| ) |
|
std::string inet::httptools::HttpNodeBase::formatHttpRequestLong |
( |
const HttpRequestMessage * |
httpRequest | ) |
|
|
protected |
Referenced by logRequest().
143 std::ostringstream str;
145 str <<
"REQUEST: " << httpRequest->getName() <<
" -- " << httpRequest->getByteLength() <<
" bytes\n";
146 str <<
"Target URL:" << httpRequest->targetUrl() <<
" Originator URL:" << httpRequest->originatorUrl() << endl;
149 switch (httpRequest->protocol()) {
164 str <<
"KEEP-ALIVE:" << httpRequest->keepAlive() <<
" ";
165 str <<
"BAD-REQ:" << httpRequest->badRequest() <<
" ";
166 str <<
"SERIAL:" << httpRequest->serial() <<
" " << endl;
168 str <<
"REQUEST:" << httpRequest->heading() << endl;
std::string inet::httptools::HttpNodeBase::formatHttpRequestShort |
( |
const HttpRequestMessage * |
httpRequest | ) |
|
|
protected |
Referenced by logRequest().
108 std::ostringstream str;
110 std::string originatorStr =
"";
112 if (originator !=
nullptr)
113 originatorStr = originator->getFullName();
115 str << originatorStr <<
";";
116 str <<
"REQ;" << httpRequest->originatorUrl() <<
";" << httpRequest->targetUrl() <<
";";
117 str << httpRequest->protocol() <<
";" << httpRequest->keepAlive() <<
";" << httpRequest->serial() <<
";";
118 str << httpRequest->heading() <<
";" << httpRequest->badRequest() <<
";;";
cModule * findContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:56
std::string inet::httptools::HttpNodeBase::formatHttpResponseLong |
( |
const HttpReplyMessage * |
httpResponse | ) |
|
|
protected |
Referenced by logResponse().
175 std::ostringstream str;
177 str <<
"RESPONSE: " << httpResponse->getName() <<
" -- " << httpResponse->getByteLength() <<
" bytes\n";
179 str <<
"Target URL:" << httpResponse->targetUrl() <<
" Originator URL:" << httpResponse->originatorUrl() << endl;
182 switch (httpResponse->protocol()) {
197 str <<
"RESULT:" << httpResponse->result() <<
" ";
198 str <<
"KEEP-ALIVE:" << httpResponse->keepAlive() <<
" ";
199 str <<
"SERIAL:" << httpResponse->serial() <<
" " << endl;
201 str <<
"RESPONSE: " << httpResponse->heading() << endl;
203 str <<
"CONTENT-TYPE:";
204 switch (httpResponse->contentType()) {
210 str <<
"Text/HTML RES";
224 str <<
"CONTENT:" << endl;
225 str << httpResponse->payload() << endl;
std::string inet::httptools::HttpNodeBase::formatHttpResponseShort |
( |
const HttpReplyMessage * |
httpResponse | ) |
|
|
protected |
Referenced by logResponse().
125 std::ostringstream str;
127 std::string originatorStr =
"";
129 if (originator !=
nullptr)
130 originatorStr = originator->getFullName();
132 str << originatorStr <<
";";
133 str <<
"RESP;" << httpResponse->originatorUrl() <<
";" << httpResponse->targetUrl() <<
";";
134 str << httpResponse->protocol() <<
";" << httpResponse->keepAlive() <<
";" << httpResponse->serial() <<
";";
135 str << httpResponse->heading() <<
";;";
136 str << httpResponse->result() <<
";" << httpResponse->contentType();
cModule * findContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:56
|
inlineoverrideprotectedvirtual |
Perform one stage of a lifecycle operation.
Processing may be done entirely within this method, or may be a longer process that involves nonzero simulation time or several events, and is triggered by this method call.
Return value: true = "done"; false = "not yet done, will invoke
doneCallback when done"
Implements inet::ILifecycle.
95 { Enter_Method_Silent();
throw cRuntimeError(
"Unsupported lifecycle operation '%s'", operation->getClassName());
return true; }
void inet::httptools::HttpNodeBase::initialize |
( |
int |
stage | ) |
|
|
overridevirtual |
Reimplemented in inet::httptools::HttpBrowserBase, inet::httptools::HttpServerBase, inet::httptools::HttpBrowser, inet::httptools::HttpServer, inet::httptools::HttpServerDirectEvilA, inet::httptools::HttpServerDirectEvilB, inet::httptools::HttpServerEvilA, inet::httptools::HttpServerEvilB, inet::httptools::HttpServerDirect, and inet::httptools::HttpBrowserDirect.
Referenced by inet::httptools::HttpServerBase::initialize(), and inet::httptools::HttpBrowserBase::initialize().
34 EV_DEBUG <<
"Initializing base HTTP browser component -- stage " << stage << endl;
36 cSimpleModule::initialize(stage);
Local initializations.
Definition: InitStages.h:35
cModule * getContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:65
void inet::httptools::HttpNodeBase::logEntry |
( |
std::string |
line | ) |
|
|
protected |
Referenced by logRequest(), and logResponse().
90 std::ofstream outfile;
95 if (outfile.tellp() == 0)
96 outfile <<
"time;simtime;logging-node;sending-node;type;originator-url;target-url;protocol;keep-alive;serial;heading;bad-req;result-code;content-type" << endl;
97 outfile << curtime <<
";" << simTime() <<
";" <<
host->getName();
102 outfile << line << endl;
void inet::httptools::HttpNodeBase::logResponse |
( |
const HttpReplyMessage * |
httpResponse | ) |
|
|
protected |
virtual int inet::httptools::HttpNodeBase::numInitStages |
( |
| ) |
const |
|
inlineoverridevirtual |
void inet::httptools::HttpNodeBase::sendDirectToModule |
( |
HttpNodeBase * |
receiver, |
|
|
cPacket * |
packet, |
|
|
simtime_t |
constdelay = 0.0 , |
|
|
rdObject * |
rd = nullptr |
|
) |
| |
|
protected |
double inet::httptools::HttpNodeBase::transmissionDelay |
( |
cPacket * |
packet | ) |
|
|
protected |
bool inet::httptools::HttpNodeBase::enableLogging = true |
|
protected |
cModule* inet::httptools::HttpNodeBase::host = nullptr |
|
protected |
int inet::httptools::HttpNodeBase::httpProtocol = 0 |
|
protected |
unsigned long inet::httptools::HttpNodeBase::linkSpeed = 0 |
|
protected |
std::string inet::httptools::HttpNodeBase::logFileName |
|
protected |
bool inet::httptools::HttpNodeBase::m_bDisplayMessage = true |
|
protected |
bool inet::httptools::HttpNodeBase::m_bDisplayResponseContent = true |
|
protected |
The documentation for this class was generated from the following files: