X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=db-postgresql-socket%2Fpostgresql-socket-api.lisp;h=4546d095ad23f0a95b2cc197ba13a5c05c96a2f4;hb=89ff7b55c083fa1095be19d7388d3c490bfc90c5;hp=a6cc666c0805358bb098137f79785b3e8f71ecee;hpb=f1ff5842ce264fbe47e8ef98e33e4aca3b71d863;p=clsql.git diff --git a/db-postgresql-socket/postgresql-socket-api.lisp b/db-postgresql-socket/postgresql-socket-api.lisp index a6cc666..4546d09 100644 --- a/db-postgresql-socket/postgresql-socket-api.lisp +++ b/db-postgresql-socket/postgresql-socket-api.lisp @@ -220,7 +220,7 @@ socket interface" (unless *crypt-library-loaded* (uffi:load-foreign-library (uffi:find-foreign-library "libcrypt" - '(#+64bit "/usr/lib64/" + '(#+(or 64bit x86-64) "/usr/lib64/" "/usr/lib/" "/usr/local/lib/" "/lib/")) :supporting-libraries '("c")) (setq *crypt-library-loaded* t))) @@ -426,7 +426,7 @@ troubles." (defun encrypt-md5 (plaintext salt) (string-downcase (format nil "~{~2,'0X~}" - (coerce (md5:md5sum-sequence (concatenate 'string plaintext salt)) 'list)))) + (coerce (md5sum-sequence (concatenate 'string plaintext salt)) 'list)))) (defun reopen-postgresql-connection (connection) "Reopen the given PostgreSQL connection. Closes any existing @@ -458,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) @@ -474,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 @@ -539,6 +542,7 @@ connection, if it is still open." while (listen socket) do (case (read-socket-value-int8 socket) + (#.+ready-for-query-message+) (#.+notice-response-message+ (let ((message (read-socket-value-string socket))) (warn 'postgresql-warning :connection connection