From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,27c24ba68e621eef X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!news.banetele.no!news.hacking.dk!pnx.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: AWS applications and domain hosting Date: 01 Jul 2005 01:58:35 +0200 Organization: hacking.dk - Doing fun stuff with open source Sender: sparre@hugin.crs4.it Message-ID: References: NNTP-Posting-Host: 80.241.165.38 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: xyzzy.adsl.dk 1120176265 7976 80.241.165.38 (1 Jul 2005 00:04:25 GMT) X-Complaints-To: usenet@news.hacking.dk NNTP-Posting-Date: Fri, 1 Jul 2005 00:04:25 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 Xref: g2news1.google.com comp.lang.ada:11791 Date: 2005-07-01T01:58:35+02:00 List-Id: Pascal Obry wrote: > Randy Brukardt wrote: > > > a) You don't have to implement plain handing out of static > > > files yourself. > > > > That's such a trivial task (assuming that AWS includes appropriate > > handling of HTTP commands) that's it's pretty silly not to include > > it and avoid extra failure points. > > This is indeed one of the AWS example. A static file server is built > in AWS using a 10 lines procedure callback: > > << > function Get (Request : in AWS.Status.Data) return AWS.Response.Data is > URI : constant String := AWS.Status.URI (Request); > Filename : constant String := URI (2 .. URI'Last); > begin > if OS_Lib.Is_Regular_File (Filename) then > return AWS.Response.File > (Content_Type => AWS.MIME.Content_Type (Filename), > Filename => Filename); > > else > return AWS.Response.Acknowledge > (Messages.S404, "

Page '" & URI & "' Not found."); > end if; > end Get; > >> I wasn't aware of the AWS.Response.File function. Does this it stream the file? Or do you have to load it into memory first? If AWS knows how to stream files, my point about handing out files is clearly not valid. How about handling of content negotiation? Can AWS also do that for me? (yes, I _could_ read the manual) Or will I get the pleasure of implementing that myself? My example, , will continue to run as described, since we have many different web sites on that machine, and I wouldn't like to force the other administrators to use AWS just because I run a small service implemented with AWS. - And restarting the whole HTTP daemon every time I feel like tweaking my toy isn't healthy either. -- But with what I've learnt now, I might try to implement a proper (for my purposes) web server using AWS for my own site. Jacob -- "Computer Science is to Science, as Plumbing is to Hydrodynamics"