Update the anonymous status of the proxy
@throws IOException I/O error
546061
public void updateAnonymity() throws IOException {
    ProxyBinResponse response = GhostMeHelper.getMyInformation(this.getJavaNetProxy());

    if (!response.getOrigin().equalsIgnoreCase(this.getIp())) {
      anonymous = false;
      return;
    }

    if (!response.getHeaders().get("X-Forwarded-For").equalsIgnoreCase(this.getIp())) {
      anonymous = false;
      return;
    }

    if (!response.getHeaders().get("X-Real-Ip").equalsIgnoreCase(this.getIp())) {
      anonymous = false;
      return;
    }

    anonymous = true;

  }
527586
def _update_status(self, update):
        """"""
        if isinstance(update, dict):
            self._protocol.status.update(update)
            self._protocol._updateq.put_nowait(self._protocol.status)
477728
private void updateConnected() throws IOException
    {
        byte cid = in.readByte();
        // Ensure the client id is the same
        if (cid != clientId)
        {
            return;
        }
        for (final ConnectionListener listener : listeners)
        {
            listener.notifyConnectionEstablished(Byte.valueOf(clientId), clientName);
        }
        // Read the client list
        final int clientsNumber = in.readByte();
        for (int i = 0; i < clientsNumber; i++)
        {
            cid = in.readByte();
            final String cname = readString();
            for (final ConnectionListener listener : listeners)
            {
                listener.notifyClientConnected(Byte.valueOf(cid), cname);
            }
        }
        // Message of the day if has
        if (in.available() > 0)
        {
            final String motd = readString();
            for (final ConnectionListener listener : listeners)
            {
                listener.notifyMessageOfTheDay(motd);
            }
        }
        // Send the last answer
        out.write(NetworkMessageSystemId.CONNECTED);
        out.write(clientId);
        out.flush();
        Verbose.info("Client: Connected to the server !");
    }
169600
def update(self, status=values.unset):
        
        return self._proxy.update(status=status, )
1311535
private void updateConnecting() throws IOException
    {
        if (clientId == -1)
        {
            // Receive id
            clientId = in.readByte();
            // Send the name
            out.writeByte(NetworkMessageSystemId.CONNECTING);
            out.writeByte(clientId);
            final byte[] data = clientName.getBytes(NetworkMessage.CHARSET);
            out.writeByte(data.length);
            out.write(data);
            out.flush();
            Verbose.info("Client: Performing connection to the server...");
        }
    }
1318724
def _update_proxy(self, change):
        
        if change['name'] == 'items':
            self._update_visible_area()
        
        super(TableView, self)._update_proxy(change)
368448
def _StatusUpdateThreadMain(self):
    """"""
    while self._status_update_active:
      # Make a local copy of the PIDs in case the dict is changed by
      # the main thread.
      for pid in list(self._process_information_per_pid.keys()):
        self._CheckStatusAnalysisProcess(pid)

      self._UpdateForemanProcessStatus()

      if self._status_update_callback:
        self._status_update_callback(self._processing_status)

      time.sleep(self._STATUS_UPDATE_INTERVAL)
1036850
public UpdateResponse update(UpdateRequest request) throws IOException {
        return new UpdateResponse(client.doPost(request.toUrl(), request.getBody()));
    }
487600
public void update(StatusData<T> status) {
        if (status == null) {
            throw new IllegalArgumentException("Received null as status data!");
        }
        neverUpdated = false;
        handleStatsResetIfNeeded(status);
        for (T metric : metrics) {
            Object value = status.get(metric);
            if (value == null) {
                getLogger().warn("StatusData contains no value for metric '"+metric.getCaption() + "'.");
                continue;
            }
            StatValue stat = getMonitoredStatValue(metric);
            switch (metric.getType()) {
                case INT: stat.setValueAsInt(Integer.class.cast(value)); break;
                case DOUBLE: stat.setValueAsDouble(Double.class.cast(value)); break;
                case STRING: stat.setValueAsString(value.toString()); break;
                case COUNTER:
                case DIFFLONG:
                case LONG: stat.setValueAsLong(Long.class.cast(value));break;
                default: stat.setValueAsString(value.toString()); break;
            }
        }
    }
463978
private void updateStream() throws IOException {
    if (mBlockInStream != null && mBlockInStream.remaining() > 0) { // can still read from stream
      return;
    }

    if (mBlockInStream != null && mBlockInStream.remaining() == 0) { // current stream is done
      closeBlockInStream(mBlockInStream);
    }

    /* Create a new stream to read from mPosition. */
    // Calculate block id.
    long blockId = mStatus.getBlockIds().get(Math.toIntExact(mPosition / mBlockSize));
    // Create stream
    mBlockInStream = mBlockStore.getInStream(blockId, mOptions, mFailedWorkers);
    // Set the stream to the correct position.
    long offset = mPosition % mBlockSize;
    mBlockInStream.seek(offset);
  }
554607
private void resetNextInetSocketAddress(Proxy proxy) throws IOException {
    // Clear the addresses. Necessary if getAllByName() below throws!
    inetSocketAddresses = new ArrayList<>();

    String socketHost;
    int socketPort;
    if (proxy.type() == Proxy.Type.DIRECT || proxy.type() == Proxy.Type.SOCKS) {
      socketHost = address.url().host();
      socketPort = address.url().port();
    } else {
      SocketAddress proxyAddress = proxy.address();
      if (!(proxyAddress instanceof InetSocketAddress)) {
        throw new IllegalArgumentException(
            "Proxy.address() is not an " + "InetSocketAddress: " + proxyAddress.getClass());
      }
      InetSocketAddress proxySocketAddress = (InetSocketAddress) proxyAddress;
      socketHost = getHostString(proxySocketAddress);
      socketPort = proxySocketAddress.getPort();
    }

    if (socketPort < 1 || socketPort > 65535) {
      throw new SocketException("No route to " + socketHost + ":" + socketPort
          + "; port is out of range");
    }

    if (proxy.type() == Proxy.Type.SOCKS) {
      inetSocketAddresses.add(InetSocketAddress.createUnresolved(socketHost, socketPort));
    } else {
      eventListener.dnsStart(call, socketHost);

      // Try each address for best behavior in mixed IPv4/IPv6 environments.
      List<InetAddress> addresses = address.dns().lookup(socketHost);
      if (addresses.isEmpty()) {
        throw new UnknownHostException(address.dns() + " returned no addresses for " + socketHost);
      }

      eventListener.dnsEnd(call, socketHost, addresses);

      for (int i = 0, size = addresses.size(); i < size; i++) {
        InetAddress inetAddress = addresses.get(i);
        inetSocketAddresses.add(new InetSocketAddress(inetAddress, socketPort));
      }
    }
  }
222312
def update(self, key=values.unset, value=values.unset):
        
        return self._proxy.update(key=key, value=value, )
1213700
private void updateOtherClientConnected() throws IOException
    {
        final byte cid = in.readByte();
        final String cname = readString();
        for (final ConnectionListener listener : listeners)
        {
            listener.notifyClientConnected(Byte.valueOf(cid), cname);
        }
    }
261173
def updateNetwork(self, data, id, headers=None, query_params=None, content_type="application/json"):
        
        uri = self.client.base_url + "/network/"+id
        return self.client.post(uri, data, headers, query_params, content_type)
146097
public void upgradeToSecure() throws IOException {
        Options options = this.connection.getOptions();
        SSLContext context = options.getSslContext();
        
        SSLSocketFactory factory = context.getSocketFactory();
        Duration timeout = options.getConnectionTimeout();

        this.sslSocket = (SSLSocket) factory.createSocket(socket, null, true);
        this.sslSocket.setUseClientMode(true);

        final CompletableFuture<Void> waitForHandshake = new CompletableFuture<>();
        
        this.sslSocket.addHandshakeCompletedListener((evt) -> {
            waitForHandshake.complete(null);
        }
298225
public void installIfNotInstalled() throws IOException {
        try {
            factory.getNodeAndNPMInstaller(proxy())
                    .install(mojo.getNodeVersion(),
                            mojo.getNPMVersion(),
                            mojo.getNodeDistributionRootUrl(),
                            mojo.getNpmRegistryRootUrl() + "/npm/-/");
            if (!getNodeExecutable().isFile()) {
                throw new IOException("Node installation failed - " + getNodeExecutable().getAbsolutePath() + " does not exist");
            }
        } catch (InstallationException e) {
            throw new IOException(e);
        }
    }
552409
public void updateResponse() {
        // TODO: update logging
        setStatus(httpResp.getStatusLine().getStatusCode());
        setStatusLine(httpResp.getStatusLine().toString());
        setHeaders(httpResp.getAllHeaders());
        final HttpEntity entity = httpResp.getEntity();
        if (entity != null) {
            try {
                contentBytes = EntityUtils.toByteArray(entity);
            } catch (IOException e) {
                contentBytes = new byte[0]; // empty byte array
                e.printStackTrace();
            }
            ContentType contentType = ContentType.getOrDefault(entity);
            setContentType(contentType);
            setContentLength(entity.getContentLength());
        }
        if(debug)
            System.err.println(this);

    }