hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carl A. Dunham" <c...@carldunham.com>
Subject Re: CRLF and Connection: close
Date Thu, 20 Mar 2003 19:53:46 GMT
BTW, here is a quick patch to "degrade" the code to work with these types of 
messages:


*** HttpParser.java~    Tue Feb 25 10:22:00 2003
--- HttpParser.java     Thu Mar 20 02:06:02 2003
***************
*** 53,61 ****
                      break;
                  }
                  buf.write(ch);
!                 if (ch == '\n') {
!                     break;
!                 }
              }
          }
          if (WIRE_LOG.isDebugEnabled()) {
--- 53,61 ----
                      break;
                  }
                  buf.write(ch);
!             }
!             if (ch == '\n') {
!                 break;
              }
          }
          if (WIRE_LOG.isDebugEnabled()) {
***************
*** 88,93 ****
--- 88,95 ----
          int len = rawdata.length;
          if (( len >= 2) && (rawdata[len - 2] == '\r') && (rawdata[len
- 1] == '\n')) {
              return HttpConstants.getString(rawdata, 0, rawdata.length - 2);
+         } else if (( len >= 1) && (rawdata[len - 1] == '\n')) {
+             return HttpConstants.getString(rawdata, 0, rawdata.length - 1);
          } else {
              return HttpConstants.getString(rawdata);


Note that the wire log message still needs to be changed, if this is an appropriate 
fix.

Thanks!


Mime
View raw message