From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Hugo =?utf-8?Q?H=C3=B6rnquist?= Newsgroups: gmane.lisp.guile.devel Subject: [Patch] Fix IPv6 for HTTP server. Date: Tue, 31 Mar 2020 15:08:34 +0200 Message-ID: <20200331130833.GA2658@lysator.liu.se> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Q68bSM7Ycu6FN28Q" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="33893"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.9.4 (2018-02-28) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Tue Mar 31 15:08:56 2020 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jJGdU-0008f2-RE for guile-devel@m.gmane-mx.org; Tue, 31 Mar 2020 15:08:56 +0200 Original-Received: from localhost ([::1]:37686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJGdS-0005I9-Sk for guile-devel@m.gmane-mx.org; Tue, 31 Mar 2020 09:08:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40060) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jJGdJ-0005I1-6r for guile-devel@gnu.org; Tue, 31 Mar 2020 09:08:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jJGdF-00087i-Qd for guile-devel@gnu.org; Tue, 31 Mar 2020 09:08:45 -0400 Original-Received: from mail.lysator.liu.se ([130.236.254.3]:39333) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jJGdF-00081s-Hk for guile-devel@gnu.org; Tue, 31 Mar 2020 09:08:41 -0400 Original-Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 65B924000D for ; Tue, 31 Mar 2020 15:08:36 +0200 (CEST) Original-Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 4FE454000E; Tue, 31 Mar 2020 15:08:36 +0200 (CEST) Original-Received: from lysator.liu.se (artemis.lysator.liu.se [IPv6:2001:6b0:17:f0a0::f1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id B418B4000D for ; Tue, 31 Mar 2020 15:08:35 +0200 (CEST) Content-Disposition: inline X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 130.236.254.3 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20475 Archived-At: --Q68bSM7Ycu6FN28Q Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Hi! A small patch, fixing the use of IPv6 addresses for the built in HTTP server. Also a really minor documentation fix. -- hugo --Q68bSM7Ycu6FN28Q Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0001-Web-server-html-make-default-socket-IPv6-support.patch" >From d801c2975fe5fab8bc9bd5dc2f1d5b88a120cd46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= 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 --Q68bSM7Ycu6FN28Q Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0002-Add-missing-unquote-to-web-server-http-s-documentati.patch" >From f6dd65ec45016cc1f69200d21430a5098ef30f09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= 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 --Q68bSM7Ycu6FN28Q--