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

Function httpUpdate

cups/http.c:2975–3031  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2973 */
2974
2975http_status_t /* O - HTTP status */
2976httpUpdate(http_t *http) /* I - HTTP connection */
2977{
2978 http_status_t status; /* Request status */
2979
2980
2981 DEBUG_printf(("httpUpdate(http=%p), state=%s", (void *)http, httpStateString(http->state)));
2982
2983 /*
2984 * Flush pending data, if any...
2985 */
2986
2987 if (http->wused)
2988 {
2989 DEBUG_puts("2httpUpdate: flushing buffer...");
2990
2991 if (httpFlushWrite(http) < 0)
2992 return (HTTP_STATUS_ERROR);
2993 }
2994
2995 /*
2996 * If we haven't issued any commands, then there is nothing to "update"...
2997 */
2998
2999 if (http->state == HTTP_STATE_WAITING)
3000 return (HTTP_STATUS_CONTINUE);
3001
3002 /*
3003 * Grab all of the lines we can from the connection...
3004 */
3005
3006 while (_httpUpdate(http, &status));
3007
3008 /*
3009 * See if there was an error...
3010 */
3011
3012 if (http->error == EPIPE && http->status > HTTP_STATUS_CONTINUE)
3013 {
3014 DEBUG_printf(("1httpUpdate: Returning status %d...", http->status));
3015 return (http->status);
3016 }
3017
3018 if (http->error)
3019 {
3020 DEBUG_printf(("1httpUpdate: socket error %d - %s", http->error,
3021 strerror(http->error)));
3022 http->status = HTTP_STATUS_ERROR;
3023 return (HTTP_STATUS_ERROR);
3024 }
3025
3026 /*
3027 * Return the current status...
3028 */
3029
3030 return (status);
3031}
3032

Callers 13

list_serviceFunction · 0.85
finish_document_uriFunction · 0.85
process_httpFunction · 0.85
cupsdReadClientFunction · 0.85
do_am_printerFunction · 0.85
cupsGetFdFunction · 0.85
cupsPutFdFunction · 0.85
mainFunction · 0.85
http_tls_upgradeFunction · 0.85
cupsGetDevicesFunction · 0.85
cupsGetResponseFunction · 0.85
cupsSendRequestFunction · 0.85

Calls 3

httpStateStringFunction · 0.85
httpFlushWriteFunction · 0.85
_httpUpdateFunction · 0.85

Tested by 1

mainFunction · 0.68