Text NetServer::ProcessRequest(Text msg, const NetAddr& addr) { if (msg.indexOf("GET ") == 0) return DefaultResponse(); return ErrorResponse(); }
// ----------------------------------------------------------------------------- // MceSip::DoDiscardRequestL // ----------------------------------------------------------------------------- // void MceSip::DoDiscardRequestL( CSIPServerTransaction& aRequest, TInt aError, TBool aRetryIndication ) { CSIPResponseElements* response = NULL; TUint responseCode = 0; if ( aError >= (TInt)KMceSipTrying ) { responseCode = (TUint)aError; RStringF reasonPhrase = ReasonPhraseL( responseCode ); CleanupClosePushL( reasonPhrase ); response = CSIPResponseElements::NewL( responseCode, reasonPhrase ); CleanupStack::PopAndDestroy();//reasonPhrase } else { TInt reasonPhrase = 0; ErrorResponse( aError, responseCode, reasonPhrase ); response = CSIPResponseElements::NewL( responseCode, SIPStrings::StringF( reasonPhrase ) ); } CleanupStack::PushL( response ); if ( aRetryIndication ) { CSIPMessageElements& elements = response->MessageElements(); //create Retry-After header RPointerArray<CSIPHeaderBase> headers; CSIPHeaderBase::PushLC( &headers ); CSIPRetryAfterHeader* retryAfter = CSIPRetryAfterHeader::NewLC( Random( KMceRandMinRetryValue, KMceRandMaxRetryValue ) ); headers.AppendL( retryAfter ); CleanupStack::Pop( retryAfter ); //send invitation elements.SetUserHeadersL( headers ); CleanupStack::Pop( &headers ); } aRequest.SendResponseL( response ); CleanupStack::Pop( response ); }
NS_IMETHODIMP TelephonyRequestParent::NotifyError(const nsAString& aError) { return SendResponse(ErrorResponse(nsAutoString(aError))); }
void CHttpResponseProcess::DoForbiddenResponse(web_solution::comm::CHttpRequest& oHttpRequest, web_solution::comm::CHttpResponse& oHttpResponse) { return ErrorResponse(FORBIDDEN, oHttpRequest, oHttpResponse); }
void CHttpResponseProcess::DoSvrInternalErrResponse(web_solution::comm::CHttpRequest& oHttpRequest, web_solution::comm::CHttpResponse& oHttpResponse) { return ErrorResponse(SERVER_INTERNAL_ERROR, oHttpRequest, oHttpResponse); }
void CHttpResponseProcess::DoTimeoutResponse(web_solution::comm::CHttpRequest& oHttpRequest, web_solution::comm::CHttpResponse& oHttpResponse) { return ErrorResponse(TIMEOUT, oHttpRequest, oHttpResponse); }
void CHttpResponseProcess::DoNotFoundResponse(web_solution::comm::CHttpRequest& oHttpRequest, web_solution::comm::CHttpResponse& oHttpResponse) { return ErrorResponse(NOT_FOUND, oHttpRequest, oHttpResponse); }
void CHttpResponseProcess::DoBadRequestResponse(web_solution::comm::CHttpRequest& oHttpRequest, web_solution::comm::CHttpResponse& oHttpResponse) { return ErrorResponse(BAD_REQUEST, oHttpRequest, oHttpResponse); }
//----------------------------------------------------------------------------- void Unknown::Run( CT &c ) { ErrorResponse( "BADINPUT", "Unknown command" ).Write( *c ); }