[nio-cvs] r93 - in branches/home/psmith/restructure/src: io protocol/yarpc

psmith at common-lisp.net psmith at common-lisp.net
Wed Feb 21 06:38:58 UTC 2007


Author: psmith
Date: Wed Feb 21 01:38:56 2007
New Revision: 93

Modified:
   branches/home/psmith/restructure/src/io/async-fd.lisp
   branches/home/psmith/restructure/src/protocol/yarpc/nio-yarpc-package.lisp
   branches/home/psmith/restructure/src/protocol/yarpc/yarpc-packet-factory.lisp
   branches/home/psmith/restructure/src/protocol/yarpc/yarpc-state-machine.lisp
Log:
Eval whole string on rpc, allow user defined writer, increase default buffer size

Modified: branches/home/psmith/restructure/src/io/async-fd.lisp
==============================================================================
--- branches/home/psmith/restructure/src/io/async-fd.lisp	(original)
+++ branches/home/psmith/restructure/src/io/async-fd.lisp	Wed Feb 21 01:38:56 2007
@@ -33,9 +33,9 @@
   	     :accessor write-fd)
    (read-fd :initarg :read-fd
             :accessor read-fd)
-   (foreign-read-buffer :initform (byte-buffer 1024)
+   (foreign-read-buffer :initform (byte-buffer 2096)
                         :accessor foreign-read-buffer)
-   (foreign-write-buffer :initform (byte-buffer 1024)
+   (foreign-write-buffer :initform (byte-buffer 2096)
 			 :accessor foreign-write-buffer)
    (read-ready :initform nil
 	         :accessor read-ready

Modified: branches/home/psmith/restructure/src/protocol/yarpc/nio-yarpc-package.lisp
==============================================================================
--- branches/home/psmith/restructure/src/protocol/yarpc/nio-yarpc-package.lisp	(original)
+++ branches/home/psmith/restructure/src/protocol/yarpc/nio-yarpc-package.lisp	Wed Feb 21 01:38:56 2007
@@ -32,7 +32,7 @@
              yarpc-state-machine-factory get-packet-factory 
 
 	     ;; yarpc-state-machine
-	     yarpc-state-machine job-queue run-job +process-jobs-inline+
+	     yarpc-state-machine job-queue run-job +process-jobs-inline+ +serialise-packet-fn+
 	     ;to be moved
 	     test-rpc test-rpc-list test-rpc-string execute-call defremote
 	     

Modified: branches/home/psmith/restructure/src/protocol/yarpc/yarpc-packet-factory.lisp
==============================================================================
--- branches/home/psmith/restructure/src/protocol/yarpc/yarpc-packet-factory.lisp	(original)
+++ branches/home/psmith/restructure/src/protocol/yarpc/yarpc-packet-factory.lisp	Wed Feb 21 01:38:56 2007
@@ -115,6 +115,8 @@
 (defmethod print-object ((packet method-response-packet) stream)
   (format stream "#<METHID-RESPONSE-PACKET ~A >" (response packet)))
 
+(defparameter +serialise-packet-fn+ #'(lambda (result)(write-to-string result)))
+
 (defmethod write-bytes((packet method-response-packet) buf)
 #+nio-debug    (format-log t "yarpc-packet-factory:write-bytes - writing ~A to ~A~%" packet buf)
   (nio-buffer:mark buf)
@@ -123,7 +125,7 @@
 	(nio-buffer:bytebuffer-write-8 buf +METHOD-RESPONSE-PACKET-ID+)
 	(nio-buffer:bytebuffer-write-32 buf 0) ; come back and write length later
 	(nio-buffer:bytebuffer-write-32 buf (request-id packet))
-	(nio-buffer:bytebuffer-write-string buf (write-to-string (response packet)))
+	(nio-buffer:bytebuffer-write-string buf (funcall +serialise-packet-fn+ (response packet)))
 	(nio-buffer:bytebuffer-insert-32 buf (buffer-position buf) 1)
 #+nio-debug    (format-log t "yarpc-packet-factory:write-bytes - written ~A~%" buf)  
         )

Modified: branches/home/psmith/restructure/src/protocol/yarpc/yarpc-state-machine.lisp
==============================================================================
--- branches/home/psmith/restructure/src/protocol/yarpc/yarpc-state-machine.lisp	(original)
+++ branches/home/psmith/restructure/src/protocol/yarpc/yarpc-state-machine.lisp	Wed Feb 21 01:38:56 2007
@@ -109,7 +109,7 @@
 	     (fn (member (symbol-function (first rpc-call-list)) *remote-fns* )))
 #+nio-debug	(format-log t "yarpc-state-machine:execute-call - fn ~A authorised? : ~A~%" (symbol-function (first rpc-call-list)) fn)
 	(if fn
-	    (apply (first rpc-call-list) (rest rpc-call-list))
+	    (eval rpc-call-list)
 	    (error 'authorization-error)))
     (reader-error (re) (format-log t "yarpc-state-machine:execute-call - reader error on call-string ~A ~%" re))))
 



More information about the Nio-cvs mailing list