X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=interfaces%2Fpostgresql-socket%2Fpostgresql-socket-uffi.cl;h=1c643c668b14e0404c16802ed8c5706f88c586f1;hb=d122a92fea03b34e179ffc58d7c4f18d7e5d10c9;hp=ff39d182ade8b49365c4561cbf96afdf5a66cbe4;hpb=8213ff48f5362c3d4792444c929f50bd128bd044;p=clsql.git diff --git a/interfaces/postgresql-socket/postgresql-socket-uffi.cl b/interfaces/postgresql-socket/postgresql-socket-uffi.cl index ff39d18..1c643c6 100644 --- a/interfaces/postgresql-socket/postgresql-socket-uffi.cl +++ b/interfaces/postgresql-socket/postgresql-socket-uffi.cl @@ -9,7 +9,7 @@ ;;;; ;;;; Date Started: Feb 2002 ;;;; -;;;; $Id: postgresql-socket-uffi.cl,v 1.1 2002/03/23 14:04:54 kevin Exp $ +;;;; $Id: postgresql-socket-uffi.cl,v 1.2 2002/03/23 16:42:06 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai @@ -189,6 +189,16 @@ (int32 pid) (int32 key)) + +(defun read-socket-sequence (string stream) +"KMR -- Added to support reading from binary stream into a string" + (declare (optimize (speed 3) (safety 0))) + (dotimes (i (length string)) + (declare (fixnum i)) + (setf (char string i) (code-char (read-byte stream)))) + string) + + ;;; Support for encrypted password transmission (defconstant +crypt-library+ "/usr/lib/libcrypt.so" @@ -384,7 +394,7 @@ connection, if it is still open." (postgresql-connection-password connection))) (4 (let ((salt (make-string 2))) - (read-sequence salt socket) + (read-socket-sequence salt socket) (send-encrypted-password-message socket (crypt-password @@ -558,7 +568,7 @@ connection, if it is still open." collect (let* ((length (read-socket-value 'int32 socket)) (result (make-string (- length 4)))) - (read-sequence result socket) + (read-socket-sequence result socket) result)))) (#.+binary-row-message+ (error "NYI")) @@ -600,7 +610,7 @@ connection, if it is still open." nil (let* ((length (read-socket-value 'int32 socket)) (result (make-string (- length 4)))) - (read-sequence result socket) + (read-socket-sequence result socket) result))) (read-null-bit-vector socket (length sequence))))) (#.+binary-row-message+