@Override public String getNextServiceName() { return nextService.getName(); }
service.handle(msg, buf);
/** * Got an SSH_MSG_UNIMPLEMENTED, so lets see where we're at and act accordingly. * * @param packet The 'unimplemented' packet received * @throws TransportException */ private void gotUnimplemented(SSHPacket packet) throws SSHException { long seqNum = packet.readUInt32(); log.debug("Received SSH_MSG_UNIMPLEMENTED #{}", seqNum); if (kexer.isKexOngoing()) throw new TransportException("Received SSH_MSG_UNIMPLEMENTED while exchanging keys"); getService().notifyUnimplemented(seqNum); }
@Override public void disconnect(DisconnectReason reason, String message) { close.lock(); try { if (isRunning()) { disconnectListener.notifyDisconnect(reason, message); getService().notifyError(new TransportException(reason, "Disconnected")); sendDisconnect(reason, message); finishOff(); close.set(); } } finally { close.unlock(); } }
public void die(Exception ex) { close.lock(); try { if (!close.isSet()) { log.error("Dying because - {}", ex.getMessage(), ex); final SSHException causeOfDeath = SSHException.chainer.chain(ex); disconnectListener.notifyDisconnect(causeOfDeath.getDisconnectReason(), causeOfDeath.getMessage()); ErrorDeliveryUtil.alertEvents(causeOfDeath, close, serviceAccept); kexer.notifyError(causeOfDeath); getService().notifyError(causeOfDeath); setService(nullService); { // Perhaps can send disconnect packet to server final boolean didNotReceiveDisconnect = msg != Message.DISCONNECT; final boolean gotRequiredInfo = causeOfDeath.getDisconnectReason() != DisconnectReason.UNKNOWN; if (didNotReceiveDisconnect && gotRequiredInfo) sendDisconnect(causeOfDeath.getDisconnectReason(), causeOfDeath.getMessage()); } finishOff(); close.set(); } } finally { close.unlock(); } }
@Override public synchronized void setService(Service service) { if (service == null) service = nullService; log.debug("Setting active service to {}", service.getName()); this.service = service; }
@Override public void disconnect(DisconnectReason reason, String message) { close.lock(); try { if (isRunning()) { disconnectListener.notifyDisconnect(reason, message); getService().notifyError(new TransportException(reason, "Disconnected")); sendDisconnect(reason, message); finishOff(); close.set(); } } finally { close.unlock(); } }
/** * Got an SSH_MSG_UNIMPLEMENTED, so lets see where we're at and act accordingly. * * @param packet The 'unimplemented' packet received * @throws TransportException */ private void gotUnimplemented(SSHPacket packet) throws SSHException { long seqNum = packet.readUInt32(); log.debug("Received SSH_MSG_UNIMPLEMENTED #{}", seqNum); if (kexer.isKexOngoing()) throw new TransportException("Received SSH_MSG_UNIMPLEMENTED while exchanging keys"); getService().notifyUnimplemented(seqNum); }
service.handle(msg, buf);
@Override public void request() throws TransportException { final Service active = trans.getService(); if (!equals(active)) if (name.equals(active.getName())) trans.setService(this); else trans.reqService(this); }
@Override public void disconnect(DisconnectReason reason, String message) { close.lock(); try { if (isRunning()) { disconnectListener.notifyDisconnect(reason, message); getService().notifyError(new TransportException(reason, "Disconnected")); sendDisconnect(reason, message); finishOff(); close.set(); } } finally { close.unlock(); } }
/** * Got an SSH_MSG_UNIMPLEMENTED, so lets see where we're at and act accordingly. * * @param buf * * @throws TransportException */ private void gotUnimplemented(SSHPacket buf) throws SSHException { long seqNum = buf.readUInt32(); log.debug("Received SSH_MSG_UNIMPLEMENTED #{}", seqNum); if (kexer.isKexOngoing()) throw new TransportException("Received SSH_MSG_UNIMPLEMENTED while exchanging keys"); getService().notifyUnimplemented(seqNum); }
service.handle(msg, buf);
@Override public void reqService(Service service) throws TransportException { serviceAccept.lock(); try { serviceAccept.clear(); sendServiceRequest(service.getName()); serviceAccept.await(timeoutMs, TimeUnit.MILLISECONDS); setService(service); } finally { serviceAccept.unlock(); } }
public void die(Exception ex) { close.lock(); try { if (!close.isSet()) { log.error("Dying because - {}", ex.getMessage(), ex); final SSHException causeOfDeath = SSHException.chainer.chain(ex); disconnectListener.notifyDisconnect(causeOfDeath.getDisconnectReason(), causeOfDeath.getMessage()); ErrorDeliveryUtil.alertEvents(causeOfDeath, close, serviceAccept); kexer.notifyError(causeOfDeath); getService().notifyError(causeOfDeath); setService(nullService); { // Perhaps can send disconnect packet to server final boolean didNotReceiveDisconnect = msg != Message.DISCONNECT; final boolean gotRequiredInfo = causeOfDeath.getDisconnectReason() != DisconnectReason.UNKNOWN; if (didNotReceiveDisconnect && gotRequiredInfo) sendDisconnect(causeOfDeath.getDisconnectReason(), causeOfDeath.getMessage()); } finishOff(); close.set(); } } finally { close.unlock(); } }
@Override public String getNextServiceName() { return nextService.getName(); }
void die(Exception ex) { close.lock(); try { if (!close.isSet()) { log.error("Dying because - {}", ex); final SSHException causeOfDeath = SSHException.chainer.chain(ex); disconnectListener.notifyDisconnect(causeOfDeath.getDisconnectReason(), causeOfDeath.getMessage()); ErrorDeliveryUtil.alertEvents(causeOfDeath, close, serviceAccept); kexer.notifyError(causeOfDeath); getService().notifyError(causeOfDeath); setService(nullService); { // Perhaps can send disconnect packet to server final boolean didNotReceiveDisconnect = msg != Message.DISCONNECT; final boolean gotRequiredInfo = causeOfDeath.getDisconnectReason() != DisconnectReason.UNKNOWN; if (didNotReceiveDisconnect && gotRequiredInfo) sendDisconnect(causeOfDeath.getDisconnectReason(), causeOfDeath.getMessage()); } finishOff(); close.set(); } } finally { close.unlock(); } }
@Override public String getNextServiceName() { return nextService.getName(); }
@Override public synchronized void setService(Service service) { if (service == null) service = nullService; log.debug("Setting active service to {}", service.getName()); this.service = service; }
@Override public synchronized void setService(Service service) { if (service == null) service = nullService; log.debug("Setting active service to {}", service.getName()); this.service = service; }