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

Function httpFlushWrite

cups/http.c:706–731  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

704 */
705
706int /* O - Bytes written or -1 on error */
707httpFlushWrite(http_t *http) /* I - HTTP connection */
708{
709 ssize_t bytes; /* Bytes written */
710
711
712 DEBUG_printf(("httpFlushWrite(http=%p) data_encoding=%d", (void *)http, http ? http->data_encoding : 100));
713
714 if (!http || !http->wused)
715 {
716 DEBUG_puts(http ? "1httpFlushWrite: Write buffer is empty." :
717 "1httpFlushWrite: No connection.");
718 return (0);
719 }
720
721 if (http->data_encoding == HTTP_ENCODING_CHUNKED)
722 bytes = http_write_chunk(http, http->wbuffer, (size_t)http->wused);
723 else
724 bytes = http_write(http, http->wbuffer, (size_t)http->wused);
725
726 http->wused = 0;
727
728 DEBUG_printf(("1httpFlushWrite: Returning %d, errno=%d.", (int)bytes, errno));
729
730 return ((int)bytes);
731}
732
733
734/*

Callers 13

delete_clientFunction · 0.85
process_httpFunction · 0.85
cupsdCloseClientFunction · 0.85
cupsdSendErrorFunction · 0.85
cupsdWriteClientFunction · 0.85
httpPrintfFunction · 0.85
httpUpdateFunction · 0.85
httpWaitFunction · 0.85
httpWrite2Function · 0.85
httpWriteResponseFunction · 0.85

Calls 2

http_write_chunkFunction · 0.85
http_writeFunction · 0.85

Tested by

no test coverage detected