test/jdk/java/net/httpclient/DigestEchoServer.java
branchhttp-client-branch
changeset 56054 352e845ae744
parent 56041 b4b5e09ef3cc
child 56070 66a9c3185028
equal deleted inserted replaced
56053:8588095e95b0 56054:352e845ae744
  1432                         System.out.println(now() + "Tunnel: Sending "
  1432                         System.out.println(now() + "Tunnel: Sending "
  1433                                            + response);
  1433                                            + response);
  1434                         pw.print(response);
  1434                         pw.print(response);
  1435                         pw.flush();
  1435                         pw.flush();
  1436                     } else {
  1436                     } else {
  1437                         // This should not happen. If it does let our serverImpl
  1437                         // This should not happen. If it does then just print an
  1438                         // deal with it.
  1438                         // error - both on out and err, and close the accepted
  1439                         throw new IOException("Tunnel: Unexpected status line: "
  1439                         // socket
  1440                                              + requestLine);
  1440                         System.out.println("WARNING: Tunnel: Unexpected status line: "
       
  1441                                 + requestLine + " received by "
       
  1442                                 + ss.getLocalSocketAddress()
       
  1443                                 + " from "
       
  1444                                 + toClose.getRemoteSocketAddress()
       
  1445                                 + " - closing accepted socket");
       
  1446                         // Print on err
       
  1447                         System.err.println("WARNING: Tunnel: Unexpected status line: "
       
  1448                                              + requestLine + " received by "
       
  1449                                            + ss.getLocalSocketAddress()
       
  1450                                            + " from "
       
  1451                                            + toClose.getRemoteSocketAddress());
       
  1452                         // close accepted socket.
       
  1453                         toClose.close();
       
  1454                         System.err.println("Tunnel: accepted socket closed.");
       
  1455                         continue;
  1441                     }
  1456                     }
  1442 
  1457 
  1443                     // Pipe the input stream of the client connection to the
  1458                     // Pipe the input stream of the client connection to the
  1444                     // output stream of the target connection and conversely.
  1459                     // output stream of the target connection and conversely.
  1445                     // Now the client and target will just talk to each other.
  1460                     // Now the client and target will just talk to each other.