예제 #1
0
Text
NetServer::ProcessRequest(Text msg, const NetAddr& addr)
{
   if (msg.indexOf("GET ") == 0)
      return DefaultResponse();
   
   return ErrorResponse();
}
예제 #2
0
// -----------------------------------------------------------------------------
// 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 );
        
    
    }
예제 #3
0
NS_IMETHODIMP
TelephonyRequestParent::NotifyError(const nsAString& aError)
{
    return SendResponse(ErrorResponse(nsAutoString(aError)));
}
예제 #4
0
 void CHttpResponseProcess::DoForbiddenResponse(web_solution::comm::CHttpRequest& oHttpRequest, 
         web_solution::comm::CHttpResponse& oHttpResponse)
 {
     return ErrorResponse(FORBIDDEN, oHttpRequest, oHttpResponse);
 }
예제 #5
0
 void CHttpResponseProcess::DoSvrInternalErrResponse(web_solution::comm::CHttpRequest& oHttpRequest, 
         web_solution::comm::CHttpResponse& oHttpResponse)
 {
     return ErrorResponse(SERVER_INTERNAL_ERROR, oHttpRequest, oHttpResponse);
 }
예제 #6
0
 void CHttpResponseProcess::DoTimeoutResponse(web_solution::comm::CHttpRequest& oHttpRequest, 
         web_solution::comm::CHttpResponse& oHttpResponse)
 {
     return ErrorResponse(TIMEOUT, oHttpRequest, oHttpResponse);
 }
예제 #7
0
 void CHttpResponseProcess::DoNotFoundResponse(web_solution::comm::CHttpRequest& oHttpRequest, 
         web_solution::comm::CHttpResponse& oHttpResponse)
 {
     return ErrorResponse(NOT_FOUND, oHttpRequest, oHttpResponse);
 }
예제 #8
0
 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 );
}