unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Nala Ginrut <nalaginrut@gmail.com>
To: Daniel Hartwig <mandyke@gmail.com>
Cc: "guile-devel@gnu.org" <guile-devel@gnu.org>
Subject: Re: [PATCH] Add backlog option to http-open
Date: Sat, 06 Apr 2013 12:14:31 +0800	[thread overview]
Message-ID: <1365221671.24026.7.camel@Renee-desktop.suse> (raw)
In-Reply-To: <CAN3veRdV5eb6WKi=5t9rpd0qv=6cASoOdJs6gEwq6ZpsOVYUOQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 653 bytes --]

On Fri, 2013-04-05 at 08:22 +0800, Daniel Hartwig wrote:
> On 4 April 2013 12:39, Nala Ginrut <nalaginrut@gmail.com> wrote:
> > I don't think it's necessary to add the docs since it's explicit.
> > It may help for some guys like me. ;-)
> 
> Every part of the API must be documented.  How else do guys like you
> know this is there?
> 

Resend patch, added the example for #:backlog.
Since there's no docs for all run-server open-params, but examples.
So I just added the example. I think it's enough to explain the usage.

Please ping me if it's necessary to add more docs for open-params in
detail. But it's another brand new patch I think.

Thanks! 

[-- Attachment #2: 0001-Add-backlog-option-to-http-open.patch --]
[-- Type: text/x-patch, Size: 1559 bytes --]

From a5cae0d525bbbdcc65f65edb22908a8034e6fb8e Mon Sep 17 00:00:00 2001
From: Nala Ginrut <nalaginrut@gmail.com>
Date: Thu, 4 Apr 2013 12:33:09 +0800
Subject: [PATCH] Add backlog option to http-open

* web/server/http.scm: Add #:backlog to http-open, users may specify
                       backlog to the inner http server.

* doc/ref/web.texi: Add example for #:backlog.
---
 doc/ref/web.texi           |    2 ++
 module/web/server/http.scm |    3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/doc/ref/web.texi b/doc/ref/web.texi
index 0d41f9f..288699e 100644
--- a/doc/ref/web.texi
+++ b/doc/ref/web.texi
@@ -1667,6 +1667,8 @@ implementation's open function.
 (run-server handler 'http '(#:family AF_INET6 #:port 8081))
 ;; Custom socket
 (run-server handler 'http `(#:socket ,(sudo-make-me-a-socket)))
+;; Custom backlog (the default backlog is 128)
+(run-server handler 'http `(#:backlog 1000)) 
 @end example
 @end deffn
 
diff --git a/module/web/server/http.scm b/module/web/server/http.scm
index cda44f4..c814286 100644
--- a/module/web/server/http.scm
+++ b/module/web/server/http.scm
@@ -62,8 +62,9 @@
                               (inet-pton family host)
                               INADDR_LOOPBACK))
                     (port 8080)
+                    (backlog 128)
                     (socket (make-default-socket family addr port)))
-  (listen socket 128)
+  (listen socket backlog)
   (sigaction SIGPIPE SIG_IGN)
   (let ((poll-set (make-empty-poll-set)))
     (poll-set-add! poll-set socket *events*)
-- 
1.7.10.4


  reply	other threads:[~2013-04-06  4:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-04  4:39 [PATCH] Add backlog option to http-open Nala Ginrut
2013-04-05  0:22 ` Daniel Hartwig
2013-04-06  4:14   ` Nala Ginrut [this message]
2013-04-07  6:56     ` Daniel Hartwig
2013-04-05  0:29 ` Daniel Hartwig
2013-04-05  1:29   ` Nala Ginrut

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=1365221671.24026.7.camel@Renee-desktop.suse \
    --to=nalaginrut@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=mandyke@gmail.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).