RSS

(root)/scache/head : 158

Radim Kolar
2009-09-16 11:14:37
Revision ID: radim_kolar-20090916111437-isunt52yqffdgpme
be bug compatible with server which broke HTTP/1.1 chunked encoding

collapse all collapse all

added added

removed removed

1238
      Update SGML documentation, removed outdated references to Java 1.1
1238
      Update SGML documentation, removed outdated references to Java 1.1
1239
      switched stat counters to AtomicInteger
1239
      switched stat counters to AtomicInteger
1240
      Some regexps didnt work - solved with switch to java regex
1240
      Some regexps didnt work - solved with switch to java regex
1241
      Dont try to create directory with * in name on windows machines
1241
      Dont try to create directory with * in name on windows machines
 
 
1242
 0.95
 
 
1243
      Fixed chunk HTTP/1.1 response handling. HTTP/1.1 standard requires zero sized
 
 
1244
       chunk at end of reply. Some servers, notably older versions of Apache 1.3 do
 
 
1245
       not send it and just close connection. Web browsers and W3C validator adapted
 
 
1246
       to this bug, so we should to. These servers are pretty rare, i know just about
 
 
1247
       2: docs.freebsd.org and www.pairs.net.       
1064
 long whenaborted;
1064
 long whenaborted;
1065
 boolean clientdead;
1065
 boolean clientdead;
1066
 boolean filedead;
1066
 boolean filedead;
 
 
1067
 boolean anychunkread;
1067
 DataInputStream sin=wc.webis;
1068
 DataInputStream sin=wc.webis;
1068
 byte b[]=new byte[4096];
1069
 byte b[]=new byte[4096];
1069
 clientdead=filedead=false;
1070
 clientdead=filedead=anychunkread=false;
1070
 whenaborted=0;
1071
 whenaborted=0;
1071
 int todo;
1072
 int todo;
1072
 if(wc.socket!=null) wc.socket.setSoTimeout(read_timeout);
1073
 if(wc.socket!=null) wc.socket.setSoTimeout(read_timeout);
1088
         String line;
1089
         String line;
1089
         line = sin.readLine ();
1090
         line = sin.readLine ();
1090
         if (line == null)
1091
         if (line == null)
1091
                 throw new IOException ("EOF when reading chunk block size");
1092
                 if (anychunkread)
 
 
1093
                         break chunk;
 
 
1094
                 else
 
 
1095
                     throw new IOException ("EOF when reading chunk block size");
1092
         StringTokenizer st = new StringTokenizer (line, "\t \n\r(;");
1096
         StringTokenizer st = new StringTokenizer (line, "\t \n\r(;");
1093
         if (st.hasMoreTokens ()) {
1097
         if (st.hasMoreTokens ()) {
1094
                 String hex = st.nextToken ();
1098
                 String hex = st.nextToken ();
1095
                 try {
1099
                 try {
1096
                         todo = Integer.parseInt (hex, 16);
1100
                         todo = Integer.parseInt (hex, 16);
 
 
1101
                         anychunkread=true;
1097
                 } 
1102
                 } 
1098
                 catch (NumberFormatException e) {
1103
                 catch (NumberFormatException e) {
1099
                         throw new IOException ("Chunk size is not a hex number: '" + line + "', '" + hex + "'.");
1104
                         throw new IOException ("Chunk size is not a hex number: '" + line + "', '" + hex + "'.");

Loggerhead is a web-based interface for Bazaar branches