Update of /cvsroot/monetdb/clients/src/java/src/nl/cwi/monetdb/mcl/net
In directory 
sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12644/src/nl/cwi/monetdb/mcl/net

Modified Files:
      Tag: Clients_1-20
        MapiSocket.java 
Log Message:
Fix confusing error messages.  Since with merovingian we quite often are
redirected, the originally connected to host/port need not to be the
currently connected to host/port.  To make this clear, show in
connection error messages what host/port they occurred on, so it is
clear that not merovingian is killing the connection, but mserver5 does.


Index: MapiSocket.java
===================================================================
RCS file: 
/cvsroot/monetdb/clients/src/java/src/nl/cwi/monetdb/mcl/net/MapiSocket.java,v
retrieving revision 1.9.2.3
retrieving revision 1.9.2.4
diff -u -d -r1.9.2.3 -r1.9.2.4
--- MapiSocket.java     17 Nov 2007 20:59:03 -0000      1.9.2.3
+++ MapiSocket.java     22 Nov 2007 22:26:05 -0000      1.9.2.4
@@ -236,7 +236,9 @@
                int lineType;
                do {
                        if ((tmp = reader.readLine()) == null)
-                               throw new IOException("Connection to server 
lost!");
+                               throw new IOException("Read from " +
+                                               
con.getInetAddress().getHostAddress() + ":" +
+                                               con.getPort() + ": End of 
stream reached");
                        if ((lineType = reader.getLineType()) == 
BufferedMCLReader.ERROR) {
                                err += "\n" + tmp.substring(1);
                        } else if (lineType == BufferedMCLReader.INFO) {
@@ -655,7 +657,9 @@
                                                        logRd("the following 
incomplete block was received:");
                                                        logRx(new String(b, 0, 
off, "UTF-8"));
                                                }
-                                               throw new 
IOException("Incomplete block read from stream");
+                                               throw new IOException("Read 
from " +
+                                                               
con.getInetAddress().getHostAddress() + ":" +
+                                                               con.getPort() + 
": Incomplete block read from stream");
                                        }
                                        return(false);
                                }
@@ -692,7 +696,9 @@
                private void readBlock() throws IOException {
                        // read next two bytes (short)
                        if (!_read(blklen, 2)) throw
-                               new IOException("End of stream reached");
+                               new IOException("Read from " +
+                                               
con.getInetAddress().getHostAddress() + ":" +
+                                               con.getPort() + ": End of 
stream reached");
 
                        // Get the short-value and store its value in blockLen.
                        blockLen = (short)(
@@ -716,7 +722,9 @@
                                                "larger than BLOCKsize: " +
                                                blockLen + " > " + 
block.length);
                        if (!_read(block, blockLen))
-                               throw new IOException("End of stream reached");
+                               new IOException("Read from " +
+                                               
con.getInetAddress().getHostAddress() + ":" +
+                                               con.getPort() + ": End of 
stream reached");
 
                        if (debug) {
                                logRx(new String(block, 0, blockLen, "UTF-8"));


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to