1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-29 10:41:53 +03:00

Repair libpq to follow protocol by not sending Terminate messages before

the startup exchange is complete.  Also make sure that packets defined as
single bytes aren't sent with a trailing '\0'.
This commit is contained in:
Peter Eisentraut
2001-07-06 17:58:53 +00:00
parent 9981b0f9ef
commit e77aaade34
4 changed files with 38 additions and 16 deletions

View File

@ -25,7 +25,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.49 2001/05/28 15:29:51 tgl Exp $
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.50 2001/07/06 17:58:53 petere Exp $
*
*-------------------------------------------------------------------------
*/
@ -59,6 +59,8 @@
#define DONOTICE(conn,message) \
((*(conn)->noticeHook) ((conn)->noticeArg, (message)))
static int pqPutBytes(const char *s, size_t nbytes, PGconn *conn);
/* --------------------------------------------------------------------- */
/* pqGetc:
@ -83,6 +85,22 @@ pqGetc(char *result, PGconn *conn)
}
/*
* write 1 char to the connection
*/
int
pqPutc(char c, PGconn *conn)
{
if (pqPutBytes(&c, 1, conn) == EOF)
return EOF;
if (conn->Pfdebug)
fprintf(conn->Pfdebug, "To backend> %c\n", c);
return 0;
}
/* --------------------------------------------------------------------- */
/* pqPutBytes: local routine to write N bytes to the connection,
with buffering