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

Function httpConnect2

cups/http.c:457–495  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455 */
456
457http_t * /* O - New HTTP connection */
458httpConnect2(
459 const char *host, /* I - Host to connect to */
460 int port, /* I - Port number */
461 http_addrlist_t *addrlist, /* I - List of addresses or @code NULL@ to lookup */
462 int family, /* I - Address family to use or @code AF_UNSPEC@ for any */
463 http_encryption_t encryption, /* I - Type of encryption to use */
464 int blocking, /* I - 1 for blocking connection, 0 for non-blocking */
465 int msec, /* I - Connection timeout in milliseconds, 0 means don't connect */
466 int *cancel) /* I - Pointer to "cancel" variable */
467{
468 http_t *http; /* New HTTP connection */
469
470
471 DEBUG_printf(("httpConnect2(host=\"%s\", port=%d, addrlist=%p, family=%d, encryption=%d, blocking=%d, msec=%d, cancel=%p)", host, port, (void *)addrlist, family, encryption, blocking, msec, (void *)cancel));
472
473 /*
474 * Create the HTTP structure...
475 */
476
477 if ((http = http_create(host, port, addrlist, family, encryption, blocking,
478 _HTTP_MODE_CLIENT)) == NULL)
479 return (NULL);
480
481 /*
482 * Optionally connect to the remote system...
483 */
484
485 if (msec == 0 || !httpReconnect2(http, msec, cancel))
486 return (http);
487
488 /*
489 * Could not connect to any known address - bail out!
490 */
491
492 httpClose(http);
493
494 return (NULL);
495}
496
497
498/*

Callers 15

list_serviceFunction · 0.85
do_monitor_printer_stateFunction · 0.85
do_testsFunction · 0.85
finish_document_uriFunction · 0.85
create_local_bg_threadFunction · 0.85
recv_print_jobFunction · 0.85
remove_jobsFunction · 0.85
send_stateFunction · 0.85
mainFunction · 0.85
monitor_printerFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 3

http_createFunction · 0.85
httpReconnect2Function · 0.85
httpCloseFunction · 0.85

Tested by 6

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