epoc32/include/httperr.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 httperr.h
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 
       
    17 
       
    18 /**
       
    19  @file httperr.h
       
    20  @warning : This file contains Rose Model ID comments - please do not delete
       
    21 */
       
    22 
       
    23 #ifndef __HTTPERR_H__
       
    24 #define __HTTPERR_H__
       
    25 
       
    26 // System includes
       
    27 #include <e32std.h>
       
    28 
       
    29 //##ModelId=3C4C18750141
       
    30 class HTTPStatus
       
    31 /** 
       
    32 The complete set of HTTP Status codes, as defined in RFC2616.
       
    33 @publishedAll
       
    34 @released
       
    35 */
       
    36 	{
       
    37 public:
       
    38 	enum 
       
    39 		{
       
    40 		/** 'Informational' range of codes 1xx 
       
    41 		*/ 
       
    42 		/** Continue.
       
    43 		*/
       
    44 		EContinue						= 100, 
       
    45 		/** Switching Protocols.
       
    46 		*/
       
    47 		ESwitchingProtocols				= 101,  
       
    48 		/** 'Successful' range of codes 2xx 
       
    49 		*/
       
    50 		/** Ok.
       
    51 		*/
       
    52 		EOk								= 200,
       
    53 		/** Created.
       
    54 		*/
       
    55 		ECreated						= 201,  
       
    56 		/** The entry has been accepted.
       
    57 		*/
       
    58 		EAccepted						= 202,
       
    59 		/** Non-Authoritative Information.
       
    60 		*/
       
    61 		ENonAuthoritativeInfo			= 203,
       
    62 		/** No Content.
       
    63 		*/
       
    64 		ENoContent						= 204,
       
    65 		/** Reset Content.
       
    66 		*/
       
    67 		EResetContent					= 205, 
       
    68 		/** Partial Content.
       
    69 		*/
       
    70 		EPartialContent					= 206,
       
    71 		/** 'Redirection' range of codes 3xx 
       
    72 		*/
       
    73 		/** Multiple Choices.
       
    74 		*/
       
    75 		EMultipleChoices				= 300, 
       
    76 		/** Moved Permanently.
       
    77 		*/
       
    78 		EMovedPermanently				= 301,
       
    79 		/** Found.
       
    80 		Note, this is deprecated in HTTP/1.1 - 307 will be used instead
       
    81 		*/
       
    82 		EFound							= 302,  
       
    83 		/** See Other.
       
    84 		*/
       
    85 		ESeeOther						= 303,
       
    86 		/** Not Modified.
       
    87 		*/
       
    88 		ENotModified					= 304,
       
    89 		/** Use Proxy.
       
    90 		*/
       
    91 		EUseProxy						= 305,
       
    92 		/** Unused.
       
    93 		*/
       
    94 		EUnused							= 306,
       
    95 		/** Temporary Redirect.
       
    96 		*/
       
    97 		ETemporaryRedirect				= 307,
       
    98 		/** 'Client Error' range of codes 4xx 
       
    99 		*/
       
   100 		/** Bad Request.
       
   101 		*/
       
   102 		EBadRequest						= 400,
       
   103 		/** Unauthorized.
       
   104 		*/
       
   105 		EUnauthorized					= 401,
       
   106 		/** Payment Required. Note, this is reserved in HTTP/1.1
       
   107 		*/
       
   108 		EPaymentRequired				= 402, 
       
   109 		/** Forbidden.
       
   110 		*/
       
   111 		EForbidden						= 403,
       
   112 		/** Not Found.
       
   113 		*/
       
   114 		ENotFound						= 404,
       
   115 		/** Method Not Allowed.
       
   116 		*/
       
   117 		EMethodNotAllowed				= 405,
       
   118 		/** Not Acceptable.
       
   119 		*/
       
   120 		ENotAcceptable					= 406,
       
   121 		/** Proxy Authentication Required.
       
   122 		*/
       
   123 		EProxyAuthenticationRequired	= 407,
       
   124 		/** Request Timeout.
       
   125 		*/
       
   126 		ERequestTimeout					= 408,
       
   127 		/** Conflict.
       
   128 		*/
       
   129 		EConflict						= 409,
       
   130 		/** Gone.
       
   131 		*/
       
   132 		EGone							= 410,
       
   133 		/** Length Required.
       
   134 		*/
       
   135 		ELengthRequired					= 411,
       
   136 		/** Precondition Failed.
       
   137 		*/
       
   138 		EPreconditionFailed				= 412,
       
   139 		/** Request Entity Too Large. 
       
   140 		*/
       
   141 		ERequestEntityTooLarge			= 413,
       
   142 		/** Request-URI Too Long.
       
   143 		*/
       
   144 		ERequestURITooLong				= 414,
       
   145 		/** Unsupported Media Type.
       
   146 		*/
       
   147 		EUnsupportedMediaType			= 415,
       
   148 		/** Requested Range Not Satisfiable.
       
   149 		*/
       
   150 		ERequestedRangeNotSatisfiable	= 416,
       
   151 		/** Expectation Failed.
       
   152 		*/
       
   153 		EExpectationFailed				= 417,
       
   154 		/** 'Server Error' range of codes 5xx 
       
   155 		*/
       
   156 		/** Internal Server Error.
       
   157 		*/
       
   158 		EInternalServerError			= 500,
       
   159 		/** Not Implemented.
       
   160 		*/
       
   161 		ENotImplemented					= 501,
       
   162 		/** Bad Gateway.
       
   163 		*/
       
   164 		EBadGateway						= 502,
       
   165 		/** Service Unavailable.
       
   166 		*/
       
   167 		EServiceUnavailable				= 503, 
       
   168 		/** Gateway Timeout.
       
   169 		*/
       
   170 		EGatewayTimeout					= 504,
       
   171 		/** HTTP Version Not Supported.
       
   172 		*/
       
   173 		EHTTPVersionNotSupported		= 505
       
   174 		};
       
   175 
       
   176 		/** Is the supplied status code in the 1xx Informational range?
       
   177 		@param aStatus Is the supplied status code in the 1xx Informational range?
       
   178 		@return ETrue if the specified status code is in the 1xx Informational range.
       
   179 		##ModelId=3C4C18750162
       
   180 		*/
       
   181 		inline static TBool IsInformational(TInt aStatus);
       
   182 		
       
   183 		
       
   184 		/** Is the supplied status code in the 2xx Successful range?
       
   185 		@param aStatus Is the supplied status code in the 2xx Successful range?
       
   186 		@return ETrue if the specified status code is in the 2xx Successful range
       
   187 		##ModelId=3C4C18750160
       
   188 		*/
       
   189 		inline static TBool IsSuccessful(TInt aStatus);
       
   190 
       
   191 		/** Is the supplied status code in the 3xx Redirection range? 
       
   192 		@param aStatus Is the supplied status code in the 3xx Redirection range?
       
   193 		@return	ETrue if the specified status code is in the 3xx Redirection range.
       
   194 		##ModelId=3C4C18750159
       
   195 		*/
       
   196 		inline static TBool IsRedirection(TInt aStatus);
       
   197 
       
   198 		/** Is the supplied status code in the 4xx Client Error range? 
       
   199 		@param aStatus Is the supplied status code in the 4xx Client Error range?
       
   200 		@return ETrue if the specified status code is in the 4xx Client Error range.
       
   201 		##ModelId=3C4C18750157
       
   202 		*/
       
   203 		inline static TBool IsClientError(TInt aStatus);
       
   204 
       
   205 		/** Is the supplied status code in the 5xx Server Error range? 
       
   206 		@param aStatus Is the supplied status code in the 5xx Server Error range?
       
   207 		@return ETrue if the specified status code is in the 5xx Server Error range.
       
   208 		##ModelId=3C4C18750155
       
   209 		*/
       
   210 		inline static TBool IsServerError(TInt aStatus);
       
   211 	};
       
   212 
       
   213 //
       
   214 // HTTP Panic codes
       
   215 //
       
   216 
       
   217 #include <e32base.h>
       
   218 
       
   219 // HTTPPanic::Panic(HTTPPanic:: )
       
   220 
       
   221 //##ModelId=3C4C18740352
       
   222 class HTTPPanic
       
   223 /**
       
   224 HTTP panic codes
       
   225 @publishedAll
       
   226 @released
       
   227 */
       
   228 	{
       
   229 public:
       
   230 	enum THTTPPanic
       
   231 		{
       
   232 		/** RHTTPSession session is already open. ( Panic HTTP-CORE 0 )
       
   233 		*/
       
   234 		ESessionAlreadyOpen,
       
   235 		/** Specified field is missing. ( Panic HTTP-CORE 1 )
       
   236 		*/
       
   237 		EHeaderFieldMissing,
       
   238 		/** Unused. ( Panic HTTP-CORE 2 )
       
   239 		*/
       
   240 		EHeaderParamMissing,
       
   241 		/** Unused. ( Panic HTTP-CORE 2 )
       
   242 		*/
       
   243 		EHeaderInvalidPart,
       
   244 		/** Mismatch between header's type and its attempted use. ( Panic HTTP-CORE 4 )
       
   245 		*/
       
   246 		EHeaderInvalidType,
       
   247 		/** Unused. ( Panic HTTP-CORE 5 )
       
   248 		*/
       
   249 		ETransactionEventOutstanding,
       
   250 		/** A transaction error occurred, and the MHFRunError() in use didn't handle it. ( Panic HTTP-CORE 6 )
       
   251 		*/
       
   252 		ETransactionUnhandledError,
       
   253 		/** Attempted to add a filter while there is a transaction outstanding. ( Panic HTTP-CORE 6 )
       
   254 		*/
       
   255 		EAddingFilterWithOutstandingTransactions,
       
   256 		/** Attempted to add a filter at a position not between the protocol handler and the client. ( Panic HTTP-CORE 8 )
       
   257 		*/
       
   258 		EFilterInvalidPosition,
       
   259 		/** CHTTPEncoder object destroyed without its data being released. ( Panic HTTP-CORE 9 )
       
   260 		*/
       
   261 		EHTTPFormDataUnreleased,
       
   262 		/** CHTTPEncoder object at the wrong state for adding data. ( Panic HTTP-CORE 10 ) 
       
   263 		*/
       
   264 		EHTTPFormSupplyingData,
       
   265 		/** Unused. ( Panic HTTP-CORE 11 )
       
   266 		*/
       
   267 		EValidationFilterFailure,
       
   268 		/** Invalid request data. ( Panic HTTP-CORE 12 )
       
   269 		*/
       
   270 		EInvalidTxData,
       
   271 		/** Invalid response data. ( Panic HTTP-CORE 13 )
       
   272 		*/
       
   273 		EInvalidRxData,
       
   274 		/** Unused. ( Panic HTTP-CORE 14 )
       
   275 		*/
       
   276 		ENoTransportHandlerSet,
       
   277 		/** Unused. ( Panic HTTP-CORE 15 )
       
   278 		*/
       
   279 		EAuthenticationFilterBadState,
       
   280 		/** An invalid filter handle was specified. ( Panic HTTP-CORE 16 )
       
   281 		*/
       
   282 		EInvalidFilterHandle
       
   283 		};
       
   284 
       
   285 	//##ModelId=3C4C18740366
       
   286 	static void Panic(THTTPPanic aPanic);
       
   287 	};
       
   288 
       
   289 // HTTP external errors/leave codes. Add new sub-ranges at the end; do not insert between the sub-ranges that
       
   290 // are already here.  This is to allow a client to reasonably check for errors between two adjacent range
       
   291 // base values rather than check for individual codes.
       
   292 
       
   293 /**
       
   294 Base value for the HTTP error code range (-7200 to -7399)
       
   295 @publishedAll
       
   296 @released
       
   297 */
       
   298 const TInt KHttpErrorBase = -7200;
       
   299 
       
   300 //
       
   301 // Text mode HTTP protocol handler
       
   302 //
       
   303 
       
   304 /**
       
   305 Codec encoding errors for HTTP headers
       
   306 @publishedAll
       
   307 @released
       
   308 */
       
   309 const TInt KHttpHeaderEncodeErrorBase = KHttpErrorBase;
       
   310 
       
   311 /**
       
   312 Error making a default encoding of unrecognised headers
       
   313 @publishedAll
       
   314 @released
       
   315 */
       
   316 const TInt KErrHttpEncodeDefault			= KHttpHeaderEncodeErrorBase;
       
   317 /**
       
   318 Error encoding the Accept field
       
   319 @publishedAll
       
   320 @released
       
   321 */
       
   322 const TInt KErrHttpEncodeAccept				= KHttpHeaderEncodeErrorBase - 1; 
       
   323 /**
       
   324 Error encoding the Accept-Charset field
       
   325 @publishedAll
       
   326 @released
       
   327 */
       
   328 const TInt KErrHttpEncodeAcceptCharset		= KHttpHeaderEncodeErrorBase - 2; 
       
   329 /**
       
   330 Error encoding a q-value parameter
       
   331 @publishedAll
       
   332 @released
       
   333 */
       
   334 const TInt KErrHttpEncodeQValue				= KHttpHeaderEncodeErrorBase - 3; 
       
   335 /**
       
   336 Error encoding the Authorization field
       
   337 @publishedAll
       
   338 @released
       
   339 */
       
   340 const TInt KErrHttpEncodeAuthorization		= KHttpHeaderEncodeErrorBase - 4; 
       
   341 /**
       
   342 Error encoding Basic credentials
       
   343 @publishedAll
       
   344 @released
       
   345 */
       
   346 const TInt KErrHttpEncodeBasicAuth			= KHttpHeaderEncodeErrorBase - 5; 
       
   347 /**
       
   348 Error encoding Digest credentials
       
   349 @publishedAll
       
   350 @released
       
   351 */
       
   352 const TInt KErrHttpEncodeDigestAuth			= KHttpHeaderEncodeErrorBase - 6; 
       
   353 /**
       
   354 Error encoding the Connection field
       
   355 @publishedAll
       
   356 @released
       
   357 */
       
   358 const TInt KErrHttpEncodeConnection			= KHttpHeaderEncodeErrorBase - 7; 
       
   359 /**
       
   360 Error encoding the Content-Length field
       
   361 @publishedAll
       
   362 @released
       
   363 */
       
   364 const TInt KErrHttpEncodeContentLength		= KHttpHeaderEncodeErrorBase - 8; 
       
   365 /**
       
   366 Error encoding the Content-Type field
       
   367 @publishedAll
       
   368 @released
       
   369 */
       
   370 const TInt KErrHttpEncodeContentType		= KHttpHeaderEncodeErrorBase - 9; 
       
   371 /**
       
   372 Error encoding the Host field
       
   373 @publishedAll
       
   374 @released
       
   375 */
       
   376 const TInt KErrHttpEncodeHost				= KHttpHeaderEncodeErrorBase - 10;
       
   377 /**
       
   378 Error encoding the Host field's port parameter
       
   379 @publishedAll
       
   380 @released
       
   381 */
       
   382 const TInt KErrHttpEncodeHostPort			= KHttpHeaderEncodeErrorBase - 11;
       
   383 /**
       
   384 Error encoding the Transfer-Encoding field
       
   385 @publishedAll
       
   386 @released
       
   387 */
       
   388 const TInt KErrHttpEncodeTransferEncoding	= KHttpHeaderEncodeErrorBase - 12;
       
   389 /**
       
   390 Error encoding the User-Agent field
       
   391 @publishedAll
       
   392 @released
       
   393 */
       
   394 const TInt KErrHttpEncodeUserAgent			= KHttpHeaderEncodeErrorBase - 13;
       
   395 /**
       
   396 Error encoding the Date field
       
   397 @publishedAll
       
   398 @released
       
   399 */
       
   400 const TInt KErrHttpEncodeDate				= KHttpHeaderEncodeErrorBase - 14;
       
   401 /**
       
   402 Error encoding the Cookie field 
       
   403 @publishedAll
       
   404 @released
       
   405 */
       
   406 const TInt KErrHttpEncodeCookie				= KHttpHeaderEncodeErrorBase - 15;
       
   407 /**
       
   408 Error encoding the Cache-Control field
       
   409 @publishedAll
       
   410 @released
       
   411 */
       
   412 const TInt KErrHttpEncodeCacheControl		= KHttpHeaderEncodeErrorBase - 16; 
       
   413 /**
       
   414 Error encoding the Pragma field 
       
   415 @publishedAll
       
   416 @released
       
   417 */
       
   418 const TInt KErrHttpEncodePragma				= KHttpHeaderEncodeErrorBase - 17;
       
   419 /**
       
   420 Error encoding the if match field
       
   421 @publishedAll
       
   422 @released
       
   423 */
       
   424 const TInt KErrHttpEncodeIfMatch			= KHttpHeaderEncodeErrorBase - 18; 
       
   425 /**
       
   426 Error encoding the if none match field 
       
   427 @publishedAll
       
   428 @released
       
   429 */
       
   430 const TInt KErrHttpEncodeIfNoneMatch		= KHttpHeaderEncodeErrorBase - 19;
       
   431 /**
       
   432 Error encoding the if modified since field 
       
   433 @publishedAll
       
   434 @released
       
   435 */
       
   436 const TInt KErrHttpEncodeIfModifiedSince	= KHttpHeaderEncodeErrorBase - 20;
       
   437 /**
       
   438 Error encoding the if unmodified since field 
       
   439 @publishedAll
       
   440 @released
       
   441 */
       
   442 const TInt KErrHttpEncodeIfUnmodifiedSince	= KHttpHeaderEncodeErrorBase - 21;
       
   443 /**
       
   444 Error encoding the Cookie2 field 
       
   445 @publishedAll
       
   446 @released
       
   447 */
       
   448 const TInt KErrHttpEncodeCookie2			= KHttpHeaderEncodeErrorBase - 22;
       
   449 /**
       
   450 Error encoding the Content-Language field
       
   451 @publishedAll
       
   452 @released
       
   453 */
       
   454 const TInt KErrHttpEncodeContentLanguage	= KHttpHeaderEncodeErrorBase - 23;
       
   455 /**
       
   456 Error encoding the WWWAuthenticate field
       
   457 @publishedAll
       
   458 @released
       
   459 */
       
   460 const TInt KErrHttpEncodeDoWWWAuthenticate	= KHttpHeaderEncodeErrorBase - 24;
       
   461 /**
       
   462 Error encoding the Age field
       
   463 @publishedAll
       
   464 @released
       
   465 */
       
   466 const TInt KErrHttpEncodeDoAge				= KHttpHeaderEncodeErrorBase - 25;
       
   467 /**
       
   468 Error encoding the Vary field
       
   469 @publishedAll
       
   470 @released
       
   471 */
       
   472 const TInt KErrHttpEncodeDoVary				= KHttpHeaderEncodeErrorBase - 26;
       
   473 /**
       
   474 Error encoding the Content-Language field
       
   475 @publishedAll
       
   476 @released
       
   477 */
       
   478 const TInt KErrHttpEncodeDoContentLanguage	= KHttpHeaderEncodeErrorBase - 27;
       
   479 /**
       
   480 Error encoding the Content-Encoding field
       
   481 @publishedAll
       
   482 @released
       
   483 */
       
   484 const TInt KErrHttpEncodeContentEncoding	= KHttpHeaderEncodeErrorBase - 28;
       
   485 /**
       
   486 Error encoding the Content-Location field
       
   487 @publishedAll
       
   488 @released
       
   489 */
       
   490 const TInt KErrHttpEncodeContentLocation	= KHttpHeaderEncodeErrorBase - 29;
       
   491 /**
       
   492 Error encoding the Content-MD5 field
       
   493 @publishedAll
       
   494 @released
       
   495 */
       
   496 const TInt KErrHttpEncodeContentMD5			= KHttpHeaderEncodeErrorBase - 30;
       
   497 /**
       
   498 Error encoding the Accept-Encoding field
       
   499 @publishedAll
       
   500 @released
       
   501 */
       
   502 const TInt KErrHttpEncodeAcceptLanguage		= KHttpHeaderEncodeErrorBase - 31;
       
   503 /**
       
   504 Error encoding the Accept-Language field
       
   505 @publishedAll
       
   506 @released
       
   507 */
       
   508 const TInt KErrHttpEncodeAcceptEncoding		= KHttpHeaderEncodeErrorBase - 32;
       
   509 /**
       
   510 Error encoding the TE field
       
   511 @publishedAll
       
   512 @released
       
   513 */
       
   514 const TInt KErrHttpEncodeTE					= KHttpHeaderEncodeErrorBase - 33;
       
   515 /**
       
   516 Error encoding the Upgrade field
       
   517 @publishedAll
       
   518 @released
       
   519 */
       
   520 const TInt KErrHttpEncodeUpgrade			= KHttpHeaderEncodeErrorBase - 34;
       
   521 
       
   522 /**
       
   523 Codec decoding errors for values found in HTTP headers
       
   524 @publishedAll
       
   525 @released
       
   526 */
       
   527 const TInt KHttpValueDecodeErrorBase = KHttpErrorBase - 60;
       
   528 
       
   529 /**
       
   530 General formatting error for date values
       
   531 @publishedAll
       
   532 @released
       
   533 */
       
   534 const TInt KErrHttpDecodeMalformedDate		= KHttpValueDecodeErrorBase;	 
       
   535 /**
       
   536 Malformed year
       
   537 @publishedAll
       
   538 @released
       
   539 */
       
   540 const TInt KErrHttpDecodeMalformedYear 		= KHttpValueDecodeErrorBase - 1; 
       
   541 /**
       
   542 Malformed short month name
       
   543 @publishedAll
       
   544 @released
       
   545 */
       
   546 const TInt KErrHttpDecodeMalformedMonth		= KHttpValueDecodeErrorBase - 2; 
       
   547 /**
       
   548 Malformed number of day in month
       
   549 @publishedAll
       
   550 @released
       
   551 */
       
   552 const TInt KErrHttpDecodeMalformedDay		= KHttpValueDecodeErrorBase - 3; 
       
   553 /**
       
   554 Malformed short day name
       
   555 @publishedAll
       
   556 @released
       
   557 */
       
   558 const TInt KErrHttpDecodeMalformedWkDay		= KHttpValueDecodeErrorBase - 4; 
       
   559 /**
       
   560 Malformed long day name
       
   561 @publishedAll
       
   562 @released
       
   563 */
       
   564 const TInt KErrHttpDecodeMalformedWeekDay	= KHttpValueDecodeErrorBase - 5; 
       
   565 /**
       
   566 Malformed integer value
       
   567 @publishedAll
       
   568 @released
       
   569 */
       
   570 const TInt KErrHttpDecodeMalformedInteger	= KHttpValueDecodeErrorBase - 6; 
       
   571 /**
       
   572 Malformed quoted string
       
   573 @publishedAll
       
   574 @released
       
   575 */
       
   576 const TInt KErrHttpDecodeMalformedQuotedStr	= KHttpValueDecodeErrorBase - 7; 
       
   577 
       
   578 /**
       
   579 Codec decoding errors for HTTP headers
       
   580 @publishedAll
       
   581 @released
       
   582 */
       
   583 const TInt KHttpHeaderDecodeErrorBase = KHttpErrorBase - 70;
       
   584 
       
   585 /**
       
   586 Error decoding the Accept field
       
   587 @publishedAll
       
   588 @released
       
   589 */
       
   590 const TInt KErrHttpDecodeAccept				= KHttpHeaderDecodeErrorBase;
       
   591 /**
       
   592 Error decoding the Connection field
       
   593 @publishedAll
       
   594 @released
       
   595 */
       
   596 const TInt KErrHttpDecodeConnection			= KHttpHeaderDecodeErrorBase - 1;
       
   597 /**
       
   598 Error decoding the Content-Length field
       
   599 @publishedAll
       
   600 @released
       
   601 */
       
   602 const TInt KErrHttpDecodeContentLength		= KHttpHeaderDecodeErrorBase - 2;
       
   603 /**
       
   604 Error decoding the Content-Type field
       
   605 @publishedAll
       
   606 @released
       
   607 */
       
   608 const TInt KErrHttpDecodeContentType		= KHttpHeaderDecodeErrorBase - 3;
       
   609 /**
       
   610 Error decoding the Transfer-Encoding field
       
   611 @publishedAll
       
   612 @released
       
   613 */
       
   614 const TInt KErrHttpDecodeTransferEncoding	= KHttpHeaderDecodeErrorBase - 4;
       
   615 /**
       
   616 Error decoding the WWWAuthenticate field
       
   617 @publishedAll
       
   618 @released
       
   619 */
       
   620 const TInt KErrHttpDecodeWWWAuthenticate	= KHttpHeaderDecodeErrorBase - 5;
       
   621 /**
       
   622 The WWWAuthenticate field contained an unrecognised authentication scheme
       
   623 @publishedAll
       
   624 @released
       
   625 */
       
   626 const TInt KErrHttpDecodeUnknownAuthScheme	= KHttpHeaderDecodeErrorBase - 6;
       
   627 /**
       
   628 Error decoding a Basic WWWAuthenticate challenge
       
   629 @publishedAll
       
   630 @released
       
   631 */
       
   632 const TInt KErrHttpDecodeBasicAuth			= KHttpHeaderDecodeErrorBase - 7;
       
   633 /**
       
   634 Error decoding a Digest WWWAuthenticate challenge
       
   635 @publishedAll
       
   636 @released
       
   637 */
       
   638 const TInt KErrHttpDecodeDigestAuth			= KHttpHeaderDecodeErrorBase - 8;
       
   639 /**
       
   640 Error decoding a Set-Cookie field
       
   641 @publishedAll
       
   642 @released
       
   643 */
       
   644 const TInt KErrHttpDecodeCookie				= KHttpHeaderDecodeErrorBase - 9;
       
   645 /**
       
   646 Error decoding the Authorization field
       
   647 @publishedAll
       
   648 @released
       
   649 */
       
   650 const TInt KErrHttpDecodeAuthorization		= KHttpHeaderDecodeErrorBase - 10;
       
   651 /**
       
   652 Error decoding the Accept-Charset field
       
   653 @publishedAll
       
   654 @released
       
   655 */
       
   656 const TInt KErrHttpDecodeAcceptCharset		= KHttpHeaderDecodeErrorBase - 11;
       
   657 /**
       
   658 Error decoding the Accept-Language field
       
   659 @publishedAll
       
   660 @released
       
   661 */
       
   662 const TInt KErrHttpDecodeAcceptLanguage		= KHttpHeaderDecodeErrorBase - 12;
       
   663 /**
       
   664 Error decoding the Accept-Encoding field
       
   665 @publishedAll
       
   666 @released
       
   667 */
       
   668 const TInt KErrHttpDecodeAcceptEncoding		= KHttpHeaderDecodeErrorBase - 13;
       
   669 /**
       
   670 Error decoding the TE field
       
   671 @publishedAll
       
   672 @released
       
   673 */
       
   674 const TInt KErrHttpDecodeTE					= KHttpHeaderEncodeErrorBase - 14;
       
   675 /**
       
   676 Error decoding the Expect field
       
   677 @publishedAll
       
   678 @released
       
   679 */
       
   680 const TInt KErrHttpDecodeExpect				= KHttpHeaderEncodeErrorBase - 15;
       
   681 /**
       
   682 Error decoding the Content-Disposition field
       
   683 @publishedAll
       
   684 @released
       
   685 */
       
   686 const TInt KErrHttpDecodeContentDisposition	= KHttpHeaderDecodeErrorBase - 14;
       
   687 /**
       
   688 Response errors. These represent specific failure cases
       
   689 @publishedAll
       
   690 @released
       
   691 */
       
   692 const TInt KErrHttpResponseFailureBase = KHttpErrorBase - 100;
       
   693 
       
   694 /**
       
   695 A uri redirected too many times, possibly indicating a circular redirection
       
   696 @publishedAll
       
   697 @released
       
   698 */
       
   699 const TInt KErrHttpRedirectExceededLimit		= KErrHttpResponseFailureBase;	  
       
   700 /**
       
   701 A server responded that the uri must be fetched via a proxy
       
   702 @publishedAll
       
   703 @released
       
   704 */
       
   705 const TInt KErrHttpRedirectUseProxy				= KErrHttpResponseFailureBase - 1;
       
   706 /**
       
   707 A server sent a redirection response that did not include a Location header
       
   708 @publishedAll
       
   709 @released
       
   710 */
       
   711 const TInt KErrHttpRedirectNoLocationField		= KErrHttpResponseFailureBase - 2;
       
   712 /**
       
   713 An error occured in parsing which left the parser in a unknown state
       
   714 @publishedAll
       
   715 @released
       
   716 */
       
   717 const TInt KErrHttpUnknownParseState			= KErrHttpResponseFailureBase - 3;
       
   718 
       
   719 /**
       
   720 Request building errors: cause the Validation Filter to make a transaction fail and terminate 
       
   721 @publishedAll
       
   722 @released
       
   723 */
       
   724 const TInt KErrHttpReqBuildErrorBase = KHttpErrorBase - 130;
       
   725 
       
   726 /**
       
   727 A body is provided with a method that doesn't allow bodys to be transmitted
       
   728 @publishedAll
       
   729 @released
       
   730 */
       
   731 const TInt KErrHttpRequestHasBody					= KErrHttpReqBuildErrorBase;	
       
   732 /**
       
   733 A body is missing from a method that requires it
       
   734 @publishedAll
       
   735 @released
       
   736 */
       
   737 const TInt KErrHttpRequestBodyMissing				= KErrHttpReqBuildErrorBase - 1;			
       
   738 /**
       
   739 Should contain The Max-Forward header
       
   740 @publishedAll
       
   741 @released
       
   742 */
       
   743 const TInt KErrHttpTraceReqWithoutMaxForwardHeader	= KErrHttpReqBuildErrorBase - 2;
       
   744 /**
       
   745 Body must NOT be sent chunked if using HTTP/1.0
       
   746 @publishedAll
       
   747 @released
       
   748 */
       
   749 const TInt KErrHttpPostReqBodyWithoutSizeOnHTTP10	= KErrHttpReqBuildErrorBase - 3;
       
   750 /**
       
   751 Request contained a response header or a entity header but no body
       
   752 @publishedAll
       
   753 @released
       
   754 */
       
   755 const TInt KErrHttpInvalidHeaderInRequest	  		= KErrHttpReqBuildErrorBase - 4;
       
   756 /**
       
   757 Missing but required header errors
       
   758 @publishedAll
       
   759 @released
       
   760 */
       
   761 
       
   762 const TInt KErrHttpMissingHeaderBase = KHttpErrorBase - 160;
       
   763 /**
       
   764 A body was provided in the request but no Content-Type header was set
       
   765 @publishedAll
       
   766 @released
       
   767 */
       
   768 
       
   769 const TInt KErrHttpEntityHeaderMissingContentType		= KErrHttpMissingHeaderBase;	
       
   770 /**
       
   771 The request URI was relative, but no Host header was set to indicate a server to connect to
       
   772 @publishedAll
       
   773 @released
       
   774 */
       
   775 const TInt KErrHttpGeneralHeaderMissingHost				= KErrHttpMissingHeaderBase - 1;
       
   776 /**
       
   777 Protocol handler errors
       
   778 @publishedAll
       
   779 @released
       
   780 */
       
   781 const TInt KErrHttpProtocolHandlerBase = KHttpErrorBase - 170;
       
   782 /**
       
   783 The request body needed to be rewound but the client but it doesn't support 
       
   784 @publishedAll
       
   785 @released
       
   786 */
       
   787 const TInt KErrHttpCantResetRequestBody				= KErrHttpProtocolHandlerBase;
       
   788 /**
       
   789 The Protocol handler is not initialised
       
   790 @publishedAll
       
   791 @released
       
   792 */
       
   793 const TInt KErrHttpProtTransactionNotInitialised	= KErrHttpProtocolHandlerBase -1;
       
   794 /**
       
   795 Unable to establish a tunnel.
       
   796 @publishedAll
       
   797 @released
       
   798 */
       
   799 const TInt KErrHttpCannotEstablishTunnel			= KErrHttpProtocolHandlerBase -2;
       
   800 /**
       
   801 Invalid URI
       
   802 @publishedAll
       
   803 @released
       
   804 */
       
   805 const TInt KErrHttpInvalidUri						= KErrHttpProtocolHandlerBase -3;
       
   806 /**
       
   807 Protocol handler experienced a non-pipelining error
       
   808 @publishedAll
       
   809 @released
       
   810 */
       
   811 const TInt KErrHttpNonPipeliningError				= KErrHttpProtocolHandlerBase -4;
       
   812 /**
       
   813 Protocol handler experienced a pipelining error
       
   814 @publishedAll
       
   815 @released
       
   816 */
       
   817 const TInt KErrHttpPipeliningError					= KErrHttpProtocolHandlerBase -5;
       
   818 
       
   819 /**
       
   820 The request has been not sent for the transaction and connection has been disconnected. 
       
   821 This error will be propagated to the client only, if the HTTP:ENotifyOnDisconnect property 
       
   822 is set with a value HTTP::EEnableDisconnectNotification
       
   823 
       
   824 @publishedAll
       
   825 @released
       
   826 */
       
   827 const TInt KErrHttpRequestNotSent 					= KErrHttpProtocolHandlerBase -6;
       
   828 
       
   829 /**
       
   830 The response has been not received for the transaction and connection has been disconnected. 
       
   831 This error will be propagated to the client only, if the HTTP:ENotifyOnDisconnect property is 
       
   832 set with a value HTTP::EEnableDisconnectNotification
       
   833 
       
   834 @publishedAll
       
   835 @released
       
   836 */
       
   837 const TInt KErrHttpResponseNotReceived				= KErrHttpProtocolHandlerBase -7;
       
   838 
       
   839 /**
       
   840 Partial response has been received and connection has been disconnected. This error will be 
       
   841 propagated to the client only, if the HTTP:ENotifyOnDisconnect property is set with a value
       
   842 HTTP::EEnableDisconnectNotification
       
   843 
       
   844 @publishedAll
       
   845 @released
       
   846 */
       
   847 const TInt KErrHttpPartialResponseReceived			= KErrHttpProtocolHandlerBase -8;
       
   848 
       
   849 /**
       
   850 ClientApplication wants to fail the transaction that was in process by the HTTPMessageParser
       
   851 @publishedAll
       
   852 @released
       
   853 */
       
   854 const TInt KErrHttpOptimiserFailsTrans				= KErrHttpProtocolHandlerBase -9;
       
   855 
       
   856 // end of error codes - maximum error value is -7399 - must not be exceeded!
       
   857 // Inline methods from HTTPStatus
       
   858 
       
   859 inline TBool HTTPStatus::IsInformational(TInt aStatus)
       
   860 	{ 
       
   861 	return ((aStatus >= HTTPStatus::EContinue) && (aStatus < HTTPStatus::EOk));
       
   862 	}
       
   863 inline TBool HTTPStatus::IsSuccessful(TInt aStatus)
       
   864 	{ 
       
   865 	return ((aStatus >= HTTPStatus::EOk) && (aStatus < HTTPStatus::EMultipleChoices));
       
   866 	}
       
   867 inline TBool HTTPStatus::IsRedirection(TInt aStatus)
       
   868 	{
       
   869 	return ((aStatus >= HTTPStatus::EMultipleChoices) && (aStatus < HTTPStatus::EBadRequest));
       
   870 	}
       
   871 inline TBool HTTPStatus::IsClientError(TInt aStatus)
       
   872 	{
       
   873 	return ((aStatus >= HTTPStatus::EBadRequest) && (aStatus < HTTPStatus::EInternalServerError));
       
   874 	}
       
   875 inline TBool HTTPStatus::IsServerError(TInt aStatus)
       
   876 	{
       
   877 	return (aStatus >= HTTPStatus::EInternalServerError);
       
   878 	}
       
   879 
       
   880 
       
   881 
       
   882 #endif // __HTTPERR_H__