MCPcopy Create free account
hub / github.com/OpenPrinting/cups / _cupsSetHTTPError

Function _cupsSetHTTPError

cups/request.c:1136–1192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1134 */
1135
1136void
1137_cupsSetHTTPError(http_t *http, /* I - HTTP connection */
1138 http_status_t status) /* I - HTTP status code */
1139{
1140 switch (status)
1141 {
1142 case HTTP_STATUS_NOT_FOUND :
1143 _cupsSetError(IPP_STATUS_ERROR_NOT_FOUND, httpStatus(status), 0);
1144 break;
1145
1146 case HTTP_STATUS_UNAUTHORIZED :
1147 _cupsSetError(IPP_STATUS_ERROR_NOT_AUTHENTICATED, httpStatus(status), 0);
1148 break;
1149
1150 case HTTP_STATUS_CUPS_AUTHORIZATION_CANCELED :
1151 _cupsSetError(IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED, httpStatus(status), 0);
1152 break;
1153
1154 case HTTP_STATUS_FORBIDDEN :
1155 _cupsSetError(IPP_STATUS_ERROR_FORBIDDEN, httpStatus(status), 0);
1156 break;
1157
1158 case HTTP_STATUS_BAD_REQUEST :
1159 _cupsSetError(IPP_STATUS_ERROR_BAD_REQUEST, httpStatus(status), 0);
1160 break;
1161
1162 case HTTP_STATUS_REQUEST_TOO_LARGE :
1163 _cupsSetError(IPP_STATUS_ERROR_REQUEST_VALUE, httpStatus(status), 0);
1164 break;
1165
1166 case HTTP_STATUS_NOT_IMPLEMENTED :
1167 _cupsSetError(IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED, httpStatus(status), 0);
1168 break;
1169
1170 case HTTP_STATUS_NOT_SUPPORTED :
1171 _cupsSetError(IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED, httpStatus(status), 0);
1172 break;
1173
1174 case HTTP_STATUS_UPGRADE_REQUIRED :
1175 _cupsSetError(IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED, httpStatus(status), 0);
1176 break;
1177
1178 case HTTP_STATUS_CUPS_PKI_ERROR :
1179 _cupsSetError(IPP_STATUS_ERROR_CUPS_PKI, httpStatus(status), 0);
1180 break;
1181
1182 case HTTP_STATUS_ERROR :
1183 _cupsSetError(IPP_STATUS_ERROR_INTERNAL, http->error != 0 ? strerror(http->error) : "Internal Server Error", 0);
1184 break;
1185
1186 default :
1187 DEBUG_printf(("4_cupsSetHTTPError: HTTP error %d mapped to "
1188 "IPP_STATUS_ERROR_SERVICE_UNAVAILABLE!", status));
1189 _cupsSetError(IPP_STATUS_ERROR_SERVICE_UNAVAILABLE, httpStatus(status), 0);
1190 break;
1191 }
1192}

Callers 15

_httpTLSStartFunction · 0.85
cupsGetFdFunction · 0.85
cupsPutFdFunction · 0.85
cupsGetPPD3Function · 0.85
httpLoadCredentialsFunction · 0.85
httpSaveCredentialsFunction · 0.85
_httpTLSReadFunction · 0.85
_httpTLSWriteFunction · 0.85
http_sspi_clientFunction · 0.85
http_sspi_serverFunction · 0.85

Calls 2

_cupsSetErrorFunction · 0.85
httpStatusFunction · 0.85

Tested by

no test coverage detected