* A few patches for guile-www
@ 2010-11-26 0:35 Neil Jerram
2010-11-26 7:10 ` Thien-Thi Nguyen
0 siblings, 1 reply; 4+ messages in thread
From: Neil Jerram @ 2010-11-26 0:35 UTC (permalink / raw)
To: Thien-Thi Nguyen; +Cc: Guile User List
[-- Attachment #1: Type: text/plain, Size: 552 bytes --]
Hi thi,
I've got back to some modlisp hacking, and as part of that have rebased
to guile-www-2.28. To get things working, in particular the modlisp
support, I had to make a few small changes, so I attach those for your
consideration. I think they're all self-evident, but of course please
ask if not.
(For an example modlisp server and web page script that work with this, see
http://git.savannah.gnu.org/cgit/ossaulib.git/tree/scripts/modlisp-server
and
http://git.savannah.gnu.org/cgit/ossaulib.git/tree/scripts/modlisp-example.)
Neil
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Allow-big-dishing-loop-to-set-modlisp-ish-reply-styl.patch --]
[-- Type: text/x-diff, Size: 2130 bytes --]
From 35906ccf32c502eb34190960542679ca96c6104a Mon Sep 17 00:00:00 2001
From: Neil Jerram <neil@ossau.uklinux.net>
Date: Thu, 25 Nov 2010 20:11:29 +0000
Subject: [PATCH 1/4] Allow big-dishing-loop to set modlisp-ish reply style
---
source/server-utils/big-dishing-loop.scm | 5 +++--
source/server-utils/modlisp.scm | 9 +++++----
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/source/server-utils/big-dishing-loop.scm b/source/server-utils/big-dishing-loop.scm
index ee5d4ab..ade4078 100644
--- a/source/server-utils/big-dishing-loop.scm
+++ b/source/server-utils/big-dishing-loop.scm
@@ -111,7 +111,8 @@
(define http-hgrok (vector read-first-line
read-headers
- skip-headers))
+ skip-headers
+ #f))
;; Return a proc @var{dish} that loops serving http requests from a socket.
;; @var{dish} takes one arg @var{ear}, which may be a pre-configured socket,
@@ -284,7 +285,7 @@
;; status box
(b (and (number? status-box-size)
(make-list status-box-size #f)))
- (M (mouthpiece p b))
+ (M (mouthpiece p b (vector-ref style 3)))
(res (cond ((assq-ref method-handlers method)
=> (lambda (mh)
(call-with-current-continuation
diff --git a/source/server-utils/modlisp.scm b/source/server-utils/modlisp.scm
index 5bd60fe..9f0ffb0 100644
--- a/source/server-utils/modlisp.scm
+++ b/source/server-utils/modlisp.scm
@@ -52,14 +52,15 @@
(set-car! rv (string->symbol (car rv)))
rv))
-(define modlisp-hgrok (vector read-first-line
- read-headers
- read-headers))
-
(define LF "\n")
(define modlisp-ish (vector "Status\n~A ~A\n"
LF LF
"end\n"))
+(define modlisp-hgrok (vector read-first-line
+ read-headers
+ read-headers
+ modlisp-ish))
+
;;; modlisp.scm ends here
--
1.7.2.3
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-When-running-under-Guile-1.9-2.0-use-ice-9-curried-d.patch --]
[-- Type: text/x-diff, Size: 765 bytes --]
From c4ceb9c7ea8d272c2c6e280bca4c07553ee50d5c Mon Sep 17 00:00:00 2001
From: Neil Jerram <neil@ossau.uklinux.net>
Date: Fri, 26 Nov 2010 00:14:00 +0000
Subject: [PATCH 2/4] When running under Guile 1.9/2.0, use (ice-9 curried-definitions)
---
source/server-utils/answer.scm | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/source/server-utils/answer.scm b/source/server-utils/answer.scm
index 75af9e7..4f1f152 100644
--- a/source/server-utils/answer.scm
+++ b/source/server-utils/answer.scm
@@ -28,6 +28,8 @@
#:use-module (ice-9 optargs)
#:use-module ((ice-9 rw) #:select (write-string/partial)))
+(cond-expand (guile-2 (use-modules (ice-9 curried-definitions))))
+
(define-macro (+! v n)
`(set! ,v (+ ,v ,n)))
--
1.7.2.3
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-Fix-tree-flat-length-so-that-it-returns-a-value.patch --]
[-- Type: text/x-diff, Size: 928 bytes --]
From b5d5e809ad7b245da90920f0186e98f2fdbf1e0a Mon Sep 17 00:00:00 2001
From: Neil Jerram <neil@ossau.uklinux.net>
Date: Fri, 26 Nov 2010 00:14:32 +0000
Subject: [PATCH 3/4] Fix tree-flat-length! so that it returns a value
---
source/server-utils/answer.scm | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/source/server-utils/answer.scm b/source/server-utils/answer.scm
index 4f1f152..60861fd 100644
--- a/source/server-utils/answer.scm
+++ b/source/server-utils/answer.scm
@@ -63,7 +63,8 @@
((flat-length tree))
(else (set! (flat-length tree)
(+ (tree-flat-length! (car tree))
- (tree-flat-length! (cdr tree)))))))
+ (tree-flat-length! (cdr tree))))
+ (flat-length tree))))
;; Return a new string made from flattening @var{tree}.
;; Set the @code{flat-length} (using @code{tree-flat-length!})
--
1.7.2.3
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: 0004-Fix-read-headers-so-that-it-returns-the-read-headers.patch --]
[-- Type: text/x-diff, Size: 942 bytes --]
From b2de97dbe50c89cc78b8a74a8b2c886e71c94c16 Mon Sep 17 00:00:00 2001
From: Neil Jerram <neil@ossau.uklinux.net>
Date: Fri, 26 Nov 2010 00:15:18 +0000
Subject: [PATCH 4/4] Fix read-headers so that it returns the read headers
---
source/server-utils/modlisp.scm | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/source/server-utils/modlisp.scm b/source/server-utils/modlisp.scm
index 9f0ffb0..af30316 100644
--- a/source/server-utils/modlisp.scm
+++ b/source/server-utils/modlisp.scm
@@ -38,9 +38,10 @@
(let loop ((acc '()))
(let ((k (read-line port)))
(if (string=? "end" k)
- (set! (stashed port)
- ;; rv
- (reverse! acc))
+ (begin (set! (stashed port)
+ ;; rv
+ (reverse! acc))
+ (stashed port))
(loop (acons k (read-line port) acc)))))))
(define (read-first-line port)
--
1.7.2.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: A few patches for guile-www
2010-11-26 0:35 A few patches for guile-www Neil Jerram
@ 2010-11-26 7:10 ` Thien-Thi Nguyen
2010-12-03 18:24 ` Neil Jerram
0 siblings, 1 reply; 4+ messages in thread
From: Thien-Thi Nguyen @ 2010-11-26 7:10 UTC (permalink / raw)
To: Neil Jerram; +Cc: Guile User List
Hi Neil,
() Fri, 26 Nov 2010 00:35:09 +0000
I've got back to some modlisp hacking, and as part of that have
rebased to guile-www-2.28.
Cool.
To get things working, in particular the modlisp support, I had
to make a few small changes, so I attach those for your
consideration. I think they're all self-evident, but of course
please ask if not.
Thanks; i appreciate the feedback. I have the impression after a
quick skim that all the changes are bugfixes (not merely enhancements).
Is that correct?
In any case, i will gladly apply them once i figure out
their nature and suitable ChangeLog entries.
thi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: A few patches for guile-www
2010-11-26 7:10 ` Thien-Thi Nguyen
@ 2010-12-03 18:24 ` Neil Jerram
2010-12-03 19:45 ` Thien-Thi Nguyen
0 siblings, 1 reply; 4+ messages in thread
From: Neil Jerram @ 2010-12-03 18:24 UTC (permalink / raw)
To: Thien-Thi Nguyen; +Cc: Guile User List
Thien-Thi Nguyen <ttn@gnuvola.org> writes:
> Thanks; i appreciate the feedback. I have the impression after a
> quick skim that all the changes are bugfixes (not merely enhancements).
> Is that correct?
Yes, I would say so.
> In any case, i will gladly apply them once i figure out
> their nature and suitable ChangeLog entries.
I'm happy to explain more if they're not immediately obvious...
Neil
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: A few patches for guile-www
2010-12-03 18:24 ` Neil Jerram
@ 2010-12-03 19:45 ` Thien-Thi Nguyen
0 siblings, 0 replies; 4+ messages in thread
From: Thien-Thi Nguyen @ 2010-12-03 19:45 UTC (permalink / raw)
To: Neil Jerram; +Cc: Guile User List
() Neil Jerram <neil@ossau.uklinux.net>
() Fri, 03 Dec 2010 18:24:50 +0000
Yes, I would say so.
OK, thanks for the confirmation.
I'm happy to explain more if they're not immediately obvious...
No worries. I'll figure it out...
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-12-03 19:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-26 0:35 A few patches for guile-www Neil Jerram
2010-11-26 7:10 ` Thien-Thi Nguyen
2010-12-03 18:24 ` Neil Jerram
2010-12-03 19:45 ` Thien-Thi Nguyen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).