From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.lisp.guile.user Subject: Re: Serving files with guile web server Date: Tue, 22 Mar 2011 09:51:47 +0100 Message-ID: <8762rb5yho.fsf@ambire.localdomain> References: <9838.187.147.43.113.1300318403.squirrel@lavabit.com> <58164.187.147.43.113.1300373729.squirrel@lavabit.com> <874o6z97gg.fsf@ossau.uklinux.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1300784034 5521 80.91.229.12 (22 Mar 2011 08:53:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 22 Mar 2011 08:53:54 +0000 (UTC) Cc: guile-user@gnu.org To: Neil Jerram Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Mar 22 09:53:48 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q1xLW-00052w-RY for guile-user@m.gmane.org; Tue, 22 Mar 2011 09:53:47 +0100 Original-Received: from localhost ([127.0.0.1]:34397 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1xLW-0005dq-1L for guile-user@m.gmane.org; Tue, 22 Mar 2011 04:53:46 -0400 Original-Received: from [140.186.70.92] (port=60724 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1xL5-0005dR-Ii for guile-user@gnu.org; Tue, 22 Mar 2011 04:53:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q1xKz-0005lV-Sx for guile-user@gnu.org; Tue, 22 Mar 2011 04:53:19 -0400 Original-Received: from smtp205.alice.it ([82.57.200.101]:41148) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q1xKz-0005ko-Fa for guile-user@gnu.org; Tue, 22 Mar 2011 04:53:13 -0400 Original-Received: from ambire.localdomain (95.244.65.26) by smtp205.alice.it (8.5.124.08) id 4D0D0038080AD80E; Tue, 22 Mar 2011 09:51:57 +0100 Original-Received: from ttn by ambire.localdomain with local (Exim 4.69) (envelope-from ) id 1Q1xJb-0001y8-RZ; Tue, 22 Mar 2011 09:51:47 +0100 In-Reply-To: <874o6z97gg.fsf@ossau.uklinux.net> (Neil Jerram's message of "Sat, 19 Mar 2011 02:20:47 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.57.200.101 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8550 Archived-At: () Neil Jerram () Sat, 19 Mar 2011 02:20:47 +0000 Well, I suppose I'd recommend considering not using the Guile server to serve static files. If efficiency is a concern, another approach is to wrap sendfile(2) or something like it. http://www.gnuvola.org/software/ttn-do/ttn-do.html.gz#index-sendfile-140 This is what "ttn-do sizzweb", "ttn-do serve-debiso" and the serveez packages do, although for the latter the wrapping is admittedly very thin (C only) at present. That may change... http://www.gnuvola.org/software/ttn-do/ttn-do.html.gz#sizzweb http://www.gnuvola.org/software/ttn-do/ttn-do.html.gz#serve-debiso http://git.savannah.gnu.org/cgit/serveez.git?h=next https://github.com/spk121/serveez-mg/ Probably a good exercise for Guile 2 FFI. If sendfile (or ilk) is too Linux- (or ilk) specific, a nice fallback would be to wrap the POSIX scatter/gather support, i.e., writev(2)/readv(2). http://www.gnuvola.org/software/ttn-do/ttn-do.html.gz#index-iovec-142 http://www.gnuvola.org/software/ttn-do/ttn-do.html.gz#index-writev-144 http://www.gnuvola.org/software/ttn-do/ttn-do.html.gz#index-readv-143 This is what (ttn-do zzz x-protocol) uses, albeit sub-optimally for now. http://www.gnuvola.org/software/ttn-do/ttn-do.html.gz#zzz-x_002dprotocol