| 6379 | */ |
| 6380 | |
| 6381 | static void |
| 6382 | get_default(cupsd_client_t *con) /* I - Client connection */ |
| 6383 | { |
| 6384 | http_status_t status; /* Policy status */ |
| 6385 | cups_array_t *ra; /* Requested attributes array */ |
| 6386 | |
| 6387 | |
| 6388 | cupsdLogMessage(CUPSD_LOG_DEBUG2, "get_default(%p[%d])", (void *)con, con->number); |
| 6389 | |
| 6390 | /* |
| 6391 | * Check policy... |
| 6392 | */ |
| 6393 | |
| 6394 | if ((status = cupsdCheckPolicy(DefaultPolicyPtr, con, NULL)) != HTTP_OK) |
| 6395 | { |
| 6396 | send_http_error(con, status, NULL); |
| 6397 | return; |
| 6398 | } |
| 6399 | |
| 6400 | if (DefaultPrinter) |
| 6401 | { |
| 6402 | ra = create_requested_array(con->request); |
| 6403 | |
| 6404 | copy_printer_attrs(con, DefaultPrinter, ra); |
| 6405 | |
| 6406 | cupsArrayDelete(ra); |
| 6407 | |
| 6408 | con->response->request.status.status_code = IPP_OK; |
| 6409 | } |
| 6410 | else |
| 6411 | send_ipp_status(con, IPP_NOT_FOUND, _("No default printer.")); |
| 6412 | } |
| 6413 | |
| 6414 | |
| 6415 | /* |
no test coverage detected