Connection request auth + keep-alive

Pavel Mracek mracek at poda.cz
Thu Mar 2 12:53:41 EST 2017


Hi,
Trying to today's git version I ran into problem with connection request
which ends with error 401.

Core of problem is in missing keep-alive option in http request

OLD  version send:
=====================
GET /64298a8677d17fa449454f499a094c1e HTTP/1.1
Authorization: Digest
username="acs",realm="HuaweiHomeGateway",nonce="f7d90837cb42b0880085f8aeb29e6917",uri="/64298a8677d17fa449454f499a094c1e",algorithm=MD5,qop=auth,nc=00000001,cnonce="0a4f113b",response="ad67c895291f7c9c5cabaca626d1cb9a",opaque="undefined"
Host: 10.32.183.70:7547
Connection: keep-alive


Recent git version send:
======================
...
...
Connection: close


This patch solve this issue for me:
diff --git a/lib/api-functions.coffee b/lib/api-functions.coffee
index 6627469..c9d9d40 100644
--- a/lib/api-functions.coffee
+++ b/lib/api-functions.coffee
@@ -83,6 +83,7 @@ httpConReq = (url, username, password, timeout,
callback) ->
   options = URL.parse(url)
   # Ensure socket is reused in case of digest authentication
   agent = new http.Agent({maxSockets : 1})
+  options.agent=agent;
 
   statusToError = (statusCode) ->
     switch statusCode


m.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20170302/43d8353e/attachment.html>


More information about the Users mailing list