Package org.eclipse.jgit.transport

Examples of org.eclipse.jgit.transport.PacketLineIn


    try {
      // The client may be in a state where they have sent the sideband
      // capability and are expecting a response in the sideband, but we might
      // not have an UploadPack, or it might not have read any of the request.
      // So, cheat and read the first line.
      String line = new PacketLineIn(req.getInputStream()).readString();
      UploadPack.FirstLine parsed = new UploadPack.FirstLine(line);
      return (parsed.getOptions().contains(OPTION_SIDE_BAND)
          || parsed.getOptions().contains(OPTION_SIDE_BAND_64K));
    } catch (IOException e) {
      // Probably the connection is closed and a subsequent write will fail, but
View Full Code Here


    try {
      // The client may be in a state where they have sent the sideband
      // capability and are expecting a response in the sideband, but we might
      // not have a ReceivePack, or it might not have read any of the request.
      // So, cheat and read the first line.
      String line = new PacketLineIn(req.getInputStream()).readString();
      ReceivePack.FirstLine parsed = new ReceivePack.FirstLine(line);
      return parsed.getCapabilities().contains(CAPABILITY_SIDE_BAND_64K);
    } catch (IOException e) {
      // Probably the connection is closed and a subsequent write will fail, but
      // try it just in case.
View Full Code Here

    rawIn = new BufferedInputStream(sock.getInputStream());
    rawOut = new SafeBufferedOutputStream(sock.getOutputStream());

    if (0 < daemon.getTimeout())
      sock.setSoTimeout(daemon.getTimeout() * 1000);
    String cmd = new PacketLineIn(rawIn).readStringRaw();
    final int nul = cmd.indexOf('\0');
    if (nul >= 0) {
      // Newer clients hide a "host" header behind this byte.
      // Currently we don't use it for anything, so we ignore
      // this portion of the command.
View Full Code Here

    try {
      // The client may be in a state where they have sent the sideband
      // capability and are expecting a response in the sideband, but we might
      // not have an UploadPack, or it might not have read any of the request.
      // So, cheat and read the first line.
      String line = new PacketLineIn(req.getInputStream()).readString();
      UploadPack.FirstLine parsed = new UploadPack.FirstLine(line);
      return (parsed.getOptions().contains(OPTION_SIDE_BAND)
          || parsed.getOptions().contains(OPTION_SIDE_BAND_64K));
    } catch (IOException e) {
      // Probably the connection is closed and a subsequent write will fail, but
View Full Code Here

    try {
      // The client may be in a state where they have sent the sideband
      // capability and are expecting a response in the sideband, but we might
      // not have a ReceivePack, or it might not have read any of the request.
      // So, cheat and read the first line.
      String line = new PacketLineIn(req.getInputStream()).readString();
      ReceivePack.FirstLine parsed = new ReceivePack.FirstLine(line);
      return parsed.getCapabilities().contains(CAPABILITY_SIDE_BAND_64K);
    } catch (IOException e) {
      // Probably the connection is closed and a subsequent write will fail, but
      // try it just in case.
View Full Code Here

      assertEquals(GitSmartHttpTools.RECEIVE_PACK_RESULT_TYPE,
          c.getContentType());

      InputStream rawin = c.getInputStream();
      try {
        PacketLineIn pckin = new PacketLineIn(rawin);
        assertEquals("unpack error "
            + JGitText.get().packfileIsTruncated,
            pckin.readString());
        assertEquals("ng refs/objects/A n/a (unpacker error)",
            pckin.readString());
        assertSame(PacketLineIn.END, pckin.readString());
      } finally {
        rawin.close();
      }
    } finally {
      c.disconnect();
View Full Code Here

        rawOut = new SafeBufferedOutputStream( sock.getOutputStream() );

        if ( 0 < daemon.getTimeout() ) {
            sock.setSoTimeout( daemon.getTimeout() * 1000 );
        }
        String cmd = new PacketLineIn( rawIn ).readStringRaw();
        final int nul = cmd.indexOf( '\0' );
        if ( nul >= 0 ) {
            // Newer clients hide a "host" header behind this byte.
            // Currently we don't use it for anything, so we ignore
            // this portion of the command.
View Full Code Here

    try {
      // The client may be in a state where they have sent the sideband
      // capability and are expecting a response in the sideband, but we might
      // not have an UploadPack, or it might not have read any of the request.
      // So, cheat and read the first line.
      String line = new PacketLineIn(req.getInputStream()).readString();
      UploadPack.FirstLine parsed = new UploadPack.FirstLine(line);
      return (parsed.getOptions().contains(OPTION_SIDE_BAND)
          || parsed.getOptions().contains(OPTION_SIDE_BAND_64K));
    } catch (IOException e) {
      // Probably the connection is closed and a subsequent write will fail, but
View Full Code Here

    try {
      // The client may be in a state where they have sent the sideband
      // capability and are expecting a response in the sideband, but we might
      // not have a ReceivePack, or it might not have read any of the request.
      // So, cheat and read the first line.
      String line = new PacketLineIn(req.getInputStream()).readString();
      ReceivePack.FirstLine parsed = new ReceivePack.FirstLine(line);
      return parsed.getCapabilities().contains(CAPABILITY_SIDE_BAND_64K);
    } catch (IOException e) {
      // Probably the connection is closed and a subsequent write will fail, but
      // try it just in case.
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.transport.PacketLineIn

Copyright © 2018 www.massapicom. 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.