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

Function httpClearFields

cups/http.c:301–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299 */
300
301void
302httpClearFields(http_t *http) /* I - HTTP connection */
303{
304 http_field_t field; /* Current field */
305
306
307 DEBUG_printf(("httpClearFields(http=%p)", (void *)http));
308
309 if (http)
310 {
311 memset(http->_fields, 0, sizeof(http->_fields));
312
313 for (field = HTTP_FIELD_ACCEPT_LANGUAGE; field < HTTP_FIELD_ACCEPT_ENCODING; field ++)
314 {
315 if (!http->fields[field])
316 continue;
317
318 if (http->fields[field] != http->_fields[field])
319 free(http->fields[field]);
320
321 http->fields[field] = NULL;
322 }
323
324 for (; field < HTTP_FIELD_MAX; field ++)
325 {
326 if (!http->fields[field])
327 continue;
328
329 free(http->fields[field]);
330 http->fields[field] = NULL;
331 }
332
333 if (http->mode == _HTTP_MODE_CLIENT)
334 {
335 if (http->hostname[0] == '/')
336 httpSetField(http, HTTP_FIELD_HOST, "localhost");
337 else
338 httpSetField(http, HTTP_FIELD_HOST, http->hostname);
339 }
340
341 http->expect = (http_status_t)0;
342 }
343}
344
345
346/*

Callers 15

finish_document_uriFunction · 0.85
respond_httpFunction · 0.85
cupsdReadClientFunction · 0.85
cupsdSendCommandFunction · 0.85
cupsdSendErrorFunction · 0.85
check_start_tlsFunction · 0.85
write_fileFunction · 0.85
send_responseFunction · 0.85
cupsGetFdFunction · 0.85
cupsPutFdFunction · 0.85
get_cupsd_confFunction · 0.85
mainFunction · 0.85

Calls 1

httpSetFieldFunction · 0.85

Tested by 1

mainFunction · 0.68