CUpnpHttpMessage Class Reference
class CUpnpHttpMessage : public CBase |
Also contains Sessionid, DestinationPath and SenderPath. SessionId identifies the HTTPSession this message belongs to. DestinationPath and SenderPath are used to identify actions in GENA messages.
Public Member Functions |
---|
| ~CUpnpHttpMessage() |
IMPORT_C void | AddPairL(const TDesC8 &, const TDesC8 &) |
IMPORT_C void | AddrInput(TInetAddr &, const TDesC8 &) |
IMPORT_C void | AddrOutput(const TInetAddr &, TDes8 &) |
IMPORT_C TDesC8 & | Body() |
IMPORT_C TInt | BodyLength() |
IMPORT_C void | CancelMessageTimeout() |
IMPORT_C TBool | ClientRequest() |
IMPORT_C TPtrC8 | DestinationPath() |
IMPORT_C const TPtrC8 | DevicePath() |
IMPORT_C TInt | Error() |
IMPORT_C TInt | FindLWS(const TDesC8 &) |
IMPORT_C TDesC8 & | GetHeaderValue(const TDesC8 &) |
IMPORT_C CUpnpHttpHeaderList * | HeaderList() |
IMPORT_C HBufC8 * | HeadersToStringL() |
IMPORT_C const TDesC8 & | HttpError(THttpStatusCode) |
IMPORT_C TThreadPriority | HttpPriority() |
IMPORT_C TPtrC8 | InFilename() |
IMPORT_C TInt | InternalError() |
IMPORT_C TBool | Is1xx() |
IMPORT_C TBool | Is2xx() |
IMPORT_C TBool | Is3xx() |
IMPORT_C TBool | IsGena() |
IMPORT_C TDesC8 & | IsHeader(const TDesC8 &, TBool &) |
IMPORT_C TBool | IsSoap() |
IMPORT_C TInt | Length() |
IMPORT_C TBool | Local() |
IMPORT_C const TPtrC8 | Method() |
IMPORT_C CUpnpHttpMessage * | NewL() |
IMPORT_C CUpnpHttpMessage * | NewL(const TInetAddr &) |
IMPORT_C CUpnpHttpMessage * | NewL(TInetAddr, TInt) |
IMPORT_C CUpnpHttpMessage * | NewL(TDesC8 &, TInetAddr) |
IMPORT_C CUpnpHttpMessage * | NewL(TDesC8 &, const TInetAddr &, TInt) |
IMPORT_C TInt | NewSessionIdL() |
IMPORT_C TInt | Offset() |
IMPORT_C TPtrC8 | OutFilename() |
IMPORT_C const TDesC8 & | OutUri() |
IMPORT_C TBool | OverwriteExisting() |
IMPORT_C TAny * | PendingRequest() |
IMPORT_C TInetAddr & | Receiver() |
IMPORT_C void | RemovePairL(const TDesC8 &) |
IMPORT_C const TPtrC8 | RequestHTTPVersion() |
IMPORT_C TInt | RetryCounter() |
IMPORT_C TBool | SaveAtOffset() |
IMPORT_C TInetAddr & | Sender() |
IMPORT_C TPtrC8 | SenderPath() |
IMPORT_C const TPtrC8 | SenderPathFromHeader() |
IMPORT_C const TPtrC8 | ServicePath() |
IMPORT_C TInt | SessionId() |
IMPORT_C TBool | SessionIdMatch(const CUpnpHttpMessage &, const CUpnpHttpMessage &) |
IMPORT_C void | SetBodyL(const TDesC8 &) |
IMPORT_C void | SetClientRequest(TBool) |
IMPORT_C void | SetDestinationPathL(const TDesC8 &) |
IMPORT_C void | SetHttpPriority(TThreadPriority) |
IMPORT_C void | SetInFilenameL(const TDesC8 &, TBool) |
IMPORT_C void | SetInternalError(TInt) |
IMPORT_C void | SetLocal(TBool) |
IMPORT_C void | SetMessageDateL(const TTime &) |
IMPORT_C TInt | SetMessageTimeoutL(MUpnpMessageObserver *, const TInt) |
IMPORT_C void | SetOutFilenameL(const TDesC8 &) |
IMPORT_C void | SetOutUriL(const TDesC8 &) |
IMPORT_C void | SetPendingRequest(TAny *) |
IMPORT_C void | SetRangeL(TInt, TInt, TBool) |
IMPORT_C void | SetRetryCounter(TInt) |
IMPORT_C void | SetSenderPathL(const TDesC8 &) |
IMPORT_C void | SetSessionId(TInt) |
IMPORT_C void | SetTcpTimeout(TInt) |
IMPORT_C void | SetType(THTTPMsgType) |
IMPORT_C TInt | TcpTimeout() |
IMPORT_C HBufC8 * | ToStringL() |
IMPORT_C THTTPMsgType | Type() |
IMPORT_C const TDesC8 & | UpnpError(TUpnpErrorCode) |
IMPORT_C HBufC8 * | UpnpErrorL(TUpnpErrorCode) |
Constructor & Destructor Documentation
CUpnpHttpMessage()
IMPORT_C | CUpnpHttpMessage | ( | ) | [protected] |
~CUpnpHttpMessage()
IMPORT_C | ~CUpnpHttpMessage | ( | ) | [virtual] |
Member Functions Documentation
AddPairL(const TDesC8 &, const TDesC8 &)
IMPORT_C void | AddPairL | ( | const TDesC8 & | aName, |
| const TDesC8 & | aValue |
| ) | |
Adds a Header row in this message.
Parameters
const TDesC8 & aName | Name of the header. |
const TDesC8 & aValue | Value of the header. |
AddrInput(TInetAddr &, const TDesC8 &)
Sets the TInetAddr object value to given aBuf.
Parameters
TInetAddr & aAddr | Address that will contain same logical value as aBuf after conversion. |
const TDesC8 & aBuf | String we want to convert to TInetAddr. |
AddrOutput(const TInetAddr &, TDes8 &)
Sets the aBuf as string presentation of aAddr
Parameters
const TInetAddr & aAddr | Address that will be converted. |
TDes8 & aBuf | Buffer that will contain textual presentation of aAddr. |
AppendContentLengthToHeadersL(HBufC8 *&)
IMPORT_C void | AppendContentLengthToHeadersL | ( | HBufC8 *& | aHeaders | ) | [protected, virtual] |
Append ContentLength when headers are dumped to string (using by public method HeadersToStringL)
Parameters
HBufC8 *& aHeaders | without "Content-Length" |
Body()
Returns the body of message.
BodyLength()
IMPORT_C TInt | BodyLength | ( | ) | const |
Returns length of message body.
CancelMessageTimeout()
IMPORT_C void | CancelMessageTimeout | ( | ) | |
Cancels the timer on message.
ClientRequest()
IMPORT_C TBool | ClientRequest | ( | ) | |
Returns if message is a client requests.
ConstructL()
IMPORT_C void | ConstructL | ( | ) | [protected] |
ConstructL(TInetAddr &, TInt)
IMPORT_C void | ConstructL | ( | TInetAddr & | aSender, |
| TInt | aSessionId |
| ) | [protected] |
DestinationPath()
IMPORT_C TPtrC8 | DestinationPath | ( | ) | |
Returns the DestinationPath of the message.
DevicePath()
IMPORT_C const TPtrC8 | DevicePath | ( | ) | |
Returns the service used from http message, for example MediaServer:1 from Mediaserver:1/ContentDirectory.
Error()
Returns the error code of the message.
FindLWS(const TDesC8 &)
Find FIRST occurence of LWS = [CRLF] 1*( SP | HT ) (RFC 2616 2.2 Basic Rules) RFC2822 2.2.3 Unfolding is accomplished by simply removing any CRLF that is immediately followed by WSP
Parameters
const TDesC8 & aText | text which include many headers (some can be folded) |
FoldHeaderL(HBufC8 *&)
IMPORT_C void | FoldHeaderL | ( | HBufC8 *& | aHeader | ) | [protected] |
Fold long header fields where is a "MUST limit 998" (including the header's name and value but excluding the last carriage-return/line-feed sequence, CRLF). BODY portion of a header field can be split into a multiple line representation. RFC2822 2.2.3 folding SHOULD be limited to placing the CRLF at higher-level syntactic breaks DLNA v1.5 7.4.14.3 HTTP headers that span multiple lines must prefix the additional lines with at least one space (SP) or horizontal tab (HT) as described in section
GetHeaderValue(const TDesC8 &)
Returns value of the header.
Parameters
const TDesC8 & aName | Name of the header to be returned. |
HeaderList()
Returns a pointer to this message's headerlist.
HeadersToStringL()
IMPORT_C HBufC8 * | HeadersToStringL | ( | ) | [virtual] |
HttpError(THttpStatusCode)
Returns the textual error message of given error code.
HttpPriority()
Returns the priority of HTTP session used with this message.
InFilename()
Returns the name of file where to save incoming content.
InternalError()
IMPORT_C TInt | InternalError | ( | ) | |
Returns the internal error code for a message
Is1xx()
Checks if message is a 1xx response.
Is2xx()
Checks if message is a 2xx response.
Is3xx()
Checks if message is a 3xx response.
IsGena()
Checks if message is GENA message.
IsHeader(const TDesC8 &, TBool &)
Check if header exists, also return value of header if exists
Parameters
const TDesC8 & aHeaderName | Name of the header. |
TBool & aExist | True if header exist, false if not. |
IsSoap()
IMPORT_C TBool | IsSoap | ( | ) | const |
Checks if message is SOAP message.
Length()
Returns the length of file content to be requested.
Local()
Returns if message is a local requests.
Method()
Returns the method of message, like GET, POST etc.
NewL(const TInetAddr &)
Parameters
const TInetAddr & aAddr | Destination ip address. |
NewL(TInetAddr, TInt)
Parameters
TInetAddr aAddr | Destination ip address. |
TInt aSessionId | Session id of the message. |
NewL(TDesC8 &, TInetAddr)
Parameters
TDesC8 & aMessageBuffer | Buffer which contains the message. |
TInetAddr aSender | Sender's IP address. |
NewL(TDesC8 &, const TInetAddr &, TInt)
Parameters
TDesC8 & aMessageBuffer | Buffer which contains the message. |
const TInetAddr & aSender | Sender's IP address. |
TInt aSessionId | Session id of the message. |
NewSessionIdL()
IMPORT_C TInt | NewSessionIdL | ( | ) | [static] |
Creates new, unused Session id value.
Offset()
Returns the offset of the file that should be requested from server.
OutFilename()
Returns the name of file which will be set as body of message to send.
OutUri()
IMPORT_C const TDesC8 & | OutUri | ( | ) | |
Returns the value of OutUri.
OverwriteExisting()
IMPORT_C TBool | OverwriteExisting | ( | ) | |
Returns if the existing file should be overwritten with the requested content. If not then the new file with name: aFilename_serialNumber will be created.
ParseHeaderRowL(const TDesC8 &, TBool)
IMPORT_C void | ParseHeaderRowL | ( | const TDesC8 & | aBuffer, |
| TBool | aFirstLine |
| ) | [protected] |
Parses one row of headers.
Parameters
const TDesC8 & aBuffer | Buffer that contains one header row ("Connection: close" for example). |
TBool aFirstLine | ETrue if parsing first header row of Httpmessage, EFalse otherwise. This is needed because first line has to be parsed differently. |
ParseL(TDesC8 &)
IMPORT_C void | ParseL | ( | TDesC8 & | aBuffer | ) | [protected, virtual] |
Parses a HttpMessage object from aBuffer.
Parameters
TDesC8 & aBuffer | Buffer to parse. |
PendingRequest()
IMPORT_C TAny * | PendingRequest | ( | ) | |
Returns iPendingRequest pointer.
Receiver()
Returns the IP address of the receiver of the message.
RemovePairL(const TDesC8 &)
IMPORT_C void | RemovePairL | ( | const TDesC8 & | aName | ) | |
RequestHTTPVersion()
IMPORT_C const TPtrC8 | RequestHTTPVersion | ( | ) | |
Returns version of HTTP Request, like HTTP/1.1, HTTP/1.0 etc.
RetryCounter()
IMPORT_C TInt | RetryCounter | ( | ) | |
Returns the current iRetryCounter value.
SaveAtOffset()
IMPORT_C TBool | SaveAtOffset | ( | ) | |
Return if the requested offset of the remote file should be saved at physical offset of the local file.
Sender()
Returns the IP address of the sender of the message.
SenderPath()
Returns the SenderPath of the message.
SenderPathFromHeader()
IMPORT_C const TPtrC8 | SenderPathFromHeader | ( | ) | |
Returns the SenderPath from Headers.
ServicePath()
IMPORT_C const TPtrC8 | ServicePath | ( | ) | const |
Returns the service used from http message, for example ContentDirectory from Mediaserver:1/ContentDirectory.
SessionId()
IMPORT_C TInt | SessionId | ( | ) | const |
Returns the SessionId of the message.
SessionIdMatch(const CUpnpHttpMessage &, const CUpnpHttpMessage &)
Compares if two messages have same session id.
SetBodyL(const TDesC8 &)
IMPORT_C void | SetBodyL | ( | const TDesC8 & | aBody | ) | |
Sets the body of message.
Parameters
const TDesC8 & aBody | Buffer that contains the body for the message. |
SetClientRequest(TBool)
IMPORT_C void | SetClientRequest | ( | TBool | aClientRequest | ) | |
Sets if message is a client request
Parameters
TBool aClientRequest | value indicating if message is from the client. |
SetDestinationPathL(const TDesC8 &)
IMPORT_C void | SetDestinationPathL | ( | const TDesC8 & | aDestinationPath | ) | |
Sets the DestinationPath of the message.
Parameters
const TDesC8 & aDestinationPath | Destination Path to be set. |
SetHttpPriority(TThreadPriority)
Sets the priority for HTTP session used with this message.
SetInFilenameL(const TDesC8 &, TBool)
IMPORT_C void | SetInFilenameL | ( | const TDesC8 & | aFilename, |
| TBool | aOverwriteExisting = EFalse |
| ) | |
Sets the filename where to save incoming content. The default behaviour is that the requested file is downloaded and if there is already file with name as the given one the requested content will be saved under the same name but with serial number prefix.
Parameters
const TDesC8 & aFilename | Path and name of file where to save. |
TBool aOverwriteExisting = EFalse | Should the existing file with the same name be overwritten. If flag is set to EFalse then the new file with name: aFilename_serialNumber will be created. |
SetInternalError(TInt)
IMPORT_C void | SetInternalError | ( | TInt | aErrorCode | ) | |
Sets the internal error code for a message
SetLocal(TBool)
IMPORT_C void | SetLocal | ( | TBool | aLocal | ) | |
Sets if message is a local requests
Parameters
TBool aLocal | value indicating if message is local. |
SetMessageDateL(const TTime &)
IMPORT_C void | SetMessageDateL | ( | const TTime & | time | ) | |
Sets the date of message.
Parameters
const TTime & time | Time to set in message. |
SetMessageTimeoutL(MUpnpMessageObserver *, const TInt)
Sets the timer on message to expire in given time. Makes callback to MSsdpMessageObserver* after timeout.
Parameters
MUpnpMessageObserver * aObserver | Pointer to message's timer observer. |
const TInt aTimeoutValue | Number of microseconds to expire. |
SetOutFilenameL(const TDesC8 &)
IMPORT_C void | SetOutFilenameL | ( | const TDesC8 & | aFilename | ) | |
Sets the filename which will be used as message body.
Parameters
const TDesC8 & aFilename | Path and name of file to use. |
SetOutUriL(const TDesC8 &)
IMPORT_C void | SetOutUriL | ( | const TDesC8 & | aUri | ) | |
Sets the uri to find the local file.
SetPendingRequest(TAny *)
IMPORT_C void | SetPendingRequest | ( | TAny * | aPointer | ) | |
Sets the private member iPendingRequest.
Parameters
TAny * aPointer | Pointer to CUpnpAction. |
SetRangeL(TInt, TInt, TBool)
IMPORT_C void | SetRangeL | ( | TInt | aOffset, |
| TInt | aLength, |
| TBool | aSaveAtOffset |
| ) | |
Sets the range of remote filename which will be requested. Calling this method involves sending GET request with "Range" HTTP header, so this header should not be explicitly added by caller! If server doesn't support "Range" header then will probably respond with HTTP 200 Ok and the whole content, so observer will be notified with such a message instead of HTTP 206 Partial Content.
Parameters
TInt aOffset | Offset of the file that should be requested from server. |
TInt aLength | Length of file content to be requested. Notice that if aOffset is set to some value and aLength is set to 0 then the range from aOffset to the end of file will be requested. If both, offset and length are set to 0 then the range mode is off and whole file will be requested. |
TBool aSaveAtOffset | Should the requested offset of the remote file be saved at physical offset of existing local file. Notice that to save in local file at the same offset of the file the following requirements should be met:Local file with the name passed in aFilename parameter must exists.In the file there must be already content at least from beginning of the file to the aOffset-1 position.The flag aOverwriteExisting in SetInFilenameL method must be set to ETrue. If one of the mentioned requirements won't be met then the range content will be saved in new file at the beginning, if aOverwriteExisting is set to EFalse, or in the existing file at the beginning of the file, if aOverwriteExisting is set to ETrue. |
SetRetryCounter(TInt)
IMPORT_C void | SetRetryCounter | ( | TInt | aValue | ) | |
Sets the retry counter value
Parameters
TInt aValue | value to be set for RetryCounter. |
SetSenderPathL(const TDesC8 &)
IMPORT_C void | SetSenderPathL | ( | const TDesC8 & | aSourcePath | ) | |
Sets the SourcePath of the message.
Parameters
const TDesC8 & aSourcePath | Source Path to be set. |
SetSessionId(TInt)
IMPORT_C void | SetSessionId | ( | TInt | aId | ) | |
Sets messages Session id.
Parameters
TInt aId | Session id we want the message to have. |
SetTcpTimeout(TInt)
IMPORT_C void | SetTcpTimeout | ( | TInt | aTimeout | ) | |
Sets a timeout for a session (valid only for TCP client sessions!)
Parameters
TInt aTimeout | value in microseconds. |
SetType(THTTPMsgType)
Sets the type of message. Used by ControlPoint
TcpTimeout()
IMPORT_C TInt | TcpTimeout | ( | ) | |
Returns the value of TCP-session's timeout for a message.
TimerEventL(CUpnpNotifyTimer *)
ToStringL()
IMPORT_C HBufC8 * | ToStringL | ( | ) | [virtual] |
Type()
Returns the Http message type, used by controlpoint.
UnFoldHeader(HBufC8 *&)
IMPORT_C void | UnFoldHeader | ( | HBufC8 *& | aHeader | ) | [protected] |
Unfolding header RFC2822 2.2.3 Unfolding from ONE header is accomplished by simply removing any CRLF that is immediately followed by WSP
UpnpError(TUpnpErrorCode)
Returns textual presentation of the given error.
UpnpErrorL(TUpnpErrorCode)
Returns textual presentation of the given error.
Member Data Documentation
TBool
iClientRequest
TBool
| iClientRequest | [protected] |
Indicate to the upper layer that a message is a client request sent to our (this) host, if False it is ignored It should prevent confusing a client session with the server one by the upper layer
HBufC8 * iDestinationPath
HBufC8 * | iDestinationPath | [protected] |
Variable used to route messages thru Dispatcher.
CUpnpHttpHeaderList * iHeaderList
HBufC8 * iInFilename
HBufC8 * | iInFilename | [protected] |
Buffer that contains the path and filename of file used to save incoming data.
TInt
iInternalError
TInt
| iInternalError | [protected] |
TInt
iLength
Length of file content to be requested.
TBool
iLocal
Indicate whether request is local (it means send by local shortcut) or remote,
MUpnpMessageObserver * iMessageObserver
Calls this observer's MessageExpiredL() function when iTimer expires.
TInt
iOffset
Offset of the file that should be requested from server.
HBufC8 * iOutFilename
HBufC8 * | iOutFilename | [protected] |
Buffer that contains the path and filename of file used as message body when sending message.
HBufC8 * iOutUri
Used for resolving url presentation to local filesystem file.
TBool
iOverwriteExisting
TBool
| iOverwriteExisting | [protected] |
Should the existing local file be overwritten with the requested content. If not then the new file with name: iInFilename_serialNumber will be created to save incoming content.
TAny * iPendingRequest
TAny * | iPendingRequest | [protected] |
Variable used by controlpoint.
TInetAddr
iRemoteHost
Destination of this message.
TInt
iRetryCounter
TInt
| iRetryCounter | [protected] |
Counter that is used to track resending count, for example in Control point.
TBool
iSaveAtOffset
TBool
| iSaveAtOffset | [protected] |
Should the requested offset of the remote file be saved at physical offset of existing local file.
HBufC8 * iSenderPath
HBufC8 * | iSenderPath | [protected] |
Variable used to route messages thru Dispatcher.
TInt
iSessionId
TInt
| iSessionId | [protected] |
Variable used to route messages to correct Http session.
TThreadPriority
iSessionPriority
Priority that is used for HTTP session with this message.
TInt
iTcpTimeout
TInt
| iTcpTimeout | [protected] |
Indicates the session timeout value, used only in client sessions of TcpServer! It should prevent confusing a client session with the server one by the upper layer
CUpnpNotifyTimer * iTimer
Timer that is used in SSDP messages to cause randomness in sending SSDP messages.
THTTPMsgType
iType
Variable used by controlpoint.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.