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

Function cupsReadResponseData

cups/request.c:541–570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539 */
540
541ssize_t /* O - Bytes read, 0 on EOF, -1 on error */
542cupsReadResponseData(
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/*

Callers

nothing calls this directly

Calls 3

_cupsGlobalsFunction · 0.85
_cupsSetErrorFunction · 0.85
httpRead2Function · 0.85

Tested by

no test coverage detected