Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
20 @warning : This file contains Rose Model ID comments - please do not delete
29 //##ModelId=3C4C18750141
32 The complete set of HTTP Status codes, as defined in RFC2616.
40 /** 'Informational' range of codes 1xx
45 /** Switching Protocols.
47 ESwitchingProtocols = 101,
48 /** 'Successful' range of codes 2xx
56 /** The entry has been accepted.
59 /** Non-Authoritative Information.
61 ENonAuthoritativeInfo = 203,
70 EPartialContent = 206,
71 /** 'Redirection' range of codes 3xx
75 EMultipleChoices = 300,
76 /** Moved Permanently.
78 EMovedPermanently = 301,
80 Note, this is deprecated in HTTP/1.1 - 307 will be used instead
95 /** Temporary Redirect.
97 ETemporaryRedirect = 307,
98 /** 'Client Error' range of codes 4xx
106 /** Payment Required. Note, this is reserved in HTTP/1.1
108 EPaymentRequired = 402,
115 /** Method Not Allowed.
117 EMethodNotAllowed = 405,
120 ENotAcceptable = 406,
121 /** Proxy Authentication Required.
123 EProxyAuthenticationRequired = 407,
126 ERequestTimeout = 408,
135 ELengthRequired = 411,
136 /** Precondition Failed.
138 EPreconditionFailed = 412,
139 /** Request Entity Too Large.
141 ERequestEntityTooLarge = 413,
142 /** Request-URI Too Long.
144 ERequestURITooLong = 414,
145 /** Unsupported Media Type.
147 EUnsupportedMediaType = 415,
148 /** Requested Range Not Satisfiable.
150 ERequestedRangeNotSatisfiable = 416,
151 /** Expectation Failed.
153 EExpectationFailed = 417,
154 /** 'Server Error' range of codes 5xx
156 /** Internal Server Error.
158 EInternalServerError = 500,
161 ENotImplemented = 501,
165 /** Service Unavailable.
167 EServiceUnavailable = 503,
170 EGatewayTimeout = 504,
171 /** HTTP Version Not Supported.
173 EHTTPVersionNotSupported = 505
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
181 inline static TBool IsInformational(TInt aStatus);
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
189 inline static TBool IsSuccessful(TInt aStatus);
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
196 inline static TBool IsRedirection(TInt aStatus);
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
203 inline static TBool IsClientError(TInt aStatus);
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
210 inline static TBool IsServerError(TInt aStatus);
219 // HTTPPanic::Panic(HTTPPanic:: )
221 //##ModelId=3C4C18740352
232 /** RHTTPSession session is already open. ( Panic HTTP-CORE 0 )
235 /** Specified field is missing. ( Panic HTTP-CORE 1 )
238 /** Unused. ( Panic HTTP-CORE 2 )
241 /** Unused. ( Panic HTTP-CORE 2 )
244 /** Mismatch between header's type and its attempted use. ( Panic HTTP-CORE 4 )
247 /** Unused. ( Panic HTTP-CORE 5 )
249 ETransactionEventOutstanding,
250 /** A transaction error occurred, and the MHFRunError() in use didn't handle it. ( Panic HTTP-CORE 6 )
252 ETransactionUnhandledError,
253 /** Attempted to add a filter while there is a transaction outstanding. ( Panic HTTP-CORE 6 )
255 EAddingFilterWithOutstandingTransactions,
256 /** Attempted to add a filter at a position not between the protocol handler and the client. ( Panic HTTP-CORE 8 )
258 EFilterInvalidPosition,
259 /** CHTTPEncoder object destroyed without its data being released. ( Panic HTTP-CORE 9 )
261 EHTTPFormDataUnreleased,
262 /** CHTTPEncoder object at the wrong state for adding data. ( Panic HTTP-CORE 10 )
264 EHTTPFormSupplyingData,
265 /** Unused. ( Panic HTTP-CORE 11 )
267 EValidationFilterFailure,
268 /** Invalid request data. ( Panic HTTP-CORE 12 )
271 /** Invalid response data. ( Panic HTTP-CORE 13 )
274 /** Unused. ( Panic HTTP-CORE 14 )
276 ENoTransportHandlerSet,
277 /** Unused. ( Panic HTTP-CORE 15 )
279 EAuthenticationFilterBadState,
280 /** An invalid filter handle was specified. ( Panic HTTP-CORE 16 )
285 //##ModelId=3C4C18740366
286 static void Panic(THTTPPanic aPanic);
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.
294 Base value for the HTTP error code range (-7200 to -7399)
298 const TInt KHttpErrorBase = -7200;
301 // Text mode HTTP protocol handler
305 Codec encoding errors for HTTP headers
309 const TInt KHttpHeaderEncodeErrorBase = KHttpErrorBase;
312 Error making a default encoding of unrecognised headers
316 const TInt KErrHttpEncodeDefault = KHttpHeaderEncodeErrorBase;
318 Error encoding the Accept field
322 const TInt KErrHttpEncodeAccept = KHttpHeaderEncodeErrorBase - 1;
324 Error encoding the Accept-Charset field
328 const TInt KErrHttpEncodeAcceptCharset = KHttpHeaderEncodeErrorBase - 2;
330 Error encoding a q-value parameter
334 const TInt KErrHttpEncodeQValue = KHttpHeaderEncodeErrorBase - 3;
336 Error encoding the Authorization field
340 const TInt KErrHttpEncodeAuthorization = KHttpHeaderEncodeErrorBase - 4;
342 Error encoding Basic credentials
346 const TInt KErrHttpEncodeBasicAuth = KHttpHeaderEncodeErrorBase - 5;
348 Error encoding Digest credentials
352 const TInt KErrHttpEncodeDigestAuth = KHttpHeaderEncodeErrorBase - 6;
354 Error encoding the Connection field
358 const TInt KErrHttpEncodeConnection = KHttpHeaderEncodeErrorBase - 7;
360 Error encoding the Content-Length field
364 const TInt KErrHttpEncodeContentLength = KHttpHeaderEncodeErrorBase - 8;
366 Error encoding the Content-Type field
370 const TInt KErrHttpEncodeContentType = KHttpHeaderEncodeErrorBase - 9;
372 Error encoding the Host field
376 const TInt KErrHttpEncodeHost = KHttpHeaderEncodeErrorBase - 10;
378 Error encoding the Host field's port parameter
382 const TInt KErrHttpEncodeHostPort = KHttpHeaderEncodeErrorBase - 11;
384 Error encoding the Transfer-Encoding field
388 const TInt KErrHttpEncodeTransferEncoding = KHttpHeaderEncodeErrorBase - 12;
390 Error encoding the User-Agent field
394 const TInt KErrHttpEncodeUserAgent = KHttpHeaderEncodeErrorBase - 13;
396 Error encoding the Date field
400 const TInt KErrHttpEncodeDate = KHttpHeaderEncodeErrorBase - 14;
402 Error encoding the Cookie field
406 const TInt KErrHttpEncodeCookie = KHttpHeaderEncodeErrorBase - 15;
408 Error encoding the Cache-Control field
412 const TInt KErrHttpEncodeCacheControl = KHttpHeaderEncodeErrorBase - 16;
414 Error encoding the Pragma field
418 const TInt KErrHttpEncodePragma = KHttpHeaderEncodeErrorBase - 17;
420 Error encoding the if match field
424 const TInt KErrHttpEncodeIfMatch = KHttpHeaderEncodeErrorBase - 18;
426 Error encoding the if none match field
430 const TInt KErrHttpEncodeIfNoneMatch = KHttpHeaderEncodeErrorBase - 19;
432 Error encoding the if modified since field
436 const TInt KErrHttpEncodeIfModifiedSince = KHttpHeaderEncodeErrorBase - 20;
438 Error encoding the if unmodified since field
442 const TInt KErrHttpEncodeIfUnmodifiedSince = KHttpHeaderEncodeErrorBase - 21;
444 Error encoding the Cookie2 field
448 const TInt KErrHttpEncodeCookie2 = KHttpHeaderEncodeErrorBase - 22;
450 Error encoding the Content-Language field
454 const TInt KErrHttpEncodeContentLanguage = KHttpHeaderEncodeErrorBase - 23;
456 Error encoding the WWWAuthenticate field
460 const TInt KErrHttpEncodeDoWWWAuthenticate = KHttpHeaderEncodeErrorBase - 24;
462 Error encoding the Age field
466 const TInt KErrHttpEncodeDoAge = KHttpHeaderEncodeErrorBase - 25;
468 Error encoding the Vary field
472 const TInt KErrHttpEncodeDoVary = KHttpHeaderEncodeErrorBase - 26;
474 Error encoding the Content-Language field
478 const TInt KErrHttpEncodeDoContentLanguage = KHttpHeaderEncodeErrorBase - 27;
480 Error encoding the Content-Encoding field
484 const TInt KErrHttpEncodeContentEncoding = KHttpHeaderEncodeErrorBase - 28;
486 Error encoding the Content-Location field
490 const TInt KErrHttpEncodeContentLocation = KHttpHeaderEncodeErrorBase - 29;
492 Error encoding the Content-MD5 field
496 const TInt KErrHttpEncodeContentMD5 = KHttpHeaderEncodeErrorBase - 30;
498 Error encoding the Accept-Encoding field
502 const TInt KErrHttpEncodeAcceptLanguage = KHttpHeaderEncodeErrorBase - 31;
504 Error encoding the Accept-Language field
508 const TInt KErrHttpEncodeAcceptEncoding = KHttpHeaderEncodeErrorBase - 32;
510 Error encoding the TE field
514 const TInt KErrHttpEncodeTE = KHttpHeaderEncodeErrorBase - 33;
516 Error encoding the Upgrade field
520 const TInt KErrHttpEncodeUpgrade = KHttpHeaderEncodeErrorBase - 34;
523 Codec decoding errors for values found in HTTP headers
527 const TInt KHttpValueDecodeErrorBase = KHttpErrorBase - 60;
530 General formatting error for date values
534 const TInt KErrHttpDecodeMalformedDate = KHttpValueDecodeErrorBase;
540 const TInt KErrHttpDecodeMalformedYear = KHttpValueDecodeErrorBase - 1;
542 Malformed short month name
546 const TInt KErrHttpDecodeMalformedMonth = KHttpValueDecodeErrorBase - 2;
548 Malformed number of day in month
552 const TInt KErrHttpDecodeMalformedDay = KHttpValueDecodeErrorBase - 3;
554 Malformed short day name
558 const TInt KErrHttpDecodeMalformedWkDay = KHttpValueDecodeErrorBase - 4;
560 Malformed long day name
564 const TInt KErrHttpDecodeMalformedWeekDay = KHttpValueDecodeErrorBase - 5;
566 Malformed integer value
570 const TInt KErrHttpDecodeMalformedInteger = KHttpValueDecodeErrorBase - 6;
572 Malformed quoted string
576 const TInt KErrHttpDecodeMalformedQuotedStr = KHttpValueDecodeErrorBase - 7;
579 Codec decoding errors for HTTP headers
583 const TInt KHttpHeaderDecodeErrorBase = KHttpErrorBase - 70;
586 Error decoding the Accept field
590 const TInt KErrHttpDecodeAccept = KHttpHeaderDecodeErrorBase;
592 Error decoding the Connection field
596 const TInt KErrHttpDecodeConnection = KHttpHeaderDecodeErrorBase - 1;
598 Error decoding the Content-Length field
602 const TInt KErrHttpDecodeContentLength = KHttpHeaderDecodeErrorBase - 2;
604 Error decoding the Content-Type field
608 const TInt KErrHttpDecodeContentType = KHttpHeaderDecodeErrorBase - 3;
610 Error decoding the Transfer-Encoding field
614 const TInt KErrHttpDecodeTransferEncoding = KHttpHeaderDecodeErrorBase - 4;
616 Error decoding the WWWAuthenticate field
620 const TInt KErrHttpDecodeWWWAuthenticate = KHttpHeaderDecodeErrorBase - 5;
622 The WWWAuthenticate field contained an unrecognised authentication scheme
626 const TInt KErrHttpDecodeUnknownAuthScheme = KHttpHeaderDecodeErrorBase - 6;
628 Error decoding a Basic WWWAuthenticate challenge
632 const TInt KErrHttpDecodeBasicAuth = KHttpHeaderDecodeErrorBase - 7;
634 Error decoding a Digest WWWAuthenticate challenge
638 const TInt KErrHttpDecodeDigestAuth = KHttpHeaderDecodeErrorBase - 8;
640 Error decoding a Set-Cookie field
644 const TInt KErrHttpDecodeCookie = KHttpHeaderDecodeErrorBase - 9;
646 Error decoding the Authorization field
650 const TInt KErrHttpDecodeAuthorization = KHttpHeaderDecodeErrorBase - 10;
652 Error decoding the Accept-Charset field
656 const TInt KErrHttpDecodeAcceptCharset = KHttpHeaderDecodeErrorBase - 11;
658 Error decoding the Accept-Language field
662 const TInt KErrHttpDecodeAcceptLanguage = KHttpHeaderDecodeErrorBase - 12;
664 Error decoding the Accept-Encoding field
668 const TInt KErrHttpDecodeAcceptEncoding = KHttpHeaderDecodeErrorBase - 13;
670 Error decoding the TE field
674 const TInt KErrHttpDecodeTE = KHttpHeaderEncodeErrorBase - 14;
676 Error decoding the Expect field
680 const TInt KErrHttpDecodeExpect = KHttpHeaderEncodeErrorBase - 15;
682 Error decoding the Content-Disposition field
686 const TInt KErrHttpDecodeContentDisposition = KHttpHeaderDecodeErrorBase - 14;
688 Response errors. These represent specific failure cases
692 const TInt KErrHttpResponseFailureBase = KHttpErrorBase - 100;
695 A uri redirected too many times, possibly indicating a circular redirection
699 const TInt KErrHttpRedirectExceededLimit = KErrHttpResponseFailureBase;
701 A server responded that the uri must be fetched via a proxy
705 const TInt KErrHttpRedirectUseProxy = KErrHttpResponseFailureBase - 1;
707 A server sent a redirection response that did not include a Location header
711 const TInt KErrHttpRedirectNoLocationField = KErrHttpResponseFailureBase - 2;
713 An error occured in parsing which left the parser in a unknown state
717 const TInt KErrHttpUnknownParseState = KErrHttpResponseFailureBase - 3;
720 Request building errors: cause the Validation Filter to make a transaction fail and terminate
724 const TInt KErrHttpReqBuildErrorBase = KHttpErrorBase - 130;
727 A body is provided with a method that doesn't allow bodys to be transmitted
731 const TInt KErrHttpRequestHasBody = KErrHttpReqBuildErrorBase;
733 A body is missing from a method that requires it
737 const TInt KErrHttpRequestBodyMissing = KErrHttpReqBuildErrorBase - 1;
739 Should contain The Max-Forward header
743 const TInt KErrHttpTraceReqWithoutMaxForwardHeader = KErrHttpReqBuildErrorBase - 2;
745 Body must NOT be sent chunked if using HTTP/1.0
749 const TInt KErrHttpPostReqBodyWithoutSizeOnHTTP10 = KErrHttpReqBuildErrorBase - 3;
751 Request contained a response header or a entity header but no body
755 const TInt KErrHttpInvalidHeaderInRequest = KErrHttpReqBuildErrorBase - 4;
757 Missing but required header errors
762 const TInt KErrHttpMissingHeaderBase = KHttpErrorBase - 160;
764 A body was provided in the request but no Content-Type header was set
769 const TInt KErrHttpEntityHeaderMissingContentType = KErrHttpMissingHeaderBase;
771 The request URI was relative, but no Host header was set to indicate a server to connect to
775 const TInt KErrHttpGeneralHeaderMissingHost = KErrHttpMissingHeaderBase - 1;
777 Protocol handler errors
781 const TInt KErrHttpProtocolHandlerBase = KHttpErrorBase - 170;
783 The request body needed to be rewound but the client but it doesn't support
787 const TInt KErrHttpCantResetRequestBody = KErrHttpProtocolHandlerBase;
789 The Protocol handler is not initialised
793 const TInt KErrHttpProtTransactionNotInitialised = KErrHttpProtocolHandlerBase -1;
795 Unable to establish a tunnel.
799 const TInt KErrHttpCannotEstablishTunnel = KErrHttpProtocolHandlerBase -2;
805 const TInt KErrHttpInvalidUri = KErrHttpProtocolHandlerBase -3;
807 Protocol handler experienced a non-pipelining error
811 const TInt KErrHttpNonPipeliningError = KErrHttpProtocolHandlerBase -4;
813 Protocol handler experienced a pipelining error
817 const TInt KErrHttpPipeliningError = KErrHttpProtocolHandlerBase -5;
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
827 const TInt KErrHttpRequestNotSent = KErrHttpProtocolHandlerBase -6;
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
837 const TInt KErrHttpResponseNotReceived = KErrHttpProtocolHandlerBase -7;
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
847 const TInt KErrHttpPartialResponseReceived = KErrHttpProtocolHandlerBase -8;
850 ClientApplication wants to fail the transaction that was in process by the HTTPMessageParser
854 const TInt KErrHttpOptimiserFailsTrans = KErrHttpProtocolHandlerBase -9;
856 // end of error codes - maximum error value is -7399 - must not be exceeded!
857 // Inline methods from HTTPStatus
859 inline TBool HTTPStatus::IsInformational(TInt aStatus)
861 return ((aStatus >= HTTPStatus::EContinue) && (aStatus < HTTPStatus::EOk));
863 inline TBool HTTPStatus::IsSuccessful(TInt aStatus)
865 return ((aStatus >= HTTPStatus::EOk) && (aStatus < HTTPStatus::EMultipleChoices));
867 inline TBool HTTPStatus::IsRedirection(TInt aStatus)
869 return ((aStatus >= HTTPStatus::EMultipleChoices) && (aStatus < HTTPStatus::EBadRequest));
871 inline TBool HTTPStatus::IsClientError(TInt aStatus)
873 return ((aStatus >= HTTPStatus::EBadRequest) && (aStatus < HTTPStatus::EInternalServerError));
875 inline TBool HTTPStatus::IsServerError(TInt aStatus)
877 return (aStatus >= HTTPStatus::EInternalServerError);
882 #endif // __HTTPERR_H__