106
105
#include "InkErrno.h"
107
106
#define UNKNOWN_INTERNAL_ERROR (INK_START_ERRNO - 1)
110
/* WUTS proxy-status codes */
111
enum WUTSProxyStatusCode
113
WUTS_PROXY_STATUS_UNKNOWN = 0,
114
WUTS_PROXY_STATUS_UNSPECIFIED = 0,
115
WUTS_PROXY_STATUS_CONTINUE = 100,
116
WUTS_PROXY_STATUS_SWITCHING_PROTOCOL = 101,
117
WUTS_PROXY_STATUS_OK = 200,
118
WUTS_PROXY_STATUS_CREATED = 201,
119
WUTS_PROXY_STATUS_ACCEPTED = 202,
120
WUTS_PROXY_STATUS_NON_AUTHORITATIVE_INFORMATION = 203,
121
WUTS_PROXY_STATUS_NO_CONTENT = 204,
122
WUTS_PROXY_STATUS_RESET_CONTENT = 205,
123
WUTS_PROXY_STATUS_PARTIAL_CONTENT = 206,
124
WUTS_PROXY_STATUS_MULTIPLE_CHOICES = 300,
125
WUTS_PROXY_STATUS_MOVED_PERMANENTLY = 301,
126
WUTS_PROXY_STATUS_MOVED_TEMPORARILY = 302,
127
WUTS_PROXY_STATUS_SEE_OTHER = 303,
128
WUTS_PROXY_STATUS_NOT_MODIFIED = 304,
129
WUTS_PROXY_STATUS_USE_PROXY = 305,
130
WUTS_PROXY_STATUS_BAD_REQUEST = 400,
131
WUTS_PROXY_STATUS_UNAUTHORIZED = 401,
132
WUTS_PROXY_STATUS_PAYMENT_REQUIRED = 402,
133
WUTS_PROXY_STATUS_FORBIDDEN = 403,
134
WUTS_PROXY_STATUS_NOT_FOUND = 404,
135
WUTS_PROXY_STATUS_METHOD_NOT_ALLOWED = 405,
136
WUTS_PROXY_STATUS_NOT_ACCEPTABLE = 406,
137
WUTS_PROXY_STATUS_PROXY_AUTHENTICATION_REQUIRED = 407,
138
WUTS_PROXY_STATUS_REQUEST_TIMEOUT = 408,
139
WUTS_PROXY_STATUS_CONFLICT = 409,
140
WUTS_PROXY_STATUS_GONE = 410,
141
WUTS_PROXY_STATUS_LENGTH_REQUIRED = 411,
142
WUTS_PROXY_STATUS_PRECONDITION_FAILED = 412,
143
WUTS_PROXY_STATUS_REQUEST_ENTITY_TOO_LARGE = 413,
144
WUTS_PROXY_STATUS_REQUEST_URI_TOO_LONG = 414,
145
WUTS_PROXY_STATUS_UNSUPPORTED_MEDIA_TYPE = 415,
146
WUTS_PROXY_STATUS_INTERNAL_SERVER_ERROR = 500,
147
WUTS_PROXY_STATUS_NOT_IMPLEMENTED = 501,
148
WUTS_PROXY_STATUS_BAD_GATEWAY = 502,
149
WUTS_PROXY_STATUS_SERVICE_UNAVAILABLE = 503,
150
WUTS_PROXY_STATUS_GATEWAY_TIMEOUT = 504,
151
WUTS_PROXY_STATUS_HTTPVER_NOT_SUPPORTED = 505,
152
WUTS_PROXY_STATUS_NO_HTTP_CODE_IN_RESPONSE_LINE = 600,
153
WUTS_PROXY_STATUS_READ_TIMEOUT = 800,
154
WUTS_PROXY_STATUS_LIFETIME_EXPIRED = 801,
155
WUTS_PROXY_STATUS_NO_CLIENT_BIG_OBJECT = 802,
156
WUTS_PROXY_STATUS_SOCKET_READ_ERROR = 803,
157
WUTS_PROXY_STATUS_CLIENT_ABORT = 804,
158
WUTS_PROXY_STATUS_CONNECT_FAILED = 805,
159
WUTS_PROXY_STATUS_INVALID_REQUEST = 806,
160
WUTS_PROXY_STATUS_UNSUPPORTED_REQUEST = 807,
161
WUTS_PROXY_STATUS_INVALID_URL = 808,
162
WUTS_PROXY_STATUS_NO_FILE_DESCRIPTORS = 809,
163
WUTS_PROXY_STATUS_DNS_LOOKUP_FAILURE = 810,
164
WUTS_PROXY_STATUS_PROTOCOL_OR_METHOD_NOT_SUPPORTED = 811,
165
WUTS_PROXY_STATUS_UNABLE_TO_FETCH = 812,
166
WUTS_PROXY_STATUS_NO_RELAY = 813,
167
WUTS_PROXY_STATUS_DISK_IO_ERROR = 814,
168
WUTS_PROXY_STATUS_ZERO_SIZE_OBJECT = 815,
169
WUTS_PROXY_STATUS_PROXY_AUTHORIZATION_FAILURE = 817,
170
WUTS_PROXY_STATUS_WEBFETCH_DETECTED_ERROR = 818,
171
WUTS_PROXY_STATUS_PERSISTENT_READ_ERROR = 819,
172
WUTS_PROXY_STATUS_SPIDER_MEMBER_ABORTED = 820,
173
WUTS_PROXY_STATUS_SPIDER_PARENT_CONTROL_RESTRICTION = 821,
174
WUTS_PROXY_STATUS_SPIDER_UNSUPPORTED_HTTP_VERSION = 822,
175
WUTS_PROXY_STATUS_SPIDER_USER_IDENTIFICATION_FAILURE = 823,
176
WUTS_PROXY_STATUS_SPIDER_RESERVED_FOR_FUTURE_USE_1 = 824,
177
WUTS_PROXY_STATUS_SPIDER_TIMEOUT_WHILE_PASSING = 825,
178
WUTS_PROXY_STATUS_SPIDER_TIMEOUT_WHILE_DRAINING = 826,
179
WUTS_PROXY_STATUS_SPIDER_GENERAL_TIMEOUT = 827,
180
WUTS_PROXY_STATUS_SPIDER_CONNECTION_FAILED = 828,
181
WUTS_PROXY_STATUS_SPIDER_RESERVED_FOR_FUTURE_USE_2 = 829,
182
WUTS_PROXY_STATUS_SPIDER_NO_RESOURCES = 830,
183
WUTS_PROXY_STATUS_SPIDER_INTERNAL_ERROR = 831,
184
WUTS_PROXY_STATUS_SPIDER_INTERNAL_IO_ERROR = 832,
185
WUTS_PROXY_STATUS_SPIDER_DNS_TEMP_ERROR = 833,
186
WUTS_PROXY_STATUS_SPIDER_DNS_HOST_NOT_FOUND = 834,
187
WUTS_PROXY_STATUS_SPIDER_DNS_NO_ADDRESS = 835,
188
WUTS_PROXY_STATUS_SPIDER_RESERVED_FOR_FUTURE_USE_3 = 836,
189
WUTS_PROXY_STATUS_IMS_RECEIVED_CACHE_HIT = 998,
190
WUTS_PROXY_STATUS_GET_RECEIVED_CACHE_HIT = 999,
191
WUTS_PROXY_STATUS_INVALID_ASSIGNED_CODE = 9
195
typedef int WUTSProxyId;
197
108
enum ViaStringIndex_t
834
746
typedef struct _DNSLookupInfo
749
/** Origin server address source selection.
751
If config says to use CTA (client target addr) state is
752
OS_ADDR_TRY_CLIENT, otherwise it remains the default. If the
753
connect fails then we switch to a USE. We go to USE_HOSTDB if
754
(1) the HostDB lookup is successful and (2) some address other
755
than the CTA is available to try. Otherwise we keep retrying
756
on the CTA (USE_CLIENT) up to the max retry value. In essence
757
we try to treat the CTA as if it were another RR value in the
761
OS_ADDR_TRY_DEFAULT, ///< Initial state, use what config says.
762
OS_ADDR_TRY_HOSTDB, ///< Try HostDB data.
763
OS_ADDR_TRY_CLIENT, ///< Try client target addr.
764
OS_ADDR_USE_HOSTDB, ///< Force use of HostDB target address.
765
OS_ADDR_USE_CLIENT ///< Use client target addr, no fallback.
837
768
bool lookup_success;
838
769
char *lookup_name;
839
770
char srv_hostname[MAXDNAME];
840
771
LookingUp_t looking_up;
841
772
bool round_robin;
773
bool srv_lookup_success;
775
HostDBApplicationInfo srv_app;
845
lookup_success(false), lookup_name(NULL), looking_up(UNDEFINED_LOOKUP), round_robin(false)
778
: attempts(0), os_addr_style(OS_ADDR_TRY_DEFAULT),
779
lookup_success(false), lookup_name(NULL), looking_up(UNDEFINED_LOOKUP), round_robin(false),
780
srv_lookup_success(false), srv_port(0)
847
memset(&srv_hostname, 0, sizeof(srv_hostname));
782
srv_hostname[0] = '\0';
783
srv_app.allotment.application1 = 0;
784
srv_app.allotment.application2 = 0;