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

Function pqPacketSend

src/interfaces/libpq/fe-connect.c:4814–4835  ·  view source on GitHub ↗

* pqPacketSend() -- convenience routine to send a message to server. * * pack_type: the single-byte message type code. (Pass zero for startup * packets, which have no message type code.) * * buf, buf_len: contents of message. The given length includes only what * is in buf; the message type and message length fields are added here. * * RETURNS: STATUS_ERROR if the write fails, STATUS_OK

Source from the content-addressed store, hash-verified

4812 * SIDE_EFFECTS: may block.
4813 */
4814int
4815pqPacketSend(PGconn *conn, char pack_type,
4816 const void *buf, size_t buf_len)
4817{
4818 /* Start the message. */
4819 if (pqPutMsgStart(pack_type, conn))
4820 return STATUS_ERROR;
4821
4822 /* Send the message body. */
4823 if (pqPutnchar(buf, buf_len, conn))
4824 return STATUS_ERROR;
4825
4826 /* Finish the message. */
4827 if (pqPutMsgEnd(conn))
4828 return STATUS_ERROR;
4829
4830 /* Flush to ensure backend gets it. */
4831 if (pqFlush(conn))
4832 return STATUS_ERROR;
4833
4834 return STATUS_OK;
4835}
4836
4837#ifdef USE_LDAP
4838

Callers 5

pg_GSS_continueFunction · 0.85
pg_SSPI_continueFunction · 0.85
pg_SASL_continueFunction · 0.85
pg_password_sendauthFunction · 0.85
PQconnectPollFunction · 0.85

Calls 4

pqPutMsgStartFunction · 0.85
pqPutncharFunction · 0.85
pqPutMsgEndFunction · 0.85
pqFlushFunction · 0.85

Tested by

no test coverage detected