Improve connection error message in case of invalid protocol characters.
authorHiroshi Inoue <inoue@tpf.co.jp>
Wed, 30 Aug 2006 11:54:42 +0000 (11:54 +0000)
committerHiroshi Inoue <inoue@tpf.co.jp>
Wed, 30 Aug 2006 11:54:42 +0000 (11:54 +0000)
connection.c
info.c
version.h

index 32ce3d0a46535ed9d86c0be236a6d688a5542f31..7c3cc2ad6bfe209ce9fdf0aac16acbea8546de0d 100644 (file)
@@ -1355,13 +1355,13 @@ inolog("protocol=%s version=%d,%d\n", ci->protocol, self->pg_version_major, self
                beresp = 'R';
            else
            {
-               beresp = SOCK_get_char(sock);
+               beresp = SOCK_get_id(sock);
                mylog("auth got '%c'\n", beresp);
                if (PROTOCOL_74(ci))
                {
                    if (beresp != 'E' || startPacketReceived)
                    {
-                       leng = SOCK_get_int(sock, 4);
+                       leng = SOCK_get_response_length(sock);
 inolog("leng=%d\n", leng);
                    }
                    else
@@ -1493,7 +1493,8 @@ inolog("Ekita\n");
                    handle_notice_message(self, notice, sizeof(notice), self->sqlstate, "CC_connect", NULL);
                    break;
                default:
-                   CC_set_error(self, CONN_INVALID_AUTHENTICATION, "Unexpected protocol character during authentication", func);
+                   snprintf(notice, sizeof(notice), "Unexpected protocol character='%c' during authentication", beresp);
+                   CC_set_error(self, CONN_INVALID_AUTHENTICATION, notice, func);
                    return 0;
            }
 
diff --git a/info.c b/info.c
index e2438b548b03a3816e7a0c18573ea08f4e148d00..1735f8555b67c25dd69a1f5c723b2f381f2cdff6 100644 (file)
--- a/info.c
+++ b/info.c
@@ -218,7 +218,7 @@ mylog("CONVERT_FUNCTIONS=%x\n", value);
             *
             * p = CC_get_database(conn);
             */
-           p = NULL_CATALOG_NAME;
+           p = CurrCatString(conn);
            break;
 
        case SQL_DBMS_NAME:     /* ODBC 1.0 */
index b462d48426e3f5fdb81efa317cc3053250108c29..36066b7f2fd363f3b75e62cfabb8914995157d13 100644 (file)
--- a/version.h
+++ b/version.h
@@ -11,6 +11,6 @@
 
 #define POSTGRESDRIVERVERSION      "08.02.0007"
 #define POSTGRES_RESOURCE_VERSION  "08.02.0007\0"
-#define PG_DRVFILE_VERSION     8,2,0,07  
+#define PG_DRVFILE_VERSION     8,2,0,07
 
 #endif