| 539 | */ |
| 540 | |
| 541 | ssize_t /* O - Bytes read, 0 on EOF, -1 on error */ |
| 542 | cupsReadResponseData( |
| 543 | http_t *http, /* I - Connection to server or @code CUPS_HTTP_DEFAULT@ */ |
| 544 | char *buffer, /* I - Buffer to use */ |
| 545 | size_t length) /* I - Number of bytes to read */ |
| 546 | { |
| 547 | /* |
| 548 | * Get the default connection as needed... |
| 549 | */ |
| 550 | |
| 551 | DEBUG_printf(("cupsReadResponseData(http=%p, buffer=%p, length=" CUPS_LLFMT ")", (void *)http, (void *)buffer, CUPS_LLCAST length)); |
| 552 | |
| 553 | if (!http) |
| 554 | { |
| 555 | _cups_globals_t *cg = _cupsGlobals(); |
| 556 | /* Pointer to library globals */ |
| 557 | |
| 558 | if ((http = cg->http) == NULL) |
| 559 | { |
| 560 | _cupsSetError(IPP_STATUS_ERROR_INTERNAL, _("No active connection"), 1); |
| 561 | return (-1); |
| 562 | } |
| 563 | } |
| 564 | |
| 565 | /* |
| 566 | * Then read from the HTTP connection... |
| 567 | */ |
| 568 | |
| 569 | return (httpRead2(http, buffer, length)); |
| 570 | } |
| 571 | |
| 572 | |
| 573 | /* |
nothing calls this directly
no test coverage detected