unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Nala Ginrut <nalaginrut@gmail.com>
To: Josep Portella Florit <jpf@primfilat.com>
Cc: guile-devel@gnu.org
Subject: Re: Comments on the web modules
Date: Tue, 03 Jun 2014 15:58:02 +0800	[thread overview]
Message-ID: <1401782282.30925.59.camel@Renee-desktop.suse> (raw)
In-Reply-To: <87lhtgc1zn.fsf@primfilat.com>

Hi Josep!

On Sun, 2014-06-01 at 13:18 +0200, Josep Portella Florit wrote:
> Hi!
> 
> I have some comments on the web modules:
> 
> 1) The web server handlers receive a request object and the body as a
> bytevector.  I think it would be more flexible to pass the request
> object only, and let the handler decide how to read the body from the
> port of the request object; it would allow processing large bodies
> without being bound by RAM.

I agree with you.
The users can't handle the http body by themselves. For an instance, you
have no chance to limit the size of uploaded file, since the http-read
has read all the body bytevectors in the RAM already. And
request-handler in run-server expects http body as the argument.
One of the solution is to add an option to http-read, and return body as
a port when we don't want run-server to read body for us. (Note that #f
couldn't be the proper placeholder since it means 'no body').


[...]

> 3) The web server should add the client's sock-addr to the meta alist
> of the request object.  I know you planned to do this, according to
> the `request-meta' documentation and the (web server http) source.
> Instead of taking the `cdr' of `accept's return value and storing it
> somewhere, which would complicate the code, you could use
> `getpeername' when building the request.  I'm interested in this
> because I wrote a procedure that creates request objects from CGI
> requests, and I would like to make the meta information compatible.
> 

I need sock-addr too.
Besides, I expect there's a way to let user defined server-handler take
the request handler too. 
One of the cases we need it is to support websocket. Once the websocket
handshake is done, users may handle the socket data with client's
sock-addr. And the inner-server don't serve the socket with HTTP
protocol at all.

My request could be hard to compatible with our current server module.
If it's too hard to be in guile-core, I have to write a new server in my
web-framework for full websocket support.

Best regards.




      reply	other threads:[~2014-06-03  7:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-01 11:18 Comments on the web modules Josep Portella Florit
2014-06-03  7:58 ` Nala Ginrut [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401782282.30925.59.camel@Renee-desktop.suse \
    --to=nalaginrut@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=jpf@primfilat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).