Author: nextgens
Date: 2007-04-12 14:32:34 +0000 (Thu, 12 Apr 2007)
New Revision: 12605
Modified:
trunk/freenet/src/freenet/node/fcp/ClientGet.java
trunk/freenet/src/freenet/node/fcp/FCPClient.java
trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
Log:
Wire in TestDDA and ClientGet... others will follow.
It might break things.
Modified: trunk/freenet/src/freenet/node/fcp/ClientGet.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ClientGet.java 2007-04-12 14:17:46 UTC
(rev 12604)
+++ trunk/freenet/src/freenet/node/fcp/ClientGet.java 2007-04-12 14:32:34 UTC
(rev 12605)
@@ -90,7 +90,9 @@
this.targetFile = returnFilename;
this.tempFile = returnTempFilename;
if(!(client.core.allowDownloadTo(returnTempFilename) &&
client.core.allowDownloadTo(returnFilename)))
- throw new NotAllowedException();
+ throw new NotAllowedException();
+ else
if(!(client.getConnection().allowDDAFrom(returnTempFilename, true) &&
client.getConnection().allowDDAFrom(returnFilename, true)))
+ throw new NotAllowedException();
ret = new FileBucket(returnTempFilename, false, true,
false, false, false);
} else if(returnType == ClientGetMessage.RETURN_TYPE_NONE) {
targetFile = null;
@@ -149,7 +151,9 @@
this.targetFile = message.diskFile;
this.tempFile = message.tempFile;
if(!(client.core.allowDownloadTo(tempFile) &&
client.core.allowDownloadTo(targetFile)))
- throw new
MessageInvalidException(ProtocolErrorMessage.ACCESS_DENIED, "Not allowed to
download to "+tempFile+" or "+targetFile, identifier, global);
+ throw new
MessageInvalidException(ProtocolErrorMessage.ACCESS_DENIED, "Not allowed to
download to "+tempFile+" or "+targetFile, identifier, global);
+ else if(!(client.getConnection().allowDDAFrom(tempFile,
true) && client.getConnection().allowDDAFrom(targetFile, true)))
+ throw new
MessageInvalidException(ProtocolErrorMessage.ACCESS_DENIED, "Not allowed to
download to "+tempFile+" or "+targetFile + ". You might need to do a " +
TestDDARequestMessage.name + " first.", identifier, global);
ret = new FileBucket(message.tempFile, false, true,
false, false, false);
} else if(returnType == ClientGetMessage.RETURN_TYPE_NONE) {
targetFile = null;
Modified: trunk/freenet/src/freenet/node/fcp/FCPClient.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPClient.java 2007-04-12 14:17:46 UTC
(rev 12604)
+++ trunk/freenet/src/freenet/node/fcp/FCPClient.java 2007-04-12 14:32:34 UTC
(rev 12605)
@@ -54,7 +54,7 @@
/** The FCPServer */
final FCPServer server;
/** The current connection handler, if any. */
- private FCPConnectionHandler currentConnection;
+ protected FCPConnectionHandler currentConnection;
/** Currently running persistent requests */
private final HashSet runningPersistentRequests;
/** Completed unacknowledged persistent requests */
Modified: trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
2007-04-12 14:17:46 UTC (rev 12604)
+++ trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
2007-04-12 14:32:34 UTC (rev 12605)
@@ -295,7 +295,7 @@
* @param writeRequest : Are willing to write or to read ?
* @return boolean : allowed or not
*/
- protected boolean allowUploadFrom(File filename, boolean writeRequest) {
+ protected boolean allowDDAFrom(File filename, boolean writeRequest) {
String parentDirectory =
FileUtil.getCanonicalFile(filename).getPath();
DirectoryAccess da = null;