[Swift-commit] Cog update

swift at ci.uchicago.edu swift at ci.uchicago.edu
Mon Apr 30 22:40:03 CDT 2012


------------------------------------------------------------------------
r3399 | hategan | 2012-04-30 22:39:36 -0500 (Mon, 30 Apr 2012) | 1 line

don't do payload checksum; TCP does that; keep header checksum to detect problems with the code
------------------------------------------------------------------------
Index: modules/karajan/src/org/globus/cog/karajan/workflow/service/channels/Sender.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/workflow/service/channels/Sender.java	(revision 3398)
+++ modules/karajan/src/org/globus/cog/karajan/workflow/service/channels/Sender.java	(working copy)
@@ -22,6 +22,8 @@
 class Sender extends Thread {
     public static final Logger logger = Logger.getLogger(Sender.class);
     
+    public static final boolean PAYLOAD_CHECKSUM = false;
+    
 	private final BlockingQueue<SendEntry> queue;
 	private final byte[] shdr;
 	private final String name;
@@ -110,9 +112,12 @@
         AbstractStreamKarajanChannel.pack(hdr, 4, flags);
         AbstractStreamKarajanChannel.pack(hdr, 8, data.length);
         AbstractStreamKarajanChannel.pack(hdr, 12, tag ^ flags ^ data.length);
-        Adler32 csum = new Adler32();
-        csum.update(data);
-        AbstractStreamKarajanChannel.pack(hdr, 16, (int) csum.getValue());
+        if (PAYLOAD_CHECKSUM) {
+        	Adler32 csum = new Adler32();
+        	csum.update(data);
+        	AbstractStreamKarajanChannel.pack(hdr, 16, (int) csum.getValue());
+        }
+        AbstractStreamKarajanChannel.pack(hdr, 16, 0);
 	}
 
 	private void send(int tag, int flags, byte[] data, OutputStream os) throws IOException {



More information about the Swift-commit mailing list