Arc Forumnew | comments | leaders | submitlogin
1 point by evanrmurphy 5496 days ago | link | parent

I edited the two points in "srv.arc" so they now read:

  (map (fn ((k v)) (= (type-header* k) (gen-type-header v)))
       '((gif       "image/gif")
         (jpg       "image/jpeg")
         (png       "image/png")
         (mp3       "audio/mpeg")
         (text/html "text/html; charset=utf-8")))
...

  (def static-filetype (sym)
    (let fname (coerce sym 'string)
      (and (~find #\/ fname)
           (case (downcase (last (check (tokens fname #\.) ~single)))
             "gif"  'gif
             "jpg"  'jpg
             "jpeg" 'jpg
             "png"  'png
             "mp3"  'mp3
             "css"  'text/html
             "txt"  'text/html
             "htm"  'text/html
             "html" 'text/html
             "arc"  'text/html
             ))))
Unfortunately the audio element still doesn't work. Requests are failing and producing errors like the following at the REPL:

  tcp-write: error writing (Broken pipe; errno=32)

   === context ===
   /anarki/arc/ac.scm:890:13: writeb
   g2758
   g2724
   handle-request-thread


3 points by aw 5496 days ago | link

You'll get this error if the browser has closed the connection and isn't reading the data.

One thing to check is what headers are being sent. For example, with the wget utility, you can use the -S option to see the server headers. First look at the response you're getting from the working server, and then compare it with the response you're getting from the Arc server which isn't working.

-----