X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=db-postgresql-socket%2Fpostgresql-socket-api.lisp;h=ba0cd221bbdc547c920d174bb023c22cdea58b3e;hb=1b0f85909248ac92d13f4af72d69ef68ffeb890c;hp=69496c27b33369622dd9c893515a4f88f2c84334;hpb=1dda729b250779079efbdc1d3f6bbb3ae4a20ba4;p=clsql.git diff --git a/db-postgresql-socket/postgresql-socket-api.lisp b/db-postgresql-socket/postgresql-socket-api.lisp index 69496c2..ba0cd22 100644 --- a/db-postgresql-socket/postgresql-socket-api.lisp +++ b/db-postgresql-socket/postgresql-socket-api.lisp @@ -27,13 +27,13 @@ (:float4 700) (:float8 701))) -(defmethod clsql-base:database-type-library-loaded ((database-type +(defmethod clsql-sys:database-type-library-loaded ((database-type (eql :postgresql-socket))) "T if foreign library was able to be loaded successfully. Always true for socket interface" t) -(defmethod clsql-base:database-type-load-foreign ((database-type (eql :postgresql-socket))) +(defmethod clsql-sys:database-type-load-foreign ((database-type (eql :postgresql-socket))) t) @@ -214,19 +214,20 @@ socket interface" ;;; Support for encrypted password transmission #-scl -(eval-when (compile eval load) +(eval-when (:compile-toplevel :load-toplevel :execute) (defvar *crypt-library-loaded* nil) (unless *crypt-library-loaded* (uffi:load-foreign-library (uffi:find-foreign-library "libcrypt" - '("/usr/lib/" "/usr/local/lib/" "/lib/")) + '(#+64bit "/usr/lib64/" + "/usr/lib/" "/usr/local/lib/" "/lib/")) :supporting-libraries '("c")) (setq *crypt-library-loaded* t))) (in-package :postgresql-socket) -(uffi:def-function "crypt" +(uffi:def-function ("crypt" crypt) ((key :cstring) (salt :cstring)) :returning :cstring) @@ -457,14 +458,16 @@ connection, if it is still open." (3 (send-unencrypted-password-message socket - (postgresql-connection-password connection))) + (postgresql-connection-password connection)) + (force-output socket)) (4 (let ((salt (make-string 2))) (read-socket-sequence salt socket) (send-encrypted-password-message socket (crypt-password - (postgresql-connection-password connection) salt)))) + (postgresql-connection-password connection) salt))) + (force-output socket)) (5 (let ((salt (make-string 4))) (read-socket-sequence salt socket) @@ -473,7 +476,8 @@ connection, if it is still open." (pwd (encrypt-md5 pwd2 salt))) (send-encrypted-password-message socket - (concatenate 'string "md5" pwd))))) + (concatenate 'string "md5" pwd)))) + (force-output socket)) (t (error 'postgresql-login-error :connection connection @@ -600,7 +604,7 @@ connection, if it is still open." :connection connection :message message)))) (#.+notice-response-message+ (let ((message (read-socket-value-string socket))) - (unless (eq :ignore clsql-base:*backend-warning-behavior*) + (unless (eq :ignore clsql-sys:*backend-warning-behavior*) (warn 'postgresql-warning :connection connection :message message)))) (#.+notification-response-message+