[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Spiffy bug (with .ws files?)
From: |
Robin Lee Powell |
Subject: |
Re: [Chicken-users] Spiffy bug (with .ws files?) |
Date: |
Sat, 15 Mar 2008 01:24:55 -0700 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
On Sat, Mar 15, 2008 at 12:49:13AM -0700, Robin Lee Powell wrote:
>
> [Response: HTTP/1.1 200 OK#<unspecified>]
> [SPIFFY: (root) reading DIR/index.ws with size 191.0#<unspecified>]
> Error: (file-read) bad argument type - not a fixnum: 191.0
> Error: 500 Internal server error
This was fixed with:
Index: spiffy-base.scm
===================================================================
--- spiffy-base.scm (revision 9705)
+++ spiffy-base.scm (working copy)
@@ -199,12 +199,12 @@
(define (send-static-file fn)
(let ([buffer (cache-read fn)])
(if buffer
- (let ([size (##sys#size buffer)])
+ (let ([size (inexact->exact (##sys#size buffer))])
(set-header! (sprintf "Content-Length: ~A" size))
(write-response-header)
(unless (eq? 'HEAD (http:request-method (current-request)))
(display buffer) ) )
- (let ([size (file-size fn)])
+ (let ([size (inexact->exact (file-size fn))])
(set-header! (sprintf "Content-Length: ~A" (car (string-split
(number->string size) ".")))) ;; yuck!
(write-response-header)
(unless (eq? 'HEAD (http:request-method (current-request)))
but I don't know if the actual problem was caused by me having old
eggs, as re-loading the spiffy egg no longer causes the problem; see
below.
> Better still is what it sends to the client:
>
> address@hidden> curl -D - http://chain.teddyb.org:7623/
> HTTP/1.1 200 OK
> Server: spiffy No. 3 (Release 7) on Chicken 3.0.6
> #<unspecified>Content-Length: 191
> Content-Type: application/octet-stream
This turns out to be a problem with the http egg, but what's better
is that apparently "chicken-setup http" in /tmp was grabbing an old
/tmp/http.egg I had lying around and not updating.
-_-
Fixing that solved the problem.
-Robin
--
Lojban Reason #17: http://en.wikipedia.org/wiki/Buffalo_buffalo
Proud Supporter of the Singularity Institute - http://singinst.org/
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/