aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-04-19 00:02:30 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-04-19 00:02:30 +0000
commitbd8d4417757b1f3edd9ef36897cf47fe96b6e37a (patch)
tree82da2e02e8b0b4ae5f3c19370bce7f7e74cd9136 /src/include
parent54b38d293eb8ab925b3acc7270847fcf35caf912 (diff)
downloadpostgresql-bd8d4417757b1f3edd9ef36897cf47fe96b6e37a.tar.gz
postgresql-bd8d4417757b1f3edd9ef36897cf47fe96b6e37a.zip
Second round of FE/BE protocol changes. Frontend->backend messages now
have length counts, and COPY IN data is packetized into messages.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/lib/stringinfo.h12
-rw-r--r--src/include/libpq/libpq.h16
-rw-r--r--src/include/libpq/pqcomm.h4
-rw-r--r--src/include/libpq/pqformat.h12
-rw-r--r--src/include/tcop/dest.h4
-rw-r--r--src/include/tcop/fastpath.h6
6 files changed, 38 insertions, 16 deletions
diff --git a/src/include/lib/stringinfo.h b/src/include/lib/stringinfo.h
index 051ce239a7a..c49a73c0eb1 100644
--- a/src/include/lib/stringinfo.h
+++ b/src/include/lib/stringinfo.h
@@ -10,7 +10,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: stringinfo.h,v 1.24 2002/06/20 20:29:49 momjian Exp $
+ * $Id: stringinfo.h,v 1.25 2003/04/19 00:02:29 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -27,6 +27,9 @@
* string size (including the terminating '\0' char) that we can
* currently store in 'data' without having to reallocate
* more space. We must always have maxlen > len.
+ * cursor is initialized to zero by makeStringInfo or initStringInfo,
+ * but is not otherwise touched by the stringinfo.c routines.
+ * Some routines use it to scan through a StringInfo.
*-------------------------
*/
typedef struct StringInfoData
@@ -34,6 +37,7 @@ typedef struct StringInfoData
char *data;
int len;
int maxlen;
+ int cursor;
} StringInfoData;
typedef StringInfoData *StringInfo;
@@ -111,4 +115,10 @@ extern void appendStringInfoChar(StringInfo str, char ch);
extern void appendBinaryStringInfo(StringInfo str,
const char *data, int datalen);
+/*------------------------
+ * enlargeStringInfo
+ * Make sure a StringInfo's buffer can hold at least 'needed' more bytes.
+ */
+extern void enlargeStringInfo(StringInfo str, int needed);
+
#endif /* STRINGINFO_H */
diff --git a/src/include/libpq/libpq.h b/src/include/libpq/libpq.h
index 04248b5c95c..cbe0b646e74 100644
--- a/src/include/libpq/libpq.h
+++ b/src/include/libpq/libpq.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: libpq.h,v 1.56 2003/01/25 05:19:47 tgl Exp $
+ * $Id: libpq.h,v 1.57 2003/04/19 00:02:29 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -52,14 +52,24 @@ extern void StreamClose(int sock);
extern void TouchSocketFile(void);
extern void pq_init(void);
extern int pq_getbytes(char *s, size_t len);
-extern int pq_getstring(StringInfo s, int maxlen);
+extern int pq_getstring(StringInfo s);
+extern int pq_getmessage(StringInfo s, int maxlen);
extern int pq_getbyte(void);
extern int pq_peekbyte(void);
extern int pq_putbytes(const char *s, size_t len);
extern int pq_flush(void);
-extern int pq_eof(void);
extern int pq_putmessage(char msgtype, const char *s, size_t len);
extern void pq_startcopyout(void);
extern void pq_endcopyout(bool errorAbort);
+/*
+ * prototypes for functions in be-secure.c
+ */
+extern int secure_initialize(void);
+extern void secure_destroy(void);
+extern int secure_open_server(Port *port);
+extern void secure_close(Port *port);
+extern ssize_t secure_read(Port *port, void *ptr, size_t len);
+extern ssize_t secure_write(Port *port, void *ptr, size_t len);
+
#endif /* LIBPQ_H */
diff --git a/src/include/libpq/pqcomm.h b/src/include/libpq/pqcomm.h
index fabfb0cb253..61aa695e272 100644
--- a/src/include/libpq/pqcomm.h
+++ b/src/include/libpq/pqcomm.h
@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pqcomm.h,v 1.76 2003/04/17 22:26:01 tgl Exp $
+ * $Id: pqcomm.h,v 1.77 2003/04/19 00:02:29 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -106,7 +106,7 @@ typedef union SockAddr
/* The earliest and latest frontend/backend protocol version supported. */
#define PG_PROTOCOL_EARLIEST PG_PROTOCOL(1,0)
-#define PG_PROTOCOL_LATEST PG_PROTOCOL(3,100) /* XXX temporary value */
+#define PG_PROTOCOL_LATEST PG_PROTOCOL(3,101) /* XXX temporary value */
typedef uint32 ProtocolVersion; /* FE/BE protocol version number */
diff --git a/src/include/libpq/pqformat.h b/src/include/libpq/pqformat.h
index 829727c38f0..cb80ec2c201 100644
--- a/src/include/libpq/pqformat.h
+++ b/src/include/libpq/pqformat.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pqformat.h,v 1.13 2002/09/04 23:31:35 tgl Exp $
+ * $Id: pqformat.h,v 1.14 2003/04/19 00:02:29 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -26,9 +26,11 @@ extern void pq_endmessage(StringInfo buf);
extern int pq_puttextmessage(char msgtype, const char *str);
-extern int pq_getint(int *result, int b);
-extern int pq_getstr_bounded(StringInfo s, int maxlen);
-
-#define pq_getstr(s) pq_getstr_bounded(s, 0)
+extern int pq_getmsgbyte(StringInfo msg);
+extern unsigned int pq_getmsgint(StringInfo msg, int b);
+extern const char *pq_getmsgbytes(StringInfo msg, int datalen);
+extern void pq_copymsgbytes(StringInfo msg, char *buf, int datalen);
+extern const char *pq_getmsgstring(StringInfo msg);
+extern void pq_getmsgend(StringInfo msg);
#endif /* PQFORMAT_H */
diff --git a/src/include/tcop/dest.h b/src/include/tcop/dest.h
index bbf86ef4ca6..39063af6e16 100644
--- a/src/include/tcop/dest.h
+++ b/src/include/tcop/dest.h
@@ -44,7 +44,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: dest.h,v 1.33 2003/03/27 16:51:29 momjian Exp $
+ * $Id: dest.h,v 1.34 2003/04/19 00:02:30 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -102,8 +102,6 @@ extern void EndCommand(const char *commandTag, CommandDest dest);
/* Additional functions that go with destination management, more or less. */
-extern void SendCopyBegin(void);
-extern void ReceiveCopyBegin(void);
extern void NullCommand(CommandDest dest);
extern void ReadyForQuery(CommandDest dest);
diff --git a/src/include/tcop/fastpath.h b/src/include/tcop/fastpath.h
index e9b961d8f05..9e0f5e6bbb9 100644
--- a/src/include/tcop/fastpath.h
+++ b/src/include/tcop/fastpath.h
@@ -6,13 +6,15 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: fastpath.h,v 1.13 2002/06/20 20:29:52 momjian Exp $
+ * $Id: fastpath.h,v 1.14 2003/04/19 00:02:30 tgl Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef FASTPATH_H
#define FASTPATH_H
-extern int HandleFunctionRequest(void);
+#include "lib/stringinfo.h"
+
+extern int HandleFunctionRequest(StringInfo msgBuf);
#endif /* FASTPATH_H */