CUpnpHttpSession Class Reference

class CUpnpHttpSession : public CUpnpTcpSession
Since
Series60 2.6

Inherits from

Public Member Functions
~CUpnpHttpSession()
voidBufferReceivedL(TDesC8 &)
voidDeleteFileIfExists(TDesC16 &)
voidDeleteServeFileL()
voidDeleteThisSessionL(CUpnpTcpSession *)
CUpnpHttpFileAccess *FileAccess()
CUpnpHttpServer *HttpServer()
TBool IsMsgReady()
TInt Length()
CUpnpHttpSession *NewL(RSocket, CUpnpHttpServer *, TInt, TThreadPriority)
voidNotifyErrorL(TInt, TInt)
TInt Offset()
TBool OverwriteExisting()
TBool SaveAtOffset()
voidSendL(CUpnpHttpMessage *)
TBool SetRedirectCount()
Protected Member Functions
voidDestroyIt(CUpnpTcpSession *)
TBool FileServeExists()
TInt ServerPort()
Private Member Functions
CUpnpHttpSession(RSocket, CUpnpHttpServer *, TInt, TThreadPriority)
voidBufferReceivedCheckingHeadersL(TDesC8 &)
voidBufferReceivedProcessL(TDesC8 &)
voidCheckConnectionCloseL()
voidCheckSessionPersistence(CUpnpHttpMessage *)
voidConstructL()
voidFileTransferReaderDoneL()
voidFileTransferReaderErrorL(TInt)
voidFileTransferWriterDoneL()
voidFileTransferWriterHandleMoreL()
voidHandleQueryL(CUpnpHttpMessage *)
THttpInvalidMessage IsValidMessage(CUpnpHttpMessage *)
TInt MatchHttpError(TInt)
voidNotifyDisconnectL(TInetAddr)
voidNotifyTimeoutL()
voidNotifyUpperLayerLD(CUpnpHttpMessage *)
voidNotifyUpperLayersOnPostL()
voidPostingFileCompleteL()
TInt PrepareRangeHeaderL(CUpnpHttpMessage *, TBool, TInt, CUpnpHttpServerTransaction &, TInt &, TInt &, TInt &)
TPtrC8 PrepareRelativeUriL(const TDesC8 &)
TInt PrepareToServeFileL(CUpnpHttpMessage *)
voidResetSettingsL()
voidResponseErrorL(TInt)
voidSinglePostBufferReceivedL(TDesC8 &)
voidSocketServerBusyL(const TInetAddr &)
voidWriteMsgAndHeaderL(CUpnpHttpMessage *, const TDesC8 &, const TDesC &, TInt, TInt, const TInt, const TInt)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CUpnpTcpSession::CUpnpTcpSession(RSocket &,TThreadPriority)
CUpnpTcpSession::CancelTcpReader()
CUpnpTcpSession::CloseSocketL()
CUpnpTcpSession::DisconnectRequestL()
CUpnpTcpSession::DownloadOngoing()
CUpnpTcpSession::FileTransferReader()
CUpnpTcpSession::FileTransferReaderConstructL()
CUpnpTcpSession::FileTransferWriter()
CUpnpTcpSession::FileTransferWriterConstructL(TInt)
CUpnpTcpSession::HandleErrorL(TInt)
CUpnpTcpSession::Id()
CUpnpTcpSession::InitialReceiveL()
CUpnpTcpSession::IsConnected()
CUpnpTcpSession::IsPersistentConnection()
CUpnpTcpSession::ReceiveL()
CUpnpTcpSession::ReceivingCompletedL(TDesC8 &)
CUpnpTcpSession::RemoteHost()
CUpnpTcpSession::ServerBusyL()
CUpnpTcpSession::ShutdownStop()
CUpnpTcpSession::ShuttingDown()
CUpnpTcpSession::StartClosingSession()
CUpnpTcpSession::StartDisconnect(TBool)
CUpnpTcpSession::StartDisconnectingTimer(TInt)
CUpnpTcpSession::StartTimeoutTimer(TBool)
CUpnpTcpSession::TcpConstructL(RSocket,TInt,TInt)
CUpnpTcpSession::TimeoutCurrentValue()
CUpnpTcpSession::TimerCancel()
CUpnpTcpSession::TimerEventL(CUpnpNotifyTimer *)
CUpnpTcpSession::WaitRetryError(TInt,TBool)
CUpnpTcpSession::WriteL(const TDesC8 &)
CUpnpTcpSession::WritingCompletedL()
CUpnpTcpSession::~CUpnpTcpSession()
Private Member Enumerations
enumTHttpInvalidMessage { EMessageOk = 0, EUnknownMethod }
Private Attributes
HBufC8 *iDestinationPath
TBool iErrorNotified
CUpnpHttpFileAccess *iFileServe
TBool iHeadersCompleted
HBufC8 *iInFilename
TBool iIsChunked
TInt iLength
TBool iMaximumSizeChecked
TInt iOffset
HBufC8 *iOutFilename
TBool iOverwriteExisting
TAny *iPendingRequest
RPointerArray< CUpnpHttpMessage > *iPendingRequests
THTTPMsgTypeiRequestType
TBool iRequestedTransferNotifySent
TInt iRetryCounter
TBool iSaveAtOffset
HBufC8 *iSenderPath
CUpnpHttpServer *iServer
TBool iSessionIsDeletedAfterResponse
TBool iUsesConnectionClose
Inherited Attributes
CUpnpTcpSession::iAddr
CUpnpTcpSession::iContinuedMessageDownload
CUpnpTcpSession::iDisconnectNotification
CUpnpTcpSession::iExportRetryCounter
CUpnpTcpSession::iFTReader
CUpnpTcpSession::iFTWriter
CUpnpTcpSession::iFileReadBufferSize
CUpnpTcpSession::iId
CUpnpTcpSession::iInitialPriority
CUpnpTcpSession::iIsPersistent
CUpnpTcpSession::iPendingPostRequests
CUpnpTcpSession::iReceivedMessage
CUpnpTcpSession::iSaveToFile
CUpnpTcpSession::iSessionError
CUpnpTcpSession::iSessionKeepAlive
CUpnpTcpSession::iSessionNeedsErrorReply
CUpnpTcpSession::iSocket
CUpnpTcpSession::iSocketShutdown
CUpnpTcpSession::iState
CUpnpTcpSession::iTcpReader
CUpnpTcpSession::iTcpWriter
CUpnpTcpSession::iTimeoutCurrentValue
CUpnpTcpSession::iTimeoutSessionValue
CUpnpTcpSession::iTimeoutTimer

Constructor & Destructor Documentation

CUpnpHttpSession(RSocket, CUpnpHttpServer *, TInt, TThreadPriority)

CUpnpHttpSession(RSocketaSocket,
CUpnpHttpServer *aServer,
TIntaSessionId,
TThreadPriorityaPriority
)[private]
First phase constructor. This constructor is used when connection is iniatiated from network.
Since
Series60 2.6

Parameters

RSocket aSocketPointer to new socket.
CUpnpHttpServer * aServerPointer to owning HttpServer.
TInt aSessionIdSession id of this session.
TThreadPriority aPriorityPriority of this session

~CUpnpHttpSession()

~CUpnpHttpSession()[virtual]

Virtual Destructor function.

Member Functions Documentation

BufferReceivedCheckingHeadersL(TDesC8 &)

voidBufferReceivedCheckingHeadersL(TDesC8 &aBuffer)[private]
Received buffer checking headers for a message coming from network.
Since
Series60 2.6

Parameters

TDesC8 & aBufferBuffer that has been received.

BufferReceivedL(TDesC8 &)

voidBufferReceivedL(TDesC8 &aBuffer)[virtual]
Callback function from TcpSession. Session has received aBuffer from network.
Since
Series60 2.6

Parameters

TDesC8 & aBufferBuffer that has been received.

BufferReceivedProcessL(TDesC8 &)

voidBufferReceivedProcessL(TDesC8 &aBuffer)[private]
Received buffer processing from network.
Since
Series60 2.6

Parameters

TDesC8 & aBufferBuffer that has been received.

CheckConnectionCloseL()

voidCheckConnectionCloseL()[private, virtual]
Checks if session uses Connection close communication.
Since
Series60 2.6

CheckSessionPersistence(CUpnpHttpMessage *)

voidCheckSessionPersistence(CUpnpHttpMessage *aMsg)[private]
Checks session and message against persistence
Since
Series60 3.2

Parameters

CUpnpHttpMessage * aMsg

ConstructL()

voidConstructL()[private]

Symbian constructor

DeleteFileIfExists(TDesC16 &)

voidDeleteFileIfExists(TDesC16 &aFilename)
Deletes a file named aFilename if it exists. Used in receiving files to delete file if it already exists.
Since
Series60 2.6

Parameters

TDesC16 & aFilenameFile to be deleted.

DeleteServeFileL()

voidDeleteServeFileL()[virtual]
Deletes the FileAccess of this session.
Since
Series60 2.6

DeleteThisSessionL(CUpnpTcpSession *)

voidDeleteThisSessionL(CUpnpTcpSession *aSession)[virtual]
Deletes current session.
Since
Series60 2.6

Parameters

CUpnpTcpSession * aSessionSession to b deleted.

DestroyIt(CUpnpTcpSession *)

voidDestroyIt(CUpnpTcpSession *aSession)[protected, virtual]

Parameters

CUpnpTcpSession * aSession

FileAccess()

CUpnpHttpFileAccess *FileAccess()[virtual]
Returns a pointer to file transfer object of this session.
Since
Series60 2.6

FileServeExists()

TBool FileServeExists()[protected, virtual]
Returns ETrue, if fileserve exists.
Since
Series60 2.6

FileTransferReaderDoneL()

voidFileTransferReaderDoneL()[private, virtual]
File Transfer Reader callback when upload done
Since
Series60 3.2

FileTransferReaderErrorL(TInt)

voidFileTransferReaderErrorL(TIntaError)[private, virtual]
File Transfer Reader callback when upload with error
Since
Series60 3.2

Parameters

TInt aError

FileTransferWriterDoneL()

voidFileTransferWriterDoneL()[private, virtual]
File Transfer Writer callback when download done
Since
Series60 3.2

FileTransferWriterHandleMoreL()

voidFileTransferWriterHandleMoreL()[private, virtual]
File Transfer Writer callback for handling more downloads
Since
Series60 3.2

HandleQueryL(CUpnpHttpMessage *)

voidHandleQueryL(CUpnpHttpMessage *aMsg)[private]
Decides what to do with the message, should it be sent to upper layer, Takes ownership of a parameter (it should be popped from cleanup stack before call
Since
Series60 2.6

Parameters

CUpnpHttpMessage * aMsgMessage to check.

HttpServer()

CUpnpHttpServer *HttpServer()
Returns HttpServer pointer
Since
Series60 3.2

IsMsgReady()

TBool IsMsgReady()
Returns ETrue when message is totally downloaded [completed]
Since
Series60 3.2

IsValidMessage(CUpnpHttpMessage *)

THttpInvalidMessage IsValidMessage(CUpnpHttpMessage *aMsg)[private]
Checks message validity. Returns type of error.
Since
Series60 2.6

Parameters

CUpnpHttpMessage * aMsgMessage to check.

Length()

TInt Length()

Returns the length of file content to be requested.

MatchHttpError(TInt)

TInt MatchHttpError(TInterror)[private]

Matches an error to a proper HTTP error code to be matched

Parameters

TInt error

NewL(RSocket, CUpnpHttpServer *, TInt, TThreadPriority)

CUpnpHttpSession *NewL(RSocketaSocket,
CUpnpHttpServer *aServer,
TIntaSessionId,
TThreadPriorityaPriority
)[static]

Constructor function. This constructor is used when connection is iniatiated from network.

Parameters

RSocket aSocketPointer to new socket.
CUpnpHttpServer * aServerPointer to owning HttpServer.
TInt aSessionIdSession id of this session.
TThreadPriority aPriorityPriority of this session

NotifyDisconnectL(TInetAddr)

voidNotifyDisconnectL(TInetAddraAddr)[private, virtual]
Notifies upper layers that session has disconnected.
Since
Series60 2.6

Parameters

TInetAddr aAddrAddress of remote host to which the connection has been disconnected.

NotifyErrorL(TInt, TInt)

voidNotifyErrorL(TIntaError,
TIntaInternalError =  KErrNone
)
Notifies upper layers that there is a HTTP error.
Since
Series60 3.2

Parameters

TInt aError
TInt aInternalError =  KErrNone

NotifyTimeoutL()

voidNotifyTimeoutL()[private, virtual]
Notifies upper layers that session has expired
Since
Series60 3.2

NotifyUpperLayerLD(CUpnpHttpMessage *)

voidNotifyUpperLayerLD(CUpnpHttpMessage *aMessage)[private]
Notifies upper layers with error message. Method guarantee destrustion of parameter (even when leave ocure), and parameter should be poped from cleanupstack
Since
Series60 2.6

Parameters

CUpnpHttpMessage * aMessagemessage that will be sent to upper layer.

NotifyUpperLayersOnPostL()

voidNotifyUpperLayersOnPostL()[private, virtual]
Callback function. Informs upper layers that HTTP POST has been started by sending HTTP error code 801 message to upper layers.
Since
Series60 2.6

Offset()

TInt Offset()

Returns offset of the file that should be requested from server.

OverwriteExisting()

TBool OverwriteExisting()

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. It's connected only with download.

PostingFileCompleteL()

voidPostingFileCompleteL()[private, virtual]
Callback function. Informs upper layers that HTTP POST has been finished.
Since
Series60 2.6

PrepareRangeHeaderL(CUpnpHttpMessage *, TBool, TInt, CUpnpHttpServerTransaction &, TInt &, TInt &, TInt &)

TInt PrepareRangeHeaderL(CUpnpHttpMessage *aMsg,
TBoolaServingOutFileName,
TIntaFileSize,
CUpnpHttpServerTransaction &aTransaction,
TInt &aRangeStatus,
TInt &aStartPos,
TInt &aEndPos
)[private]

Parameters

CUpnpHttpMessage * aMsg
TBool aServingOutFileName
TInt aFileSize
CUpnpHttpServerTransaction & aTransaction
TInt & aRangeStatus
TInt & aStartPos
TInt & aEndPos

PrepareRelativeUriL(const TDesC8 &)

TPtrC8 PrepareRelativeUriL(const TDesC8 &aUri)[private]
Function to cut Ip and port from absoulute Uri in get request, it only cuts them when they are same as http server ones
Since
S60 5.1

Parameters

const TDesC8 & aUri

PrepareToServeFileL(CUpnpHttpMessage *)

TInt PrepareToServeFileL(CUpnpHttpMessage *aMsg)[private]
Prepares serve a file. Checks that file exists and paths are correct. Checks filesize and so on.
Since
Series60 2.6

Parameters

CUpnpHttpMessage * aMsgMessage to check.

ResetSettingsL()

voidResetSettingsL()[private]
Resets settings after upload
Since
Series60 3.2

ResponseErrorL(TInt)

voidResponseErrorL(TIntaStatus)[private]
Repsonse with HTTP error mesage to remoteServer
Since
Series60 2.6

Parameters

TInt aStatusNumber of status code

SaveAtOffset()

TBool SaveAtOffset()

Returns if should the requested offset of the remote file be saved at physical offset of existing local file. Only for Range requests

SendL(CUpnpHttpMessage *)

voidSendL(CUpnpHttpMessage *aMessage)
Sends aMessage to session's remote host.
Since
Series60 2.6

Parameters

CUpnpHttpMessage * aMessageMessage to be sent.

ServerPort()

TInt ServerPort()[protected, virtual]
Returns the port of this HttpSession.
Since
Series60 2.6

SetRedirectCount()

TBool SetRedirectCount()
Increments the redirect counter
Since
Series60 3.2

SinglePostBufferReceivedL(TDesC8 &)

voidSinglePostBufferReceivedL(TDesC8 &aBuffer)[private]

Single POST buffer processing

Since
Series60 2.6

Parameters

TDesC8 & aBufferBuffer that has been received.

SocketServerBusyL(const TInetAddr &)

voidSocketServerBusyL(const TInetAddr &aAddr)[private, virtual]
Notifies upper layers that Socket Server is unable to handle any more data by \ sending Expectation failed HTTP error to upper layers.
Since
Series60 2.6

Parameters

const TInetAddr & aAddrAddress of remote host to which the connection has been tried to connect

WriteMsgAndHeaderL(CUpnpHttpMessage *, const TDesC8 &, const TDesC &, TInt, TInt, const TInt, const TInt)

voidWriteMsgAndHeaderL(CUpnpHttpMessage *aMsg,
const TDesC8 &aHeaderToWrite,
const TDesC &aPathWithNewMethod,
TIntaFileSize,
TIntaRangeStatus,
const TIntaStartPos,
const TIntaEndPos
)[private]

Parameters

CUpnpHttpMessage * aMsg
const TDesC8 & aHeaderToWrite
const TDesC & aPathWithNewMethod
TInt aFileSize
TInt aRangeStatus
const TInt aStartPos
const TInt aEndPos

Member Enumerations Documentation

Enum THttpInvalidMessage

Enumerators

EMessageOk = 0
EUnknownMethod

Member Data Documentation

HBufC8 * iDestinationPath

HBufC8 *iDestinationPath[private]

TBool iErrorNotified

TBool iErrorNotified[private]

CUpnpHttpFileAccess * iFileServe

CUpnpHttpFileAccess *iFileServe[private]

TBool iHeadersCompleted

TBool iHeadersCompleted[private]

HBufC8 * iInFilename

HBufC8 *iInFilename[private]

TBool iIsChunked

TBool iIsChunked[private]

TInt iLength

TInt iLength[private]

TBool iMaximumSizeChecked

TBool iMaximumSizeChecked[private]

TInt iOffset

TInt iOffset[private]

HBufC8 * iOutFilename

HBufC8 *iOutFilename[private]

TBool iOverwriteExisting

TBool iOverwriteExisting[private]

TAny * iPendingRequest

TAny *iPendingRequest[private]

RPointerArray< CUpnpHttpMessage > * iPendingRequests

RPointerArray< CUpnpHttpMessage > *iPendingRequests[private]

THTTPMsgType iRequestType

THTTPMsgTypeiRequestType[private]

TBool iRequestedTransferNotifySent

TBool iRequestedTransferNotifySent[private]

TInt iRetryCounter

TInt iRetryCounter[private]

TBool iSaveAtOffset

TBool iSaveAtOffset[private]

HBufC8 * iSenderPath

HBufC8 *iSenderPath[private]

CUpnpHttpServer * iServer

CUpnpHttpServer *iServer[private]

TBool iSessionIsDeletedAfterResponse

TBool iSessionIsDeletedAfterResponse[private]

TBool iUsesConnectionClose

TBool iUsesConnectionClose[private]