Update of /cvsroot/freenet/freenet/src/freenet/session
In directory sc8-pr-cvs1:/tmp/cvs-serv13542/src/freenet/session
Modified Files:
FnpLink.java Link.java PlainLink.java
Log Message:
6179:
Fix zab's deadlocks.
Add setTrailerStream to MessageSendCallback. Now we can theoretically send any message
fully async (we don't yet use it except in the below).
Add some new files, PeerHandler, PeerPacket, PeerPacketMessage, which will be used for
a major refactoring of ConnectionHandler and separation of the message queue into a
per-peer thing, rather than a per-connection thing. Not integrated yet, so should be
harmless.
toString(), logging. Add log messages for long messageInitialStateTime's.
Add getCipher() to CipherOutputStream, for future use in refactoring and possibly
elsewhere, and Link.encryptBytes(byte[]) for similar use.
Index: FnpLink.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/session/FnpLink.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- FnpLink.java 30 Aug 2003 23:16:54 -0000 1.29
+++ FnpLink.java 8 Sep 2003 17:03:04 -0000 1.30
@@ -22,7 +22,7 @@
protected InputStream in;
- protected OutputStream out;
+ protected CipherOutputStream out;
protected AdapterOutputStream innerOut;
protected AdapterInputStream innerIn;
protected Connection conn;
@@ -787,8 +787,12 @@
}
}
+ public void encryptBytes(byte[] buf) {
+ out.getCipher().blockEncipher(buf, 0, buf.length);
+ }
+
// FIXME: neither of these should be inner classes
-
+
protected class AdapterOutputStream extends FilterOutputStream {
AdapterOutputStream() {
Index: Link.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/session/Link.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Link.java 19 Jun 2003 13:31:25 -0000 1.2
+++ Link.java 8 Sep 2003 17:03:05 -0000 1.3
@@ -82,12 +82,17 @@
*/
public LinkManager getManager();
- /*
+ /**
+ * Encrypt some bytes in-place for transmission in order
+ */
+ public void encryptBytes(byte[] data);
+
+ /**
* Wrap the (raw) InputStream given
*/
public InputStream makeInputStream(InputStream is);
- /*
+ /**
* Wrap the (raw) OutputStream given
*/
public OutputStream makeOutputStream(OutputStream os);
Index: PlainLink.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/session/PlainLink.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PlainLink.java 28 Jun 2003 16:10:22 -0000 1.3
+++ PlainLink.java 8 Sep 2003 17:03:05 -0000 1.4
@@ -105,6 +105,10 @@
return is;
}
+ public void encryptBytes(byte[] b) {
+ // Do nothing!
+ }
+
/**
* Does nothing!
*/
_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs