unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [Patch] Fix IPv6 for HTTP server.
@ 2020-03-31 13:08 Hugo Hörnquist
  0 siblings, 0 replies; only message in thread
From: Hugo Hörnquist @ 2020-03-31 13:08 UTC (permalink / raw)
  To: guile-devel

[-- 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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-31 13:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31 13:08 [Patch] Fix IPv6 for HTTP server Hugo Hörnquist

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).