anchor.diff:    }
   }
   
  -class _ConnnectionInfo {
  +class _ConnectionInfo {
     final _HttpClientConnection connection;
     final _Proxy proxy;
   
  -  _ConnnectionInfo(this.connection, this.proxy);
  +  _ConnectionInfo(this.connection, this.proxy);
   }
   
   
   class _ConnectionTarget {
     // Unique key for this connection target.
     final String key;
  +  final String host;
  +  final int port;
  +  final bool isSecure;
     final Set<_HttpClientConnection> _idle = new HashSet();
     final Set<_HttpClientConnection> _active = new HashSet();
  -
  -  _ConnectionTarget(this.key);
  -
  -  bool get isEmpty => _idle.isEmpty && _active.isEmpty;
  +  int _connecting = 0;
  +
  +  _ConnectionTarget(this.key, this.host, this.port, this.isSecure);
  +
  +  bool get isEmpty => _idle.isEmpty && _active.isEmpty && _connecting == 0;
   
     bool get hasIdle => _idle.isNotEmpty;
   
  -  bool get hasActive => _active.isNotEmpty;
  +  bool get hasActive => _active.isNotEmpty && _connecting > 0;
   
     _HttpClientConnection takeIdle() {
       assert(hasIdle);
  
positive.code:         c.destroy();
        }
      }
    }
  }
  
  
negative.code:     }
    }
  
    _ConnectionTarget _getConnectionTarget(String host, int port, bool isSecure) {
      String key = _HttpClientConnection.makeKey(isSecure, host, port);
      return _connectionTargets.putIfAbsent(
          key, () => new _ConnectionTarget(key, host, port, isSecure));
    }
  
    // Get a new _HttpClientConnection, from the matching _ConnectionTarget.
    Future<_ConnectionInfo> _getConnection(String uriHost,
                                            int uriPort,
                                            _ProxyConfiguration proxyConf,
                                            bool isSecure) {
      Iterator<_Proxy> proxies = proxyConf.proxies.iterator;
  
      Future<_ConnectionInfo> connect(error) {
        if (!proxies.moveNext()) return new Future.error(error);
        _Proxy proxy = proxies.current;
        String host = proxy.isDirect ? uriHost: proxy.host;
        int port = proxy.isDirect ? uriPort: proxy.port;
        return _getConnectionTarget(host, port, isSecure)
            .connect(uriHost, uriPort, proxy, this)
            // On error, continue with next proxy.
            .catchError(connect);
      }
      return connect(new HttpException("No proxies given"));
    }
  