|
|
|
@ -215,22 +215,8 @@
|
|
|
|
|
(when (and (enable-session) (session-valid? (sid)))
|
|
|
|
|
(session-refresh! (sid))))
|
|
|
|
|
|
|
|
|
|
(use z3)
|
|
|
|
|
(define z (z3:encode-init))
|
|
|
|
|
(define b "")
|
|
|
|
|
(z3:encode z (lambda (s) (display s)) (with-input-from-file "news.scm"
|
|
|
|
|
(lambda () (substring (read-string) 640))))
|
|
|
|
|
(z3:encode z (lambda (s) (set! b s)) "hi, how are you?")
|
|
|
|
|
|
|
|
|
|
(z3:encode-buffer "hi, how are you?")
|
|
|
|
|
(get-output-string dest)
|
|
|
|
|
(z3:decode-buffer "ËÈÔQÈÈ/WH,JU¨Ì/µ\a\x00")
|
|
|
|
|
(z3:decode-buffer (z3:encode-buffer "hi, how are you?"))
|
|
|
|
|
|
|
|
|
|
(define (make-chunked-port output-port #!key (buffer-size 4094))
|
|
|
|
|
(let ((buffer (make-string buffer-size))
|
|
|
|
|
(output (make-string buffer-size))
|
|
|
|
|
(z3-handle (z3:init buffer: buffer buffer-size: buffer-size))
|
|
|
|
|
(pos 0))
|
|
|
|
|
(define (flush)
|
|
|
|
|
(fprintf output-port "~X" pos)
|
|
|
|
@ -239,7 +225,8 @@
|
|
|
|
|
(display buffer output-port)
|
|
|
|
|
(display (substring buffer 0 pos) output-port))
|
|
|
|
|
(display "\n" output-port)
|
|
|
|
|
(flush-output output-port))
|
|
|
|
|
(flush-output output-port)
|
|
|
|
|
(set! pos 0))
|
|
|
|
|
(make-output-port
|
|
|
|
|
(lambda (s)
|
|
|
|
|
(let ((len (##core#inline "C_block_size" s)))
|
|
|
|
@ -247,11 +234,6 @@
|
|
|
|
|
(if (fx>= (fx+ len pos) buffer-size)
|
|
|
|
|
(begin (##core#inline "C_substring_copy" s buffer s-pos
|
|
|
|
|
(fx+ (fx- buffer-size pos) s-pos) pos)
|
|
|
|
|
(let ((len-written (z3:encode z3-handle
|
|
|
|
|
(lambda (s)
|
|
|
|
|
(set! output
|
|
|
|
|
(string-append output s))) s)))
|
|
|
|
|
)
|
|
|
|
|
(set! len (fx- len (fx- buffer-size pos)))
|
|
|
|
|
(set! s-pos (fx+ s-pos (fx- buffer-size pos)))
|
|
|
|
|
(set! pos buffer-size)
|
|
|
|
|