Index: http.c
===================================================================
--- http.c	(revision 355585)
+++ http.c	(working copy)
@@ -856,6 +856,13 @@
             }
           }
 
+    /* 1C Modified. NTLM Authentication not supported by server or not picked
+       set ntlm state NTLMSTATE_LAST for reuse connection */
+    if(authp->picked != CURLAUTH_NTLM
+       && authp->picked != CURLAUTH_NTLM_WB){
+      conn->ntlm.state = NTLMSTATE_LAST;
+    }
+
     /* there may be multiple methods on one line, so keep reading */
     while(*start && *start != ',') /* read up to the next comma */
       start++;
@@ -2777,6 +2784,7 @@
 {
   CURLcode result;
   struct SingleRequest *k = &data->req;
+  bool hostAuthNotSet = true;
 
   /* header line within buffer loop */
   do {
@@ -3461,6 +3469,9 @@
              (401 == k->httpcode)) ||
             (checkprefix("Proxy-authenticate:", k->p) &&
              (407 == k->httpcode))) {
+      if((checkprefix("WWW-Authenticate:", k->p) &&
+          (401 == k->httpcode)))
+          hostAuthNotSet = false;
       result = Curl_http_input_auth(conn, k->httpcode, k->p);
       if(result)
         return result;
@@ -3523,6 +3534,11 @@
   }
   while(!*stop_reading && *k->str); /* header line within buffer */
 
+  /* 1C Modified. NTLM Authentication not supported by server
+     set ntlm state NTLMSTATE_LAST for reuse connection */
+  if (hostAuthNotSet)
+      conn->ntlm.state = NTLMSTATE_LAST;
+
   /* We might have reached the end of the header part here, but
      there might be a non-header part left in the end of the read
      buffer. */
