Examples of wpos()


Examples of net.schmizz.sshj.common.SSHPacket.wpos()

        if (buffer.rpos() < 5) {
            log.warn("Performance cost: when sending a packet, ensure that "
                             + "5 bytes are available in front of the buffer");
            SSHPacket nb = new SSHPacket(buffer.available() + 5);
            nb.rpos(5);
            nb.wpos(5);
            nb.putBuffer(buffer);
            buffer = nb;
        }
        return buffer;
    }
View Full Code Here

Examples of org.apache.sshd.common.util.Buffer.wpos()

  protected void pumpInputStream() {
    try {
      while (!closeFuture.isClosed()) {
        Buffer buffer = session.createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_DATA, 0);
        buffer.putInt(recipient);
        int wpos1 = buffer.wpos(); // keep buffer position to write data length later
        buffer.putInt(0);
        int wpos2 = buffer.wpos(); // keep buffer position for data write
        buffer.wpos(wpos2 + remoteWindow.getPacketSize()); // Make room
        int len = securedRead(in, buffer.array(), wpos2, remoteWindow.getPacketSize()); // read data into buffer
        if (len > 0) {
View Full Code Here

Examples of org.apache.sshd.common.util.Buffer.wpos()

      while (!closeFuture.isClosed()) {
        Buffer buffer = session.createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_DATA, 0);
        buffer.putInt(recipient);
        int wpos1 = buffer.wpos(); // keep buffer position to write data length later
        buffer.putInt(0);
        int wpos2 = buffer.wpos(); // keep buffer position for data write
        buffer.wpos(wpos2 + remoteWindow.getPacketSize()); // Make room
        int len = securedRead(in, buffer.array(), wpos2, remoteWindow.getPacketSize()); // read data into buffer
        if (len > 0) {
          buffer.wpos(wpos1);
          buffer.putInt(len);
View Full Code Here

Examples of org.apache.sshd.common.util.Buffer.wpos()

        Buffer buffer = session.createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_DATA, 0);
        buffer.putInt(recipient);
        int wpos1 = buffer.wpos(); // keep buffer position to write data length later
        buffer.putInt(0);
        int wpos2 = buffer.wpos(); // keep buffer position for data write
        buffer.wpos(wpos2 + remoteWindow.getPacketSize()); // Make room
        int len = securedRead(in, buffer.array(), wpos2, remoteWindow.getPacketSize()); // read data into buffer
        if (len > 0) {
          buffer.wpos(wpos1);
          buffer.putInt(len);
          buffer.wpos(wpos2 + len);
View Full Code Here

Examples of org.apache.sshd.common.util.Buffer.wpos()

        buffer.putInt(0);
        int wpos2 = buffer.wpos(); // keep buffer position for data write
        buffer.wpos(wpos2 + remoteWindow.getPacketSize()); // Make room
        int len = securedRead(in, buffer.array(), wpos2, remoteWindow.getPacketSize()); // read data into buffer
        if (len > 0) {
          buffer.wpos(wpos1);
          buffer.putInt(len);
          buffer.wpos(wpos2 + len);
          remoteWindow.waitAndConsume(len);
          log.debug("Send SSH_MSG_CHANNEL_DATA on channel {}", id);
          session.writePacket(buffer);
View Full Code Here

Examples of org.apache.sshd.common.util.Buffer.wpos()

        buffer.wpos(wpos2 + remoteWindow.getPacketSize()); // Make room
        int len = securedRead(in, buffer.array(), wpos2, remoteWindow.getPacketSize()); // read data into buffer
        if (len > 0) {
          buffer.wpos(wpos1);
          buffer.putInt(len);
          buffer.wpos(wpos2 + len);
          remoteWindow.waitAndConsume(len);
          log.debug("Send SSH_MSG_CHANNEL_DATA on channel {}", id);
          session.writePacket(buffer);
        } else {
          // This is the bug fix we need!!
View Full Code Here

Examples of org.apache.sshd.common.util.Buffer.wpos()

                }
                Buffer buffer = new Buffer(length + 4);
                buffer.putInt(length);
                int nb = length;
                while (nb > 0) {
                    int l = dis.read(buffer.array(), buffer.wpos(), nb);
                    if (l < 0) {
                        throw new IllegalArgumentException();
                    }
                    buffer.wpos(buffer.wpos() + l);
                    nb -= l;
View Full Code Here

Examples of org.apache.sshd.common.util.Buffer.wpos()

                while (nb > 0) {
                    int l = dis.read(buffer.array(), buffer.wpos(), nb);
                    if (l < 0) {
                        throw new IllegalArgumentException();
                    }
                    buffer.wpos(buffer.wpos() + l);
                    nb -= l;
                }
                process(buffer);
            }
        } catch (Throwable t) {
View Full Code Here

Examples of org.apache.sshd.common.util.Buffer.wpos()

                while (nb > 0) {
                    int l = dis.read(buffer.array(), buffer.wpos(), nb);
                    if (l < 0) {
                        throw new IllegalArgumentException();
                    }
                    buffer.wpos(buffer.wpos() + l);
                    nb -= l;
                }
                process(buffer);
            }
        } catch (Throwable t) {
View Full Code Here

Examples of org.apache.sshd.common.util.Buffer.wpos()

    protected void sendName(int id, Iterator<SshFile> files) throws IOException {
        Buffer buffer = new Buffer();
        buffer.putByte((byte) SSH_FXP_NAME);
        buffer.putInt(id);
        int wpos = buffer.wpos();
        buffer.putInt(0);
        int nb = 0;
        while (files.hasNext() && buffer.wpos() < MAX_PACKET_LENGTH) {
            SshFile f = files.next();
            buffer.putString(f.getName());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.