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

Function cupsSideChannelDoRequest

cups/sidechannel.c:55–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 */
54
55cups_sc_status_t /* O - Status of command */
56cupsSideChannelDoRequest(
57 cups_sc_command_t command, /* I - Command to send */
58 char *data, /* O - Response data buffer pointer */
59 int *datalen, /* IO - Size of data buffer on entry, number of bytes in buffer on return */
60 double timeout) /* I - Timeout in seconds */
61{
62 cups_sc_status_t status; /* Status of command */
63 cups_sc_command_t rcommand; /* Response command */
64
65
66 if (cupsSideChannelWrite(command, CUPS_SC_STATUS_NONE, NULL, 0, timeout))
67 return (CUPS_SC_STATUS_TIMEOUT);
68
69 if (cupsSideChannelRead(&rcommand, &status, data, datalen, timeout))
70 return (CUPS_SC_STATUS_TIMEOUT);
71
72 if (rcommand != command)
73 return (CUPS_SC_STATUS_BAD_MESSAGE);
74
75 return (status);
76}
77
78
79/*

Callers 2

mainFunction · 0.85
auto_configureFunction · 0.85

Calls 2

cupsSideChannelWriteFunction · 0.85
cupsSideChannelReadFunction · 0.85

Tested by 1

mainFunction · 0.68