Author: nextgens
Date: 2007-04-12 17:51:49 +0000 (Thu, 12 Apr 2007)
New Revision: 12612

Modified:
   trunk/freenet/src/freenet/node/fcp/ClientGet.java
   trunk/freenet/src/freenet/node/fcp/ClientPut.java
   trunk/freenet/src/freenet/node/fcp/ProtocolErrorMessage.java
Log:
Create ProtocolErrorMessage.DIRECT_DISK_ACCESS_DENIED=25 and send it where 
needed

Modified: trunk/freenet/src/freenet/node/fcp/ClientGet.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ClientGet.java   2007-04-12 16:16:20 UTC 
(rev 12611)
+++ trunk/freenet/src/freenet/node/fcp/ClientGet.java   2007-04-12 17:51:49 UTC 
(rev 12612)
@@ -151,7 +151,7 @@
                        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);
                        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);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.DIRECT_DISK_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/ClientPut.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ClientPut.java   2007-04-12 16:16:20 UTC 
(rev 12611)
+++ trunk/freenet/src/freenet/node/fcp/ClientPut.java   2007-04-12 17:51:49 UTC 
(rev 12612)
@@ -144,7 +144,7 @@
                        
if(!handler.server.core.allowUploadFrom(message.origFilename))
                                throw new 
MessageInvalidException(ProtocolErrorMessage.ACCESS_DENIED, "Not allowed to 
upload from "+message.origFilename, identifier, global);
                        else if(!handler.allowDDAFrom(message.origFilename, 
false))
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.ACCESS_DENIED, "Not allowed to 
upload from "+message.origFilename+". Have you done a testDDA previously ?", 
identifier, global);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.DIRECT_DISK_ACCESS_DENIED, "Not 
allowed to upload from "+message.origFilename+". Have you done a testDDA 
previously ?", identifier, global);
                }
                this.targetFilename = message.targetFilename;
                logMINOR = Logger.shouldLog(Logger.MINOR, this);

Modified: trunk/freenet/src/freenet/node/fcp/ProtocolErrorMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ProtocolErrorMessage.java        
2007-04-12 16:16:20 UTC (rev 12611)
+++ trunk/freenet/src/freenet/node/fcp/ProtocolErrorMessage.java        
2007-04-12 17:51:49 UTC (rev 12612)
@@ -46,6 +46,7 @@
        static final int FILE_PARSE_ERROR = 22;
        static final int NOT_A_FILE_ERROR = 23;
        static final int ACCESS_DENIED = 24;
+       static final int DIRECT_DISK_ACCESS_DENIED = 25;

        final int code;
        final String extra;


Reply via email to