CUpnpHttpSession Class Reference

class CUpnpHttpSession : public CUpnpTcpSession
Since
Series60 2.6

Inherits from

Public Member Functions
~CUpnpHttpSession ()
void BufferReceivedL ( TDesC8 &)
void DeleteFileIfExists ( TDesC16 &)
void DeleteServeFileL ()
void DeleteThisSessionL ( CUpnpTcpSession *)
CUpnpHttpFileAccess * FileAccess ()
CUpnpHttpServer * HttpServer ()
TBool IsMsgReady ()
TInt Length ()
CUpnpHttpSession * NewL ( RSocket , CUpnpHttpServer *, TInt , TThreadPriority )
void NotifyErrorL ( TInt , TInt )
TInt Offset ()
TBool OverwriteExisting ()
TBool SaveAtOffset ()
void SendL (CUpnpHttpMessage *)
TBool SetRedirectCount ()
Protected Member Functions
void DestroyIt ( CUpnpTcpSession *)
TBool FileServeExists ()
TInt ServerPort ()
Private Member Functions
CUpnpHttpSession ( RSocket , CUpnpHttpServer *, TInt , TThreadPriority )
void BufferReceivedCheckingHeadersL ( TDesC8 &)
void BufferReceivedProcessL ( TDesC8 &)
void CheckConnectionCloseL ()
void CheckSessionPersistence (CUpnpHttpMessage *)
void ConstructL ()
void FileTransferReaderDoneL ()
void FileTransferReaderErrorL ( TInt )
void FileTransferWriterDoneL ()
void FileTransferWriterHandleMoreL ()
void HandleQueryL (CUpnpHttpMessage *)
THttpInvalidMessage IsValidMessage (CUpnpHttpMessage *)
TInt MatchHttpError ( TInt )
void NotifyDisconnectL ( TInetAddr )
void NotifyTimeoutL ()
void NotifyUpperLayerLD (CUpnpHttpMessage *)
void NotifyUpperLayersOnPostL ()
void PostingFileCompleteL ()
TInt PrepareRangeHeaderL (CUpnpHttpMessage *, TBool , TInt , CUpnpHttpServerTransaction &, TInt &, TInt &, TInt &)
TPtrC8 PrepareRelativeUriL (const TDesC8 &)
TInt PrepareToServeFileL (CUpnpHttpMessage *)
void ResetSettingsL ()
void ResponseErrorL ( TInt )
void SinglePostBufferReceivedL ( TDesC8 &)
void SocketServerBusyL (const TInetAddr &)
void WriteMsgAndHeaderL (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
enum THttpInvalidMessage { 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
THTTPMsgType iRequestType
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 ( RSocket aSocket,
CUpnpHttpServer * aServer,
TInt aSessionId,
TThreadPriority aPriority
) [private]
First phase constructor. This constructor is used when connection is iniatiated from network.
Since
Series60 2.6

Parameters

RSocket aSocket Pointer to new socket.
CUpnpHttpServer * aServer Pointer to owning HttpServer.
TInt aSessionId Session id of this session.
TThreadPriority aPriority Priority of this session

~CUpnpHttpSession()

~CUpnpHttpSession ( ) [virtual]

Virtual Destructor function.

Member Functions Documentation

BufferReceivedCheckingHeadersL(TDesC8 &)

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

Parameters

TDesC8 & aBuffer Buffer that has been received.

BufferReceivedL(TDesC8 &)

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

Parameters

TDesC8 & aBuffer Buffer that has been received.

BufferReceivedProcessL(TDesC8 &)

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

Parameters

TDesC8 & aBuffer Buffer that has been received.

CheckConnectionCloseL()

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

CheckSessionPersistence(CUpnpHttpMessage *)

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

Parameters

CUpnpHttpMessage * aMsg

ConstructL()

void ConstructL ( ) [private]

Symbian constructor

DeleteFileIfExists(TDesC16 &)

void DeleteFileIfExists ( 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 & aFilename File to be deleted.

DeleteServeFileL()

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

DeleteThisSessionL(CUpnpTcpSession *)

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

Parameters

CUpnpTcpSession * aSession Session to b deleted.

DestroyIt(CUpnpTcpSession *)

void DestroyIt ( 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()

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

FileTransferReaderErrorL(TInt)

void FileTransferReaderErrorL ( TInt aError ) [private, virtual]
File Transfer Reader callback when upload with error
Since
Series60 3.2

Parameters

TInt aError

FileTransferWriterDoneL()

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

FileTransferWriterHandleMoreL()

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

HandleQueryL(CUpnpHttpMessage *)

void HandleQueryL ( 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 * aMsg Message 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 * aMsg Message to check.

Length()

TInt Length ( )

Returns the length of file content to be requested.

MatchHttpError(TInt)

TInt MatchHttpError ( TInt error ) [private]

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

Parameters

TInt error

NewL(RSocket, CUpnpHttpServer *, TInt, TThreadPriority)

CUpnpHttpSession * NewL ( RSocket aSocket,
CUpnpHttpServer * aServer,
TInt aSessionId,
TThreadPriority aPriority
) [static]

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

Parameters

RSocket aSocket Pointer to new socket.
CUpnpHttpServer * aServer Pointer to owning HttpServer.
TInt aSessionId Session id of this session.
TThreadPriority aPriority Priority of this session

NotifyDisconnectL(TInetAddr)

void NotifyDisconnectL ( TInetAddr aAddr ) [private, virtual]
Notifies upper layers that session has disconnected.
Since
Series60 2.6

Parameters

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

NotifyErrorL(TInt, TInt)

void NotifyErrorL ( TInt aError,
TInt aInternalError =  KErrNone
)
Notifies upper layers that there is a HTTP error.
Since
Series60 3.2

Parameters

TInt aError
TInt aInternalError =  KErrNone

NotifyTimeoutL()

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

NotifyUpperLayerLD(CUpnpHttpMessage *)

void NotifyUpperLayerLD ( 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 * aMessage message that will be sent to upper layer.

NotifyUpperLayersOnPostL()

void NotifyUpperLayersOnPostL ( ) [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()

void PostingFileCompleteL ( ) [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,
TBool aServingOutFileName,
TInt aFileSize,
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 * aMsg Message to check.

ResetSettingsL()

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

ResponseErrorL(TInt)

void ResponseErrorL ( TInt aStatus ) [private]
Repsonse with HTTP error mesage to remoteServer
Since
Series60 2.6

Parameters

TInt aStatus Number 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 *)

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

Parameters

CUpnpHttpMessage * aMessage Message 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 &)

void SinglePostBufferReceivedL ( TDesC8 & aBuffer ) [private]

Single POST buffer processing

Since
Series60 2.6

Parameters

TDesC8 & aBuffer Buffer that has been received.

SocketServerBusyL(const TInetAddr &)

void SocketServerBusyL ( 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 & aAddr Address of remote host to which the connection has been tried to connect

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

void WriteMsgAndHeaderL ( CUpnpHttpMessage * aMsg,
const TDesC8 & aHeaderToWrite,
const TDesC & aPathWithNewMethod,
TInt aFileSize,
TInt aRangeStatus,
const TInt aStartPos,
const TInt aEndPos
) [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

THTTPMsgType iRequestType [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]