1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | /* |
---|
3 | * soup-status.h: HTTP status code and status class definitions |
---|
4 | * |
---|
5 | * Copyright (C) 2001-2003, Ximian, Inc. |
---|
6 | */ |
---|
7 | |
---|
8 | #ifndef SOUP_STATUS_H |
---|
9 | #define SOUP_STATUS_H 1 |
---|
10 | |
---|
11 | typedef enum { |
---|
12 | SOUP_STATUS_CLASS_TRANSPORT_ERROR = 0, |
---|
13 | SOUP_STATUS_CLASS_INFORMATIONAL, |
---|
14 | SOUP_STATUS_CLASS_SUCCESS, |
---|
15 | SOUP_STATUS_CLASS_REDIRECT, |
---|
16 | SOUP_STATUS_CLASS_CLIENT_ERROR, |
---|
17 | SOUP_STATUS_CLASS_SERVER_ERROR |
---|
18 | } SoupStatusClass; |
---|
19 | |
---|
20 | #define SOUP_STATUS_IS_TRANSPORT_ERROR(status) ((status) > 0 && (status) < 100) |
---|
21 | #define SOUP_STATUS_IS_INFORMATIONAL(status) ((status) >= 100 && (status) < 200) |
---|
22 | #define SOUP_STATUS_IS_SUCCESSFUL(status) ((status) >= 200 && (status) < 300) |
---|
23 | #define SOUP_STATUS_IS_REDIRECTION(status) ((status) >= 300 && (status) < 400) |
---|
24 | #define SOUP_STATUS_IS_CLIENT_ERROR(status) ((status) >= 400 && (status) < 500) |
---|
25 | #define SOUP_STATUS_IS_SERVER_ERROR(status) ((status) >= 500 && (status) < 600) |
---|
26 | |
---|
27 | typedef enum { |
---|
28 | SOUP_STATUS_NONE, |
---|
29 | |
---|
30 | /* Transport Errors */ |
---|
31 | SOUP_STATUS_CANCELLED = 1, |
---|
32 | SOUP_STATUS_CANT_RESOLVE, |
---|
33 | SOUP_STATUS_CANT_RESOLVE_PROXY, |
---|
34 | SOUP_STATUS_CANT_CONNECT, |
---|
35 | SOUP_STATUS_CANT_CONNECT_PROXY, |
---|
36 | SOUP_STATUS_SSL_FAILED, |
---|
37 | SOUP_STATUS_IO_ERROR, |
---|
38 | SOUP_STATUS_MALFORMED, |
---|
39 | SOUP_STATUS_TRY_AGAIN, |
---|
40 | |
---|
41 | /* HTTP Status Codes */ |
---|
42 | SOUP_STATUS_CONTINUE = 100, |
---|
43 | SOUP_STATUS_SWITCHING_PROTOCOLS = 101, |
---|
44 | SOUP_STATUS_PROCESSING = 102, /* WebDAV */ |
---|
45 | |
---|
46 | SOUP_STATUS_OK = 200, |
---|
47 | SOUP_STATUS_CREATED = 201, |
---|
48 | SOUP_STATUS_ACCEPTED = 202, |
---|
49 | SOUP_STATUS_NON_AUTHORITATIVE = 203, |
---|
50 | SOUP_STATUS_NO_CONTENT = 204, |
---|
51 | SOUP_STATUS_RESET_CONTENT = 205, |
---|
52 | SOUP_STATUS_PARTIAL_CONTENT = 206, |
---|
53 | SOUP_STATUS_MULTI_STATUS = 207, /* WebDAV */ |
---|
54 | |
---|
55 | SOUP_STATUS_MULTIPLE_CHOICES = 300, |
---|
56 | SOUP_STATUS_MOVED_PERMANENTLY = 301, |
---|
57 | SOUP_STATUS_FOUND = 302, |
---|
58 | SOUP_STATUS_MOVED_TEMPORARILY = 302, /* RFC 2068 */ |
---|
59 | SOUP_STATUS_SEE_OTHER = 303, |
---|
60 | SOUP_STATUS_NOT_MODIFIED = 304, |
---|
61 | SOUP_STATUS_USE_PROXY = 305, |
---|
62 | SOUP_STATUS_NOT_APPEARING_IN_THIS_PROTOCOL = 306, /* (reserved) */ |
---|
63 | SOUP_STATUS_TEMPORARY_REDIRECT = 307, |
---|
64 | |
---|
65 | SOUP_STATUS_BAD_REQUEST = 400, |
---|
66 | SOUP_STATUS_UNAUTHORIZED = 401, |
---|
67 | SOUP_STATUS_PAYMENT_REQUIRED = 402, /* (reserved) */ |
---|
68 | SOUP_STATUS_FORBIDDEN = 403, |
---|
69 | SOUP_STATUS_NOT_FOUND = 404, |
---|
70 | SOUP_STATUS_METHOD_NOT_ALLOWED = 405, |
---|
71 | SOUP_STATUS_NOT_ACCEPTABLE = 406, |
---|
72 | SOUP_STATUS_PROXY_AUTHENTICATION_REQUIRED = 407, |
---|
73 | SOUP_STATUS_PROXY_UNAUTHORIZED = SOUP_STATUS_PROXY_AUTHENTICATION_REQUIRED, |
---|
74 | SOUP_STATUS_REQUEST_TIMEOUT = 408, |
---|
75 | SOUP_STATUS_CONFLICT = 409, |
---|
76 | SOUP_STATUS_GONE = 410, |
---|
77 | SOUP_STATUS_LENGTH_REQUIRED = 411, |
---|
78 | SOUP_STATUS_PRECONDITION_FAILED = 412, |
---|
79 | SOUP_STATUS_REQUEST_ENTITY_TOO_LARGE = 413, |
---|
80 | SOUP_STATUS_REQUEST_URI_TOO_LONG = 414, |
---|
81 | SOUP_STATUS_UNSUPPORTED_MEDIA_TYPE = 415, |
---|
82 | SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE = 416, |
---|
83 | SOUP_STATUS_INVALID_RANGE = SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE, |
---|
84 | SOUP_STATUS_EXPECTATION_FAILED = 417, |
---|
85 | SOUP_STATUS_UNPROCESSABLE_ENTITY = 422, /* WebDAV */ |
---|
86 | SOUP_STATUS_LOCKED = 423, /* WebDAV */ |
---|
87 | SOUP_STATUS_FAILED_DEPENDENCY = 424, /* WebDAV */ |
---|
88 | |
---|
89 | SOUP_STATUS_INTERNAL_SERVER_ERROR = 500, |
---|
90 | SOUP_STATUS_NOT_IMPLEMENTED = 501, |
---|
91 | SOUP_STATUS_BAD_GATEWAY = 502, |
---|
92 | SOUP_STATUS_SERVICE_UNAVAILABLE = 503, |
---|
93 | SOUP_STATUS_GATEWAY_TIMEOUT = 504, |
---|
94 | SOUP_STATUS_HTTP_VERSION_NOT_SUPPORTED = 505, |
---|
95 | SOUP_STATUS_INSUFFICIENT_STORAGE = 507, /* WebDAV search */ |
---|
96 | SOUP_STATUS_NOT_EXTENDED = 510 /* RFC 2774 */ |
---|
97 | } SoupKnownStatusCode; |
---|
98 | |
---|
99 | const char *soup_status_get_phrase (guint status_code); |
---|
100 | |
---|
101 | #endif /* SOUP_STATUS_H */ |
---|