From: Kevin M. Rosenberg Date: Sat, 23 Mar 2002 16:42:06 +0000 (+0000) Subject: r1646: *** empty log message *** X-Git-Tag: v3.8.6~1228 X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=d122a92fea03b34e179ffc58d7c4f18d7e5d10c9 r1646: *** empty log message *** --- diff --git a/TODO b/TODO index 7d323af..139597f 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,2 @@ -Fix postgresql-socket on Lispworks and CMUCL so that the -socket stream uses a consistent element-type. 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+