Uploaded image for project: 'MINA'
  1. MINA
  2. DIRMINA-1074

HttpServerDecoder bug

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Abandoned
    • Affects Version/s: 2.0.16
    • Fix Version/s: None
    • Component/s: Protocol - HTTP
    • Labels:
      None

      Description

      I used TCP to simulate a non normal HTTP get request
      StringBuilder sb = new StringBuilder("GET");
      sb.append(" ");
      sb.append("/system.ini?loginuse&loginpas");
      sb.append(" ");
      sb.append("HTTP/1.1");
      sb.append("\r\n");

      sb.append("Connection");
      sb.append(": ");
      sb.append("keep-alive");
      sb.append("\r\n");

      sb.append("Host");
      sb.append(": ");
      sb.append("host");
      sb.append("\r\n");
      sb.append("\r\n");
      //error data
      sb.append("000");
      sb.append("000");
      byte[] bytes = sb.toString().getBytes();
      Socket socket = new Socket("localhost", 8001);
      OutputStream outputStream = socket.getOutputStream();
      outputStream.write(bytes);
      outputStream.flush();

      After parsing a request, HttpServerDecoder returns to ProtocolCodecFilter,
      When you find that there is data in buffer, you will continue to call the HttpServerDecoder.decode method

      Since the request header string is used directly in parseHttpRequestHead (buffer.array), the program is stuck in a dead loop
      final String raw = new String(buffer.array(), 0, buffer.limit());

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              chenqiang1 chenqiang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: