MCPcopy Create free account
hub / github.com/apache/cloudberry / pqPutMsgEnd

Function pqPutMsgEnd

src/interfaces/libpq/fe-misc.c:589–604  ·  view source on GitHub ↗

* pqPutMsgEnd: finish constructing a message and possibly send it * * Returns 0 on success, EOF on error * * We don't actually send anything here unless we've accumulated at least * 8K worth of data (the typical size of a pipe buffer on Unix systems). * This avoids sending small partial packets. The caller must use pqFlush * when it's important to flush all the data out to the server. */

Source from the content-addressed store, hash-verified

587 * when it's important to flush all the data out to the server.
588 */
589int
590pqPutMsgEnd(PGconn *conn)
591{
592 pqPutMsgEndNoAutoFlush(conn);
593
594 if (conn->outCount >= 8192)
595 {
596 int toSend = conn->outCount - (conn->outCount % 8192);
597
598 if (pqSendSome(conn, toSend) < 0)
599 return EOF;
600 /* in nonblock mode, don't complain if unable to send it all */
601 }
602
603 return 0;
604}
605
606/* ----------
607 * pqReadData: read more data, if any is available

Callers 14

send_sequence_responseFunction · 0.85
pg_SASL_initFunction · 0.85
sendTerminateConnFunction · 0.85
pqPacketSendFunction · 0.85
pqEndcopy3Function · 0.85
pqFunctionCall3Function · 0.85
PQsendQueryInternalFunction · 0.85
PQsendPrepareFunction · 0.85
PQsendQueryGutsFunction · 0.85
PQsendDescribeFunction · 0.85
PQputCopyDataFunction · 0.85
PQputCopyEndFunction · 0.85

Calls 2

pqPutMsgEndNoAutoFlushFunction · 0.85
pqSendSomeFunction · 0.85

Tested by

no test coverage detected