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

Function httpClose

cups/http.c:350–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348 */
349
350void
351httpClose(http_t *http) /* I - HTTP connection */
352{
353 http_field_t field; /* Current field */
354#ifdef HAVE_GSSAPI
355 OM_uint32 minor_status; /* Minor status code */
356#endif /* HAVE_GSSAPI */
357
358
359 DEBUG_printf(("httpClose(http=%p)", (void *)http));
360
361 /*
362 * Range check input...
363 */
364
365 if (!http)
366 return;
367
368 /*
369 * Close any open connection...
370 */
371
372 _httpDisconnect(http);
373
374 /*
375 * Free memory used...
376 */
377
378 httpAddrFreeList(http->addrlist);
379
380 if (http->cookie)
381 free(http->cookie);
382
383#ifdef HAVE_GSSAPI
384 if (http->gssctx != GSS_C_NO_CONTEXT)
385 gss_delete_sec_context(&minor_status, &http->gssctx, GSS_C_NO_BUFFER);
386
387 if (http->gssname != GSS_C_NO_NAME)
388 gss_release_name(&minor_status, &http->gssname);
389#endif /* HAVE_GSSAPI */
390
391#ifdef HAVE_AUTHORIZATION_H
392 if (http->auth_ref)
393 AuthorizationFree(http->auth_ref, kAuthorizationFlagDefaults);
394#endif /* HAVE_AUTHORIZATION_H */
395
396 for (field = HTTP_FIELD_ACCEPT_LANGUAGE; field < HTTP_FIELD_MAX; field ++)
397 {
398 free(http->default_fields[field]);
399 if (field >= HTTP_FIELD_ACCEPT_ENCODING || http->fields[field] != http->_fields[field])
400 free(http->fields[field]);
401 }
402
403 if (http->authstring && http->authstring != http->_authstring)
404 free(http->authstring);
405
406 free(http);
407}

Callers 15

list_serviceFunction · 0.85
do_monitor_printer_stateFunction · 0.85
do_testsFunction · 0.85
delete_clientFunction · 0.85
finish_document_uriFunction · 0.85
mainFunction · 0.85
cupsdAcceptClientFunction · 0.85
cupsdCloseClientFunction · 0.85
get_job_fileFunction · 0.85
do_testFunction · 0.85
create_local_bg_threadFunction · 0.85
recv_print_jobFunction · 0.85

Calls 2

_httpDisconnectFunction · 0.85
httpAddrFreeListFunction · 0.85

Tested by 6

mainFunction · 0.68
do_testFunction · 0.68
mainFunction · 0.68
monitor_printerFunction · 0.68
run_clientFunction · 0.68
mainFunction · 0.68