From: "Hugo Hörnquist" <hugo@lysator.liu.se>
To: guile-devel@gnu.org
Subject: [Patch] Fix IPv6 for HTTP server.
Date: Tue, 31 Mar 2020 15:08:34 +0200 [thread overview]
Message-ID: <20200331130833.GA2658@lysator.liu.se> (raw)
[-- Attachment #1: Type: text/plain, Size: 131 bytes --]
Hi!
A small patch, fixing the use of IPv6 addresses for the built in HTTP
server. Also a really minor documentation fix.
--
hugo
[-- Attachment #2: 0001-Web-server-html-make-default-socket-IPv6-support.patch --]
[-- Type: text/x-diff, Size: 826 bytes --]
From d801c2975fe5fab8bc9bd5dc2f1d5b88a120cd46 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= <hugo@lysator.liu.se>
Date: Tue, 31 Mar 2020 15:04:50 +0200
Subject: [PATCH 1/2] Web server html make-default-socket IPv6 support.
Allows the default http server to create IPv6 sockets.
---
module/web/server/http.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/module/web/server/http.scm b/module/web/server/http.scm
index 05bf46bf0..447282f4c 100644
--- a/module/web/server/http.scm
+++ b/module/web/server/http.scm
@@ -39,7 +39,7 @@
(define (make-default-socket family addr port)
- (let ((sock (socket PF_INET SOCK_STREAM 0)))
+ (let ((sock (socket family SOCK_STREAM 0)))
(setsockopt sock SOL_SOCKET SO_REUSEADDR 1)
(bind sock family addr port)
sock))
--
2.17.1
[-- Attachment #3: 0002-Add-missing-unquote-to-web-server-http-s-documentati.patch --]
[-- Type: text/x-diff, Size: 817 bytes --]
From f6dd65ec45016cc1f69200d21430a5098ef30f09 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= <hugo@lysator.liu.se>
Date: Tue, 31 Mar 2020 15:06:02 +0200
Subject: [PATCH 2/2] Add missing unquote to web server http's documentation.
---
doc/ref/web.texi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/ref/web.texi b/doc/ref/web.texi
index 2d07dd7b1..1686494de 100644
--- a/doc/ref/web.texi
+++ b/doc/ref/web.texi
@@ -1822,7 +1822,7 @@ implementation's open function.
;; On a different port
(run-server handler 'http '(#:port 8081))
;; IPv6
-(run-server handler 'http '(#:family AF_INET6 #:port 8081))
+(run-server handler 'http '(#:family ,AF_INET6 #:port 8081))
;; Custom socket
(run-server handler 'http `(#:socket ,(sudo-make-me-a-socket)))
@end example
--
2.17.1
reply other threads:[~2020-03-31 13:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20200331130833.GA2658@lysator.liu.se \
--to=hugo@lysator.liu.se \
--cc=guile-devel@gnu.org \
/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).