guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-13-126-g8


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-13-126-g8556760
Date: Fri, 03 Dec 2010 18:56:44 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=8556760c234b75e1faba956ba7b3b44175783459

The branch, master has been updated
       via  8556760c234b75e1faba956ba7b3b44175783459 (commit)
       via  80993fa4381c1c6ee152872b016bb9b7e0e4f324 (commit)
       via  35b97af9d671e6333ffa2740a93fedd41674a519 (commit)
      from  e6ae317306bb88528c1856ef8f39443376551c24 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8556760c234b75e1faba956ba7b3b44175783459
Author: Andy Wingo <address@hidden>
Date:   Fri Dec 3 18:03:51 2010 +0100

    read-delimited is clearer and conses less
    
    * module/ice-9/rdelim.scm (read-delimited): Clarify and somewhat
      optimize implementation.

commit 80993fa4381c1c6ee152872b016bb9b7e0e4f324
Author: Andy Wingo <address@hidden>
Date:   Fri Dec 3 17:37:22 2010 +0100

    http server impl reads body as a bytevector by default
    
    * module/web/server/http.scm (http-read): Read body as a bytevector by
      default. That way we punt encoding issues to the app.

commit 35b97af9d671e6333ffa2740a93fedd41674a519
Author: Andy Wingo <address@hidden>
Date:   Fri Dec 3 16:41:46 2010 +0100

    remove redundant error-handling block
    
    * module/web/server/http.scm (http-read): No need for a
      call-with-error-handling block here, as the read impl is itself within
      an error-handling block.

-----------------------------------------------------------------------

Summary of changes:
 module/ice-9/rdelim.scm    |   54 ++++++++++++++++++-------------------------
 module/web/server/http.scm |   23 +++++-------------
 2 files changed, 30 insertions(+), 47 deletions(-)

diff --git a/module/ice-9/rdelim.scm b/module/ice-9/rdelim.scm
index 548ba70..c6ab2ba 100644
--- a/module/ice-9/rdelim.scm
+++ b/module/ice-9/rdelim.scm
@@ -89,38 +89,30 @@
                                  port))
            (terminator (car rv))
            (nchars (cdr rv))
-           (join-substrings
-            (lambda ()
-              (apply string-append
-                     (reverse
-                      (cons (if (and (eq? handle-delim 'concat)
-                                     (not (eof-object? terminator)))
-                                (string terminator)
-                                "")
-                            (cons (substring buf 0 nchars)
-                                  substrings))))))
            (new-total (+ total-chars nchars)))
-      (cond ((not terminator)
-             ;; buffer filled.
-             (loop (cons (substring buf 0 nchars) substrings)
-                   new-total
-                   (* buf-size 2)))
-            ((eof-object? terminator)
-             (if (zero? new-total)
-                 (if (eq? handle-delim 'split)
-                     (cons terminator terminator)
-                     terminator)
-                 (if (eq? handle-delim 'split)
-                     (cons (join-substrings) terminator)
-                     (join-substrings))))
-            (else
-             (case handle-delim
-               ((trim peek concat) (join-substrings))
-               ((split) (cons (join-substrings) terminator))
-
-
-               (else (error "unexpected handle-delim value: "
-                            handle-delim))))))))
+      (cond
+       ((not terminator)
+        ;; buffer filled.
+        (loop (cons (substring buf 0 nchars) substrings)
+              new-total
+              (* buf-size 2)))
+       ((and (eof-object? terminator) (zero? new-total))
+        (if (eq? handle-delim 'split)
+            (cons terminator terminator)
+            terminator))
+       (else
+        (let ((joined
+               (string-concatenate-reverse
+                (cons (substring buf 0 nchars) substrings))))
+          (case handle-delim
+            ((concat)
+             (if (eof-object? terminator)
+                 joined
+                 (string-append joined (string terminator))))
+            ((trim peek) joined)
+            ((split) (cons joined terminator))
+            (else (error "unexpected handle-delim value: "
+                         handle-delim)))))))))
 
 ;;; read-line [PORT [HANDLE-DELIM]] reads a newline-terminated string
 ;;; from PORT.  The return value depends on the value of HANDLE-DELIM,
diff --git a/module/web/server/http.scm b/module/web/server/http.scm
index 7d63a70..46dcbb2 100644
--- a/module/web/server/http.scm
+++ b/module/web/server/http.scm
@@ -26,8 +26,7 @@
   #:use-module (web request)
   #:use-module (web response)
   #:use-module (web server)
-  #:use-module (ice-9 poll)
-  #:use-module (system repl error-handling))
+  #:use-module (ice-9 poll))
 
 
 (define (make-default-socket family addr port)
@@ -106,20 +105,12 @@
               ;; Otherwise, try to read a request from this port.
               ;; Record the next index.
               (set-http-poll-idx! server (1- idx))
-              (call-with-error-handling
-               (lambda ()
-                 (let ((req (read-request port)))
-                   ;; Block buffering for reading body and writing response.
-                   (setvbuf port _IOFBF)
-                   (values port
-                           req
-                           (read-request-body/latin-1 req))))
-               #:pass-keys '(quit interrupt)
-               #:on-error (if (batch-mode?) 'pass 'debug)
-               #:post-error
-               (lambda (k . args)
-                 (warn "Error while reading request" k args)
-                 (values #f #f #f))))))))))))
+              (let ((req (read-request port)))
+                ;; Block buffering for reading body and writing response.
+                (setvbuf port _IOFBF)
+                (values port
+                        req
+                        (read-request-body/bytevector req))))))))))))
 
 (define (keep-alive? response)
   (let ((v (response-version response)))


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]