@Override public void run() { try { byte[] buf = new byte[1024]; OutputStream invIn = getInvertedIn(); while (true) { int result = Socket.recv(socket, buf, 0, buf.length); if (result == -Status.APR_EOF) { break; } else if (result < Status.APR_SUCCESS) { throw AgentServerProxy.toIOException(result); } invIn.write(buf, 0, result); invIn.flush(); } } catch (Exception e) { log.warn("Processing loop exception", e); } finally { close(false); } }
@Override protected synchronized void doOpen() throws IOException { ValidateUtils.checkTrue(!Streaming.Async.equals(streaming), "Asynchronous streaming isn't supported yet on this channel"); invertedIn = new ChannelOutputStream(this, getRemoteWindow(), log, SshConstants.SSH_MSG_CHANNEL_DATA, true); }
Socket.timeoutSet(clientSock, session.getIntProperty(AUTH_SOCKET_TIMEOUT, DEFAULT_AUTH_SOCKET_TIMEOUT)); String channelType = session.getStringProperty(PROXY_CHANNEL_TYPE, DEFAULT_PROXY_CHANNEL_TYPE); AgentForwardedChannel channel = new AgentForwardedChannel(clientSock, channelType); AgentServerProxy.this.service.registerChannel(channel); channel.open().verify(session.getLongProperty(CHANNEL_OPEN_TIMEOUT_PROP, DEFAULT_CHANNEL_OPEN_TIMEOUT)); } catch (Exception e) { if (debugEnabled) {
@Override protected synchronized void doWriteData(byte[] data, int off, long len) throws IOException { ValidateUtils.checkTrue(len <= Integer.MAX_VALUE, "Data length exceeds int boundaries: %d", len); Window wLocal = getLocalWindow(); wLocal.consumeAndCheck(len); int result = Socket.send(socket, data, off, (int) len); if (result < Status.APR_SUCCESS) { throw AgentServerProxy.toIOException(result); } } }
Socket.timeoutSet(clientSock, session.getIntProperty(AUTH_SOCKET_TIMEOUT, DEFAULT_AUTH_SOCKET_TIMEOUT)); String channelType = session.getStringProperty(PROXY_CHANNEL_TYPE, DEFAULT_PROXY_CHANNEL_TYPE); AgentForwardedChannel channel = new AgentForwardedChannel(clientSock, channelType); AgentServerProxy.this.service.registerChannel(channel); channel.open().verify(session.getLongProperty(CHANNEL_OPEN_TIMEOUT_PROP, DEFAULT_CHANNEL_OPEN_TIMEOUT)); } catch (Exception e) { if (debugEnabled) {
@Override protected synchronized void doWriteData(byte[] data, int off, long len) throws IOException { ValidateUtils.checkTrue(len <= Integer.MAX_VALUE, "Data length exceeds int boundaries: %d", len); Window wLocal = getLocalWindow(); wLocal.consumeAndCheck(len); int result = Socket.send(socket, data, off, (int) len); if (result < Status.APR_SUCCESS) { throw AgentServerProxy.toIOException(result); } } }
@Override public void run() { try { byte[] buf = new byte[1024]; OutputStream invIn = getInvertedIn(); while (true) { int result = Socket.recv(socket, buf, 0, buf.length); if (result == -Status.APR_EOF) { break; } else if (result < Status.APR_SUCCESS) { throw AgentServerProxy.toIOException(result); } invIn.write(buf, 0, result); invIn.flush(); } } catch (Exception e) { log.warn("Processing loop exception", e); } finally { close(false); } }
@Override protected synchronized void doOpen() throws IOException { ValidateUtils.checkTrue(!Streaming.Async.equals(streaming), "Asynchronous streaming isn't supported yet on this channel"); invertedIn = new ChannelOutputStream(this, getRemoteWindow(), log, SshConstants.SSH_MSG_CHANNEL_DATA, true); }