[arch-commits] Commit in hey/repos/community-x86_64 (3 files)
Jelle van der Waa
jelle at archlinux.org
Thu Nov 19 15:53:34 UTC 2020
Date: Thursday, November 19, 2020 @ 15:53:33
Author: jelle
Revision: 757602
archrelease: copy trunk to community-x86_64
Added:
hey/repos/community-x86_64/0001-Handle-Request.Host-containing-the-server-port.patch
(from rev 757601, hey/trunk/0001-Handle-Request.Host-containing-the-server-port.patch)
hey/repos/community-x86_64/PKGBUILD
(from rev 757601, hey/trunk/PKGBUILD)
Deleted:
hey/repos/community-x86_64/PKGBUILD
-----------------------------------------------------------+
0001-Handle-Request.Host-containing-the-server-port.patch | 44 ++++++++
PKGBUILD | 64 ++++++------
2 files changed, 77 insertions(+), 31 deletions(-)
Copied: hey/repos/community-x86_64/0001-Handle-Request.Host-containing-the-server-port.patch (from rev 757601, hey/trunk/0001-Handle-Request.Host-containing-the-server-port.patch)
===================================================================
--- 0001-Handle-Request.Host-containing-the-server-port.patch (rev 0)
+++ 0001-Handle-Request.Host-containing-the-server-port.patch 2020-11-19 15:53:33 UTC (rev 757602)
@@ -0,0 +1,44 @@
+From 292dd07ebd79a5236921231d82c85bcb3874f188 Mon Sep 17 00:00:00 2001
+From: Jelle van der Waa <jelle at vdwaa.nl>
+Date: Thu, 19 Nov 2020 14:51:31 +0100
+Subject: [PATCH] Handle Request.Host containing the server port
+
+As written in the net/http/#Request documentation Host may be of the
+form "host:port" and as defined in rfc4366 section-3.1 the serverName
+should not contain the port or colon.
+---
+ requester/requester.go | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/requester/requester.go b/requester/requester.go
+index fd7277e..924d945 100644
+--- a/requester/requester.go
++++ b/requester/requester.go
+@@ -20,6 +20,7 @@ import (
+ "crypto/tls"
+ "io"
+ "io/ioutil"
++ "net"
+ "net/http"
+ "net/http/httptrace"
+ "net/url"
+@@ -235,10 +236,15 @@ func (b *Work) runWorkers() {
+ var wg sync.WaitGroup
+ wg.Add(b.C)
+
++ hostName, _, err := net.SplitHostPort(b.Request.Host);
++ if err != nil {
++ hostName = b.Request.Host;
++ }
++
+ tr := &http.Transport{
+ TLSClientConfig: &tls.Config{
+ InsecureSkipVerify: true,
+- ServerName: b.Request.Host,
++ ServerName: hostName,
+ },
+ MaxIdleConnsPerHost: min(b.C, maxIdleConn),
+ DisableCompression: b.DisableCompression,
+--
+2.29.2
+
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2020-11-19 15:53:26 UTC (rev 757601)
+++ PKGBUILD 2020-11-19 15:53:33 UTC (rev 757602)
@@ -1,31 +0,0 @@
-# Maintainer: Jelle van der Waa <jelle at archlinux.org>
-
-pkgname=hey
-pkgver=0.1.4
-pkgrel=1
-pkgdesc='HTTP load generator'
-url="https://github.com/rakyll/hey"
-arch=(x86_64)
-license=('GPL')
-depends=('glibc')
-makedepends=('go')
-source=($pkgname-$pkgver.tar.gz::https://github.com/rakyll/hey/archive/v$pkgver.tar.gz)
-sha512sums=('f71ad13c401e9c9c45e1176924de49eb33df9b180dc10907997d1e500a4e5c6e28dd0293cef5d3fe8fabf0bfbade353938327bf3fce894c271209ec86e265ead')
-
-
-build() {
- cd $pkgname-$pkgver
- go build \
- -trimpath \
- -buildmode=pie \
- -mod=readonly \
- -modcacherw \
- -ldflags "-extldflags \"${LDFLAGS}\"" \
- .
-}
-
-
-package() {
- cd $pkgname-$pkgver
- install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
-}
Copied: hey/repos/community-x86_64/PKGBUILD (from rev 757601, hey/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2020-11-19 15:53:33 UTC (rev 757602)
@@ -0,0 +1,33 @@
+# Maintainer: Jelle van der Waa <jelle at archlinux.org>
+
+pkgname=hey
+pkgver=0.1.4
+pkgrel=2
+pkgdesc='HTTP load generator'
+url="https://github.com/rakyll/hey"
+arch=(x86_64)
+license=('GPL')
+depends=('glibc')
+makedepends=('go')
+source=($pkgname-$pkgver.tar.gz::https://github.com/rakyll/hey/archive/v$pkgver.tar.gz
+ 0001-Handle-Request.Host-containing-the-server-port.patch)
+sha512sums=('f71ad13c401e9c9c45e1176924de49eb33df9b180dc10907997d1e500a4e5c6e28dd0293cef5d3fe8fabf0bfbade353938327bf3fce894c271209ec86e265ead'
+ '97c2e54d4f9b67c8beda5b3c034e501cdec9d6636bfaaf7d33a27927c96915b73906400dc2a17888144a4748a0f37462ccd2c90b35ca4f3221f3a410cf81af16')
+
+
+build() {
+ cd $pkgname-$pkgver
+ go build \
+ -trimpath \
+ -buildmode=pie \
+ -mod=readonly \
+ -modcacherw \
+ -ldflags "-linkmode external -extldflags \"${LDFLAGS}\"" \
+ .
+}
+
+
+package() {
+ cd $pkgname-$pkgver
+ install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
+}
More information about the arch-commits
mailing list