diff options
| author | Tom Lane | 2003-04-22 00:08:07 +0000 |
|---|---|---|
| committer | Tom Lane | 2003-04-22 00:08:07 +0000 |
| commit | 5ed27e35f35f6c354b1a7120ec3a3ce57f93e73e (patch) | |
| tree | 9ed912fbf02c36160a88881764735f8eab6103b9 /src/backend/postmaster | |
| parent | ca944bd2d41814712cb4a4810ab4aa490f23a853 (diff) | |
Another round of protocol changes. Backend-to-frontend messages now all
have length words. COPY OUT reimplemented per new protocol: it doesn't
need \. anymore, thank goodness. COPY BINARY to/from frontend works,
at least as far as the backend is concerned --- libpq's PQgetline API
is not up to snuff, and will have to be replaced with something that is
null-safe. libpq uses message length words for performance improvement
(no cycles wasted rescanning long messages), but not yet for error
recovery.
Diffstat (limited to 'src/backend/postmaster')
| -rw-r--r-- | src/backend/postmaster/postmaster.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index d6beb0fc1a6..834b03ab628 100644 --- a/src/backend/postmaster/postmaster.c +++ b/src/backend/postmaster/postmaster.c @@ -37,7 +37,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.313 2003/04/19 00:02:29 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.314 2003/04/22 00:08:06 tgl Exp $ * * NOTES * @@ -1118,7 +1118,13 @@ ProcessStartupPacket(Port *port, bool SSLdone) if (pq_getbytes((char *) &len, 4) == EOF) { - elog(COMMERROR, "incomplete startup packet"); + /* + * EOF after SSLdone probably means the client didn't like our + * response to NEGOTIATE_SSL_CODE. That's not an error condition, + * so don't clutter the log with a complaint. + */ + if (!SSLdone) + elog(COMMERROR, "incomplete startup packet"); return STATUS_ERROR; } @@ -1127,7 +1133,10 @@ ProcessStartupPacket(Port *port, bool SSLdone) if (len < (int32) sizeof(ProtocolVersion) || len > MAX_STARTUP_PACKET_LENGTH) - elog(FATAL, "invalid length of startup packet"); + { + elog(COMMERROR, "invalid length of startup packet"); + return STATUS_ERROR; + } /* * Allocate at least the size of an old-style startup packet, plus one @@ -1173,7 +1182,7 @@ ProcessStartupPacket(Port *port, bool SSLdone) #endif if (send(port->sock, &SSLok, 1, 0) != 1) { - elog(LOG, "failed to send SSL negotiation response: %m"); + elog(COMMERROR, "failed to send SSL negotiation response: %m"); return STATUS_ERROR; /* close the connection */ } @@ -1188,6 +1197,11 @@ ProcessStartupPacket(Port *port, bool SSLdone) /* Could add additional special packet types here */ + /* + * Set FrontendProtocol now so that elog() knows what format to send + * if we fail during startup. + */ + FrontendProtocol = proto; /* * XXX temporary for 3.0 protocol development: we are using the minor |
