Author: toad
Date: 2006-12-12 02:54:51 +0000 (Tue, 12 Dec 2006)
New Revision: 11352

Modified:
   trunk/freenet/src/freenet/node/fcp/AddPeer.java
   trunk/freenet/src/freenet/node/fcp/AllDataMessage.java
   trunk/freenet/src/freenet/node/fcp/ClientGet.java
   trunk/freenet/src/freenet/node/fcp/ClientGetMessage.java
   trunk/freenet/src/freenet/node/fcp/ClientHelloMessage.java
   trunk/freenet/src/freenet/node/fcp/ClientPutBase.java
   trunk/freenet/src/freenet/node/fcp/ClientPutComplexDirMessage.java
   trunk/freenet/src/freenet/node/fcp/ClientPutDirMessage.java
   trunk/freenet/src/freenet/node/fcp/ClientPutDiskDirMessage.java
   trunk/freenet/src/freenet/node/fcp/ClientPutMessage.java
   
trunk/freenet/src/freenet/node/fcp/CloseConnectionDuplicateClientNameMessage.java
   trunk/freenet/src/freenet/node/fcp/ConfigData.java
   trunk/freenet/src/freenet/node/fcp/DataCarryingMessage.java
   trunk/freenet/src/freenet/node/fcp/DataFoundMessage.java
   trunk/freenet/src/freenet/node/fcp/DirPutFile.java
   trunk/freenet/src/freenet/node/fcp/DirectDirPutFile.java
   trunk/freenet/src/freenet/node/fcp/DiskDirPutFile.java
   trunk/freenet/src/freenet/node/fcp/EndListPeerNotesMessage.java
   trunk/freenet/src/freenet/node/fcp/EndListPeersMessage.java
   trunk/freenet/src/freenet/node/fcp/EndListPersistentRequestsMessage.java
   trunk/freenet/src/freenet/node/fcp/FCPClient.java
   trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
   trunk/freenet/src/freenet/node/fcp/FCPConnectionInputHandler.java
   trunk/freenet/src/freenet/node/fcp/FCPMessage.java
   trunk/freenet/src/freenet/node/fcp/FinishedCompressionMessage.java
   trunk/freenet/src/freenet/node/fcp/GetFailedMessage.java
   trunk/freenet/src/freenet/node/fcp/GetRequestStatusMessage.java
   trunk/freenet/src/freenet/node/fcp/IdentifierCollisionMessage.java
   trunk/freenet/src/freenet/node/fcp/MessageInvalidException.java
   trunk/freenet/src/freenet/node/fcp/ModifyPeerNote.java
   trunk/freenet/src/freenet/node/fcp/ModifyPersistentRequest.java
   trunk/freenet/src/freenet/node/fcp/NodeData.java
   trunk/freenet/src/freenet/node/fcp/NodeHelloMessage.java
   trunk/freenet/src/freenet/node/fcp/Peer.java
   trunk/freenet/src/freenet/node/fcp/PeerNote.java
   trunk/freenet/src/freenet/node/fcp/PeerRemoved.java
   trunk/freenet/src/freenet/node/fcp/PersistentGet.java
   trunk/freenet/src/freenet/node/fcp/PersistentPut.java
   trunk/freenet/src/freenet/node/fcp/PersistentPutDir.java
   trunk/freenet/src/freenet/node/fcp/ProtocolErrorMessage.java
   trunk/freenet/src/freenet/node/fcp/PutFailedMessage.java
   trunk/freenet/src/freenet/node/fcp/PutFetchableMessage.java
   trunk/freenet/src/freenet/node/fcp/PutSuccessfulMessage.java
   trunk/freenet/src/freenet/node/fcp/RedirectDirPutFile.java
   trunk/freenet/src/freenet/node/fcp/RemovePersistentRequest.java
   trunk/freenet/src/freenet/node/fcp/SSKKeypairMessage.java
   trunk/freenet/src/freenet/node/fcp/ShutdownMessage.java
   trunk/freenet/src/freenet/node/fcp/SimpleProgressMessage.java
   trunk/freenet/src/freenet/node/fcp/StartedCompressionMessage.java
   trunk/freenet/src/freenet/node/fcp/SubscribeUSKMessage.java
   trunk/freenet/src/freenet/node/fcp/SubscribedUSKUpdate.java
   trunk/freenet/src/freenet/node/fcp/URIGeneratedMessage.java
   trunk/freenet/src/freenet/node/fcp/UnknownNodeIdentifierMessage.java
   trunk/freenet/src/freenet/node/fcp/UnknownPeerNoteTypeMessage.java
   trunk/freenet/src/freenet/node/fcp/WatchGlobal.java
Log:
Add Global= to pretty much all FCP messages, *if and only if* the request is 
Global (most apps don't need to worry about the global queue).
Fixes #542.

Modified: trunk/freenet/src/freenet/node/fcp/AddPeer.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/AddPeer.java     2006-12-12 02:13:49 UTC 
(rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/AddPeer.java     2006-12-12 02:54:51 UTC 
(rev 11352)
@@ -56,26 +56,26 @@
                                }
                                in.close();
                        } catch (MalformedURLException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.URL_PARSE_ERROR, "Error parsing 
ref URL <"+urlString+">: "+e.getMessage(), null);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.URL_PARSE_ERROR, "Error parsing 
ref URL <"+urlString+">: "+e.getMessage(), null, false);
                        } catch (IOException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.URL_PARSE_ERROR, "IO error while 
retrieving ref URL <"+urlString+">: "+e.getMessage(), null);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.URL_PARSE_ERROR, "IO error while 
retrieving ref URL <"+urlString+">: "+e.getMessage(), null, false);
                        }
                        ref = new StringBuffer(ref.toString().trim());
                        if(ref == null) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
ref from URL <"+urlString+ '>', null);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
ref from URL <"+urlString+ '>', null, false);
                        }
                        if(ref.equals("")) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
ref from URL <"+urlString+ '>', null);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
ref from URL <"+urlString+ '>', null, false);
                        }
                        try {
                                fs = new SimpleFieldSet(ref.toString());
                        } catch (IOException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
ref from URL <"+urlString+">: "+e.getMessage(), null);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
ref from URL <"+urlString+">: "+e.getMessage(), null, false);
                        }
                } else if(fileString != null) {
                        File f = new File(fileString);
                        if(!f.isFile()) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.NOT_A_FILE_ERROR, "The given ref 
file path <"+fileString+"> is not a file", null);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.NOT_A_FILE_ERROR, "The given ref 
file path <"+fileString+"> is not a file", null, false);
                        }
                        try {
                                in = new BufferedReader(new FileReader(f));
@@ -87,33 +87,33 @@
                                }
                                in.close();
                        } catch (FileNotFoundException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.FILE_NOT_FOUND, "File not found 
when retrieving ref file <"+fileString+">: "+e.getMessage(), null);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.FILE_NOT_FOUND, "File not found 
when retrieving ref file <"+fileString+">: "+e.getMessage(), null, false);
                        } catch (IOException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.FILE_PARSE_ERROR, "IO error while 
retrieving ref file <"+fileString+">: "+e.getMessage(), null);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.FILE_PARSE_ERROR, "IO error while 
retrieving ref file <"+fileString+">: "+e.getMessage(), null, false);
                        }
                        ref = new StringBuffer(ref.toString().trim());
                        if(ref == null) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
ref from file <"+fileString+ '>', null);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
ref from file <"+fileString+ '>', null, false);
                        }
                        if(ref.equals("")) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
ref from file <"+fileString+ '>', null);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
ref from file <"+fileString+ '>', null, false);
                        }
                        try {
                                fs = new SimpleFieldSet(ref.toString());
                        } catch (IOException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
ref from file <"+fileString+">: "+e.getMessage(), null);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
ref from file <"+fileString+">: "+e.getMessage(), null, false);
                        }
                }
                PeerNode pn;
                try {
                        pn = new PeerNode(fs, node, false);
                } catch (FSParseException e) {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
retrieved ref: "+e.getMessage(), null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
retrieved ref: "+e.getMessage(), null, false);
                } catch (PeerParseException e) {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
retrieved ref: "+e.getMessage(), null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
retrieved ref: "+e.getMessage(), null, false);
                } catch (ReferenceSignatureVerificationException e) {
                        // TODO: maybe a special ProtocolErrorMessage ?
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
retrieved ref: "+e.getMessage(), null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.REF_PARSE_ERROR, "Error parsing 
retrieved ref: "+e.getMessage(), null, false);
                }
                // **FIXME** Handle duplicates somehow maybe?  What about when 
node.addDarknetConnection() fails for some reason?
                if(node.addDarknetConnection(pn))

Modified: trunk/freenet/src/freenet/node/fcp/AllDataMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/AllDataMessage.java      2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/AllDataMessage.java      2006-12-12 
02:54:51 UTC (rev 11352)
@@ -15,12 +15,14 @@
 public class AllDataMessage extends DataCarryingMessage {

        final long dataLength;
+       final boolean global;
        final String identifier;

-       public AllDataMessage(Bucket bucket, String identifier) {
+       public AllDataMessage(Bucket bucket, String identifier, boolean global) 
{
                this.bucket = bucket;
                this.dataLength = bucket.size();
                this.identifier = identifier;
+               this.global = global;
        }

        long dataLength() {
@@ -31,6 +33,7 @@
                SimpleFieldSet fs = new SimpleFieldSet();
                fs.put("DataLength", Long.toString(dataLength));
                fs.put("Identifier", identifier);
+               if(global) fs.put("Global", "true");
                return fs;
        }

@@ -39,11 +42,15 @@
        }

        public void run(FCPConnectionHandler handler, Node node) throws 
MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "AllData goes 
from server to client not the other way around", identifier);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "AllData goes 
from server to client not the other way around", identifier, global);
        }

        String getIdentifier() {
                return identifier;
        }

+       boolean isGlobal() {
+               return global;
+       }
+
 }

Modified: trunk/freenet/src/freenet/node/fcp/ClientGet.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ClientGet.java   2006-12-12 02:13:49 UTC 
(rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/ClientGet.java   2006-12-12 02:54:51 UTC 
(rev 11352)
@@ -243,7 +243,7 @@
                        } catch (IOException e) {
                                Logger.error(this, "Caught "+e, e);
                                succeeded = false;
-                               getFailedMessage = new GetFailedMessage(new 
FetchException(FetchException.BUCKET_ERROR, e), identifier);
+                               getFailedMessage = new GetFailedMessage(new 
FetchException(FetchException.BUCKET_ERROR, e), identifier, global);
                                ret = 
client.server.core.persistentTempBucketFactory.registerEncryptedBucket(fnam, 
key, 0);
                        }
                } else {
@@ -266,7 +266,7 @@

                if(finished){
                        if(succeeded) 
-                               allDataPending = new 
AllDataMessage(returnBucket, identifier);
+                               allDataPending = new 
AllDataMessage(returnBucket, identifier, global);
                        else
                                started = true;
                }
@@ -308,7 +308,7 @@
                        if(returnType == ClientGetMessage.RETURN_TYPE_DIRECT) {
                                // Send all the data at once
                                // FIXME there should be other options
-                               adm = new AllDataMessage(data, identifier);
+                               adm = new AllDataMessage(data, identifier, 
global);
                                if(persistenceType == PERSIST_CONNECTION)
                                        adm.setFreeOnSent();
                                dontFree = true;
@@ -330,14 +330,14 @@
                                                }
                                        }
                                        if(!tempFile.renameTo(targetFile)) {
-                                               postFetchProtocolErrorMessage = 
new ProtocolErrorMessage(ProtocolErrorMessage.COULD_NOT_RENAME_FILE, false, 
null, identifier);
+                                               postFetchProtocolErrorMessage = 
new ProtocolErrorMessage(ProtocolErrorMessage.COULD_NOT_RENAME_FILE, false, 
null, identifier, global);
                                                // Don't delete temp file, user 
might want it.
                                        }
                                        returnBucket = new 
FileBucket(targetFile, false, false, false, false);
                                } catch (FileNotFoundException e) {
-                                       postFetchProtocolErrorMessage = new 
ProtocolErrorMessage(ProtocolErrorMessage.COULD_NOT_WRITE_FILE, false, null, 
identifier);
+                                       postFetchProtocolErrorMessage = new 
ProtocolErrorMessage(ProtocolErrorMessage.COULD_NOT_WRITE_FILE, false, null, 
identifier, global);
                                } catch (IOException e) {
-                                       postFetchProtocolErrorMessage = new 
ProtocolErrorMessage(ProtocolErrorMessage.COULD_NOT_WRITE_FILE, false, null, 
identifier);
+                                       postFetchProtocolErrorMessage = new 
ProtocolErrorMessage(ProtocolErrorMessage.COULD_NOT_WRITE_FILE, false, null, 
identifier, global);
                                }
                                try {
                                        if((fos != null) && !closed)
@@ -368,7 +368,7 @@
                // Don't need to lock. succeeded is only ever set, never unset.
                // and succeeded and getFailedMessage are both atomic.
                if(succeeded) {
-                       msg = new DataFoundMessage(foundDataLength, 
foundDataMimeType, identifier);
+                       msg = new DataFoundMessage(foundDataLength, 
foundDataMimeType, identifier, global);
                } else {
                        msg = getFailedMessage;
                }
@@ -432,7 +432,7 @@
        public void onFailure(FetchException e, ClientGetter state) {
                synchronized(this) {
                        succeeded = false;
-                       getFailedMessage = new GetFailedMessage(e, identifier);
+                       getFailedMessage = new GetFailedMessage(e, identifier, 
global);
                        finished = true;
                }
                if(Logger.shouldLog(Logger.MINOR, this))
@@ -462,7 +462,7 @@
                                (ce instanceof SplitfileProgressEvent)))
                        return;
                SimpleProgressMessage progress =
-                       new SimpleProgressMessage(identifier, 
(SplitfileProgressEvent)ce);
+                       new SimpleProgressMessage(identifier, global, 
(SplitfileProgressEvent)ce);
                trySendProgress(progress, null);
        }


Modified: trunk/freenet/src/freenet/node/fcp/ClientGetMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ClientGetMessage.java    2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/ClientGetMessage.java    2006-12-12 
02:54:51 UTC (rev 11352)
@@ -69,11 +69,11 @@
                dsOnly = Fields.stringToBool(fs.get("DSOnly"), false);
                identifier = fs.get("Identifier");
                if(identifier == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No Identifier", 
null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No Identifier", 
null, global);
                try {
                        uri = new FreenetURI(fs.get("URI"));
                } catch (MalformedURLException e) {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.URI_PARSE_ERROR, e.getMessage(), 
identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.URI_PARSE_ERROR, e.getMessage(), 
identifier, global);
                }
                String verbosityString = fs.get("Verbosity");
                if(verbosityString == null)
@@ -82,7 +82,7 @@
                        try {
                                verbosity = Integer.parseInt(verbosityString, 
10);
                        } catch (NumberFormatException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing Verbosity field: "+e.getMessage(), identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing Verbosity field: "+e.getMessage(), identifier, global);
                        }
                }
                String returnTypeString = fs.get("ReturnType");
@@ -100,24 +100,24 @@
                        defaultPriority = 
RequestStarter.BULK_SPLITFILE_PRIORITY_CLASS;
                        String filename = fs.get("Filename");
                        if(filename == null)
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Missing Filename", 
identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Missing Filename", 
identifier, global);
                        diskFile = new File(filename);
                        String tempFilename = fs.get("TempFilename");
                        if(tempFilename == null)
                                tempFilename = filename + ".freenet-tmp";
                        tempFile = new File(tempFilename);
                        
if(!diskFile.getAbsoluteFile().getParentFile().equals(tempFile.getAbsoluteFile().getParentFile()))
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.FILENAME_AND_TEMP_FILENAME_MUST_BE_IN_SAME_DIR,
 null, identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.FILENAME_AND_TEMP_FILENAME_MUST_BE_IN_SAME_DIR,
 null, identifier, global);
                        if(diskFile.exists())
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.DISK_TARGET_EXISTS, null, 
identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.DISK_TARGET_EXISTS, null, 
identifier, global);
                        try {
                                if(!(tempFile.createNewFile() || 
(tempFile.exists() && tempFile.canRead() && tempFile.canWrite())))
-                                       throw new 
MessageInvalidException(ProtocolErrorMessage.COULD_NOT_CREATE_FILE, "Could not 
create temp file "+tempFile, identifier);
+                                       throw new 
MessageInvalidException(ProtocolErrorMessage.COULD_NOT_CREATE_FILE, "Could not 
create temp file "+tempFile, identifier, global);
                        } catch (IOException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.COULD_NOT_CREATE_FILE, 
e.getMessage(), identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.COULD_NOT_CREATE_FILE, 
e.getMessage(), identifier, global);
                        }
                } else
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MESSAGE_PARSE_ERROR, "Unknown 
return-type", identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MESSAGE_PARSE_ERROR, "Unknown 
return-type", identifier, global);
                String maxSizeString = fs.get("MaxSize");
                if(maxSizeString == null)
                        // default to unlimited
@@ -126,7 +126,7 @@
                        try {
                                maxSize = Long.parseLong(maxSizeString, 10);
                        } catch (NumberFormatException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing MaxSize field: "+e.getMessage(), identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing MaxSize field: "+e.getMessage(), identifier, global);
                        }
                }
                String maxTempSizeString = fs.get("MaxTempSize");
@@ -137,7 +137,7 @@
                        try {
                                maxTempSize = Long.parseLong(maxTempSizeString, 
10);
                        } catch (NumberFormatException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing MaxSize field: "+e.getMessage(), identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing MaxSize field: "+e.getMessage(), identifier, global);
                        }
                }
                String maxRetriesString = fs.get("MaxRetries");
@@ -148,7 +148,7 @@
                        try {
                                maxRetries = Integer.parseInt(maxRetriesString, 
10);
                        } catch (NumberFormatException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing MaxSize field: "+e.getMessage(), identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing MaxSize field: "+e.getMessage(), identifier, global);
                        }
                }
                if(Logger.shouldLog(Logger.MINOR, this))
@@ -161,9 +161,9 @@
                        try {
                                priorityClass = 
Short.parseShort(priorityString, 10);
                                if((priorityClass < 
RequestStarter.MAXIMUM_PRIORITY_CLASS) || (priorityClass > 
RequestStarter.MINIMUM_PRIORITY_CLASS))
-                                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Valid priorities 
are from "+RequestStarter.MAXIMUM_PRIORITY_CLASS+" to 
"+RequestStarter.MINIMUM_PRIORITY_CLASS, identifier);
+                                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Valid priorities 
are from "+RequestStarter.MAXIMUM_PRIORITY_CLASS+" to 
"+RequestStarter.MINIMUM_PRIORITY_CLASS, identifier, global);
                        } catch (NumberFormatException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing PriorityClass field: "+e.getMessage(), identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing PriorityClass field: "+e.getMessage(), identifier, global);
                        }
                }
                String persistenceString = fs.get("Persistence");
@@ -178,10 +178,10 @@
                        // Same as reboot but saved to disk, persists forever.
                        persistenceType = ClientRequest.PERSIST_FOREVER;
                } else {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing Persistence field: "+persistenceString, identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing Persistence field: "+persistenceString, identifier, global);
                }
                if(global && (persistenceType == 
ClientRequest.PERSIST_CONNECTION)) {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.NOT_SUPPORTED, "Global requests 
must be persistent", identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.NOT_SUPPORTED, "Global requests 
must be persistent", identifier, global);
                }
        }


Modified: trunk/freenet/src/freenet/node/fcp/ClientHelloMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ClientHelloMessage.java  2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/ClientHelloMessage.java  2006-12-12 
02:54:51 UTC (rev 11352)
@@ -22,9 +22,9 @@
                clientName = fs.get("Name");
                clientExpectedVersion = fs.get("ExpectedVersion");
                if(clientName == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "ClientHello must 
contain a Name field", null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "ClientHello must 
contain a Name field", null, false);
                if(clientExpectedVersion == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "ClientHello must 
contain a ExpectedVersion field", null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "ClientHello must 
contain a ExpectedVersion field", null, false);
                // FIXME check the expected version
        }


Modified: trunk/freenet/src/freenet/node/fcp/ClientPutBase.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ClientPutBase.java       2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/ClientPutBase.java       2006-12-12 
02:54:51 UTC (rev 11352)
@@ -117,7 +117,7 @@
        public void onFailure(InserterException e, BaseClientPutter state) {
                synchronized(this) {
                        finished = true;
-                       putFailedMessage = new PutFailedMessage(e, identifier);
+                       putFailedMessage = new PutFailedMessage(e, identifier, 
global);
                }
                trySendFinalMessage(null);
                freeData();
@@ -140,19 +140,19 @@
                if(ce instanceof SplitfileProgressEvent) {
                        if((verbosity & VERBOSITY_SPLITFILE_PROGRESS) == 
VERBOSITY_SPLITFILE_PROGRESS) {
                                SimpleProgressMessage progress = 
-                                       new SimpleProgressMessage(identifier, 
(SplitfileProgressEvent)ce);
+                                       new SimpleProgressMessage(identifier, 
global, (SplitfileProgressEvent)ce);
                                trySendProgressMessage(progress, 
VERBOSITY_SPLITFILE_PROGRESS, null);
                        }
                } else if(ce instanceof StartedCompressionEvent) {
                        if((verbosity & VERBOSITY_COMPRESSION_START_END) == 
VERBOSITY_COMPRESSION_START_END) {
                                StartedCompressionMessage msg =
-                                       new 
StartedCompressionMessage(identifier, ((StartedCompressionEvent)ce).codec);
+                                       new 
StartedCompressionMessage(identifier, global, 
((StartedCompressionEvent)ce).codec);
                                trySendProgressMessage(msg, 
VERBOSITY_COMPRESSION_START_END, null);
                        }
                } else if(ce instanceof FinishedCompressionEvent) {
                        if((verbosity & VERBOSITY_COMPRESSION_START_END) == 
VERBOSITY_COMPRESSION_START_END) {
                                FinishedCompressionMessage msg = 
-                                       new 
FinishedCompressionMessage(identifier, (FinishedCompressionEvent)ce);
+                                       new 
FinishedCompressionMessage(identifier, global, (FinishedCompressionEvent)ce);
                                trySendProgressMessage(msg, 
VERBOSITY_COMPRESSION_START_END, null);
                        }
                }
@@ -166,7 +166,7 @@
                                temp = generatedURI;
                        }
                        PutFetchableMessage msg =
-                               new PutFetchableMessage(identifier, temp);
+                               new PutFetchableMessage(identifier, global, 
temp);
                        trySendProgressMessage(msg, VERBOSITY_PUT_FETCHABLE, 
null);
                }
        }
@@ -176,7 +176,7 @@
                FCPMessage msg;
                synchronized (this) {
                        if(succeeded) {
-                               msg = new PutSuccessfulMessage(identifier, 
generatedURI);
+                               msg = new PutSuccessfulMessage(identifier, 
global, generatedURI);
                        } else {
                                msg = putFailedMessage;
                        }

Modified: trunk/freenet/src/freenet/node/fcp/ClientPutComplexDirMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ClientPutComplexDirMessage.java  
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/ClientPutComplexDirMessage.java  
2006-12-12 02:54:51 UTC (rev 11352)
@@ -59,12 +59,12 @@
                // Now parse the meat
                SimpleFieldSet files = fs.subset("Files");
                if(files == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Missing Files 
section", identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Missing Files 
section", identifier, global);
                boolean logMINOR = Logger.shouldLog(Logger.MINOR, this);
                for(int i=0;;i++) {
                        SimpleFieldSet subset = 
files.subset(Integer.toString(i));
                        if(subset == null) break;
-                       DirPutFile f = DirPutFile.create(subset, identifier, 
(persistenceType == ClientRequest.PERSIST_FOREVER) ? bfPersistent : bfTemp);
+                       DirPutFile f = DirPutFile.create(subset, identifier, 
global, (persistenceType == ClientRequest.PERSIST_FOREVER) ? bfPersistent : 
bfTemp);
                        addFile(f);
                        if(logMINOR) Logger.minor(this, "Adding "+f);
                        if(f instanceof DirectDirPutFile) {
@@ -97,7 +97,7 @@
                                        addFile((HashMap)o, after, f);
                                        return;
                                } else {
-                                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "Cannot be both a 
file and a directory: "+before, identifier);
+                                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "Cannot be both a 
file and a directory: "+before, identifier, global);
                                }
                        } else {
                                o = new HashMap();

Modified: trunk/freenet/src/freenet/node/fcp/ClientPutDirMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ClientPutDirMessage.java 2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/ClientPutDirMessage.java 2006-12-12 
02:54:51 UTC (rev 11352)
@@ -46,13 +46,14 @@

        public ClientPutDirMessage(SimpleFieldSet fs) throws 
MessageInvalidException {
                identifier = fs.get("Identifier");
+               global = Fields.stringToBool(fs.get("Global"), false);
                defaultName = fs.get("DefaultName");
                if(identifier == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No Identifier", 
null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No Identifier", 
null, global);
                try {
                        String u = fs.get("URI");
                        if(u == null)
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No URI", 
identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No URI", 
identifier, global);
                        FreenetURI uu = new FreenetURI(fs.get("URI"));
                        // Client is allowed to put a slash at the end if it 
wants to, but this is discouraged.
                        String[] meta = uu.getAllMetaStrings();
@@ -60,9 +61,8 @@
                                uu = uu.setMetaString(null);
                        uri = uu;
                } catch (MalformedURLException e) {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.URI_PARSE_ERROR, e.getMessage(), 
identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.URI_PARSE_ERROR, e.getMessage(), 
identifier, global);
                }
-               global = Fields.stringToBool(fs.get("Global"), false);
                String verbosityString = fs.get("Verbosity");
                if(verbosityString == null)
                        verbosity = 0;
@@ -70,7 +70,7 @@
                        try {
                                verbosity = Integer.parseInt(verbosityString, 
10);
                        } catch (NumberFormatException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing Verbosity field: "+e.getMessage(), identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing Verbosity field: "+e.getMessage(), identifier, global);
                        }
                }
                String maxRetriesString = fs.get("MaxRetries");
@@ -81,7 +81,7 @@
                        try {
                                maxRetries = Integer.parseInt(maxRetriesString, 
10);
                        } catch (NumberFormatException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing MaxSize field: "+e.getMessage(), identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing MaxSize field: "+e.getMessage(), identifier, global);
                        }
                }
                getCHKOnly = Fields.stringToBool(fs.get("GetCHKOnly"), false);
@@ -93,9 +93,9 @@
                        try {
                                priorityClass = 
Short.parseShort(priorityString, 10);
                                if((priorityClass < 
RequestStarter.MAXIMUM_PRIORITY_CLASS) || (priorityClass > 
RequestStarter.MINIMUM_PRIORITY_CLASS))
-                                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Valid priorities 
are from "+RequestStarter.MAXIMUM_PRIORITY_CLASS+" to 
"+RequestStarter.MINIMUM_PRIORITY_CLASS, identifier);
+                                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Valid priorities 
are from "+RequestStarter.MAXIMUM_PRIORITY_CLASS+" to 
"+RequestStarter.MINIMUM_PRIORITY_CLASS, identifier, global);
                        } catch (NumberFormatException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing PriorityClass field: "+e.getMessage(), identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing PriorityClass field: "+e.getMessage(), identifier, global);
                        }
                }
                dontCompress = Fields.stringToBool(fs.get("DontCompress"), 
false);
@@ -111,7 +111,7 @@
                        // Same as reboot but saved to disk, persists forever.
                        persistenceType = ClientRequest.PERSIST_FOREVER;
                } else {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing Persistence field: "+persistenceString, identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing Persistence field: "+persistenceString, identifier, global);
                }
                clientToken = fs.get("ClientToken");
                earlyEncode = Fields.stringToBool(fs.get("EarlyEncode"), false);

Modified: trunk/freenet/src/freenet/node/fcp/ClientPutDiskDirMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ClientPutDiskDirMessage.java     
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/ClientPutDiskDirMessage.java     
2006-12-12 02:54:51 UTC (rev 11352)
@@ -39,7 +39,7 @@
                allowUnreadableFiles = 
Fields.stringToBool(fs.get("AllowUnreadableFiles"), false);
                String fnam = fs.get("Filename");
                if(fnam == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Filename missing", 
identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Filename missing", 
identifier, global);
                dirname = new File(fnam);
        }

@@ -84,10 +84,10 @@
                                HashMap subdir = makeBucketsByName(new 
File(thisdir, filelist[i].getName()), prefix + filelist[i].getName() + '/');
                                ret.put(filelist[i].getName(), subdir);
                        } else if(!allowUnreadableFiles) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.FILE_NOT_FOUND, "Not directory and 
not file: "+filelist[i], identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.FILE_NOT_FOUND, "Not directory and 
not file: "+filelist[i], identifier, global);
                        }
                } else {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.FILE_NOT_FOUND, "Not readable or 
doesn't exist: "+filelist[i], identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.FILE_NOT_FOUND, "Not readable or 
doesn't exist: "+filelist[i], identifier, global);
                }
        }
        return ret;

Modified: trunk/freenet/src/freenet/node/fcp/ClientPutMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ClientPutMessage.java    2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/ClientPutMessage.java    2006-12-12 
02:54:51 UTC (rev 11352)
@@ -65,12 +65,13 @@
        public ClientPutMessage(SimpleFieldSet fs) throws 
MessageInvalidException {
                String fnam = null;
                identifier = fs.get("Identifier");
+               global = Fields.stringToBool(fs.get("Global"), false);
                if(identifier == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No Identifier", 
null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No Identifier", 
null, global);
                try {
                        String u = fs.get("URI");
                        if(u == null)
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No URI", 
identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No URI", 
identifier, global);
                        FreenetURI uu = new FreenetURI(fs.get("URI"));
                        String[] metas = uu.getAllMetaStrings();
                        if(metas != null && metas.length == 1) {
@@ -79,9 +80,8 @@
                        } // if >1, will fail later
                        uri = uu;
                } catch (MalformedURLException e) {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.URI_PARSE_ERROR, e.getMessage(), 
identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.URI_PARSE_ERROR, e.getMessage(), 
identifier, global);
                }
-               global = Fields.stringToBool(fs.get("Global"), false);
                String verbosityString = fs.get("Verbosity");
                if(verbosityString == null)
                        verbosity = 0;
@@ -89,7 +89,7 @@
                        try {
                                verbosity = Integer.parseInt(verbosityString, 
10);
                        } catch (NumberFormatException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing Verbosity field: "+e.getMessage(), identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing Verbosity field: "+e.getMessage(), identifier, global);
                        }
                }
                contentType = fs.get("Metadata.ContentType");
@@ -101,7 +101,7 @@
                        try {
                                maxRetries = Integer.parseInt(maxRetriesString, 
10);
                        } catch (NumberFormatException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing MaxSize field: "+e.getMessage(), identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing MaxSize field: "+e.getMessage(), identifier, global);
                        }
                }
                getCHKOnly = Fields.stringToBool(fs.get("GetCHKOnly"), false);
@@ -113,9 +113,9 @@
                        try {
                                priorityClass = 
Short.parseShort(priorityString, 10);
                                if((priorityClass < 
RequestStarter.MAXIMUM_PRIORITY_CLASS) || (priorityClass > 
RequestStarter.MINIMUM_PRIORITY_CLASS))
-                                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Valid priorities 
are from "+RequestStarter.MAXIMUM_PRIORITY_CLASS+" to 
"+RequestStarter.MINIMUM_PRIORITY_CLASS, identifier);
+                                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Valid priorities 
are from "+RequestStarter.MAXIMUM_PRIORITY_CLASS+" to 
"+RequestStarter.MINIMUM_PRIORITY_CLASS, identifier, global);
                        } catch (NumberFormatException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing PriorityClass field: "+e.getMessage(), identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing PriorityClass field: "+e.getMessage(), identifier, global);
                        }
                }
                String uploadFrom = fs.get("UploadFrom");
@@ -123,11 +123,11 @@
                        uploadFromType = UPLOAD_FROM_DIRECT;
                        String dataLengthString = fs.get("DataLength");
                        if(dataLengthString == null)
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Need DataLength on 
a ClientPut", identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Need DataLength on 
a ClientPut", identifier, global);
                        try {
                                dataLength = Long.parseLong(dataLengthString, 
10);
                        } catch (NumberFormatException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing DataLength field: "+e.getMessage(), identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing DataLength field: "+e.getMessage(), identifier, global);
                        }
                        this.origFilename = null;
                        redirectTarget = null;
@@ -135,10 +135,10 @@
                        uploadFromType = UPLOAD_FROM_DISK;
                        String filename = fs.get("Filename");
                        if(filename == null)
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Missing field 
Filename", identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Missing field 
Filename", identifier, global);
                        File f = new File(filename);
                        if(!(f.exists() && f.isFile() && f.canRead()))
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.FILE_NOT_FOUND, null, identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.FILE_NOT_FOUND, null, identifier, 
global);
                        dataLength = f.length();
                        FileBucket fileBucket = new FileBucket(f, true, false, 
false, false);
                        this.bucket = fileBucket;
@@ -150,17 +150,17 @@
                        uploadFromType = UPLOAD_FROM_REDIRECT;
                        String target = fs.get("TargetURI");
                        if(target == null)
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "TargetURI missing 
but UploadFrom=redirect", identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "TargetURI missing 
but UploadFrom=redirect", identifier, global);
                        try {
                                redirectTarget = new FreenetURI(target);
                        } catch (MalformedURLException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Invalid TargetURI: 
"+e, identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Invalid TargetURI: 
"+e, identifier, global);
                        }
                        dataLength = 0;
                        origFilename = null;
                        bucket = null;
                } else
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "UploadFrom invalid 
or unrecognized: "+uploadFrom, identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "UploadFrom invalid 
or unrecognized: "+uploadFrom, identifier, global);
                dontCompress = Fields.stringToBool(fs.get("DontCompress"), 
false);
                String persistenceString = fs.get("Persistence");
                if((persistenceString == null) || 
persistenceString.equalsIgnoreCase("connection")) {
@@ -174,14 +174,14 @@
                        // Same as reboot but saved to disk, persists forever.
                        persistenceType = ClientRequest.PERSIST_FOREVER;
                } else {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing Persistence field: "+persistenceString, identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Error 
parsing Persistence field: "+persistenceString, identifier, global);
                }
                clientToken = fs.get("ClientToken");
                String f = fs.get("TargetFilename");
                if(f != null)
                        fnam = f;
                if(fnam != null && fnam.indexOf('/') > -1) {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "TargetFilename 
must not contain slashes", identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "TargetFilename 
must not contain slashes", identifier, global);
                }
                if(fnam != null && fnam.length() == 0) {
                        fnam = null; // Deliberate override to tell us not to 
create one.
@@ -262,5 +262,9 @@
                        throw new IllegalArgumentException();
                }
        }
+
+       boolean isGlobal() {
+               return global;
+       }

 }

Modified: 
trunk/freenet/src/freenet/node/fcp/CloseConnectionDuplicateClientNameMessage.java
===================================================================
--- 
trunk/freenet/src/freenet/node/fcp/CloseConnectionDuplicateClientNameMessage.java
   2006-12-12 02:13:49 UTC (rev 11351)
+++ 
trunk/freenet/src/freenet/node/fcp/CloseConnectionDuplicateClientNameMessage.java
   2006-12-12 02:54:51 UTC (rev 11352)
@@ -22,7 +22,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"CloseConnectionDuplicateClientName goes from server to client not the other 
way around", null);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"CloseConnectionDuplicateClientName goes from server to client not the other 
way around", null, false);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/ConfigData.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ConfigData.java  2006-12-12 02:13:49 UTC 
(rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/ConfigData.java  2006-12-12 02:54:51 UTC 
(rev 11352)
@@ -33,7 +33,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "ConfigData goes 
from server to client not the other way around", null);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "ConfigData goes 
from server to client not the other way around", null, false);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/DataCarryingMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/DataCarryingMessage.java 2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/DataCarryingMessage.java 2006-12-12 
02:54:51 UTC (rev 11352)
@@ -22,6 +22,7 @@
        }

        abstract String getIdentifier();
+       abstract boolean isGlobal();

        protected boolean freeOnSent;

@@ -39,7 +40,7 @@
                        tempBucket = createBucket(bf, len, server);
                } catch (IOException e) {
                        Logger.error(this, "Bucket error: "+e, e);
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.INTERNAL_ERROR, e.toString(), 
getIdentifier());
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.INTERNAL_ERROR, e.toString(), 
getIdentifier(), isGlobal());
                }
                BucketTools.copyFrom(tempBucket, is, len);
                this.bucket = tempBucket;

Modified: trunk/freenet/src/freenet/node/fcp/DataFoundMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/DataFoundMessage.java    2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/DataFoundMessage.java    2006-12-12 
02:54:51 UTC (rev 11352)
@@ -10,24 +10,28 @@
 public class DataFoundMessage extends FCPMessage {

        final String identifier;
+       final boolean global;
        final String mimeType;
        final long dataLength;

-       public DataFoundMessage(FetchResult fr, String identifier) {
+       public DataFoundMessage(FetchResult fr, String identifier, boolean 
global) {
                this.identifier = identifier;
+               this.global = global;
                this.mimeType = fr.getMimeType();
                this.dataLength = fr.size();
        }

-       public DataFoundMessage(long foundDataLength, String foundDataMimeType, 
String identifier2) {
+       public DataFoundMessage(long foundDataLength, String foundDataMimeType, 
String identifier, boolean global) {
                this.mimeType = foundDataMimeType;
-               this.identifier = identifier2;
+               this.identifier = identifier;
+               this.global = global;
                this.dataLength = foundDataLength;
        }

        public SimpleFieldSet getFieldSet() {
                SimpleFieldSet fs = new SimpleFieldSet();
                fs.put("Identifier", identifier);
+               if(global) fs.put("Global", "true");
                fs.put("Metadata.ContentType", mimeType);
                fs.put("DataLength", Long.toString(dataLength));
                return fs;
@@ -38,7 +42,7 @@
        }

        public void run(FCPConnectionHandler handler, Node node) throws 
MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "DataFound goes 
from server to client not the other way around", identifier);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "DataFound goes 
from server to client not the other way around", identifier, global);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/DirPutFile.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/DirPutFile.java  2006-12-12 02:13:49 UTC 
(rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/DirPutFile.java  2006-12-12 02:54:51 UTC 
(rev 11352)
@@ -20,10 +20,10 @@
        final String name;
        ClientMetadata meta;

-       public DirPutFile(SimpleFieldSet subset, String identifier) throws 
MessageInvalidException {
+       public DirPutFile(SimpleFieldSet subset, String identifier, boolean 
global) throws MessageInvalidException {
                this.name = subset.get("Name");
                if(name == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Missing field 
Name", identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Missing field 
Name", identifier, global);
                String contentTypeOverride = subset.get("Metadata.ContentType");
                if(contentTypeOverride != null) {
                        meta = new ClientMetadata(contentTypeOverride);
@@ -40,16 +40,16 @@
        /**
         * Create a DirPutFile from a SimpleFieldSet.
         */
-       public static DirPutFile create(SimpleFieldSet subset, String 
identifier, BucketFactory bf) throws MessageInvalidException {
+       public static DirPutFile create(SimpleFieldSet subset, String 
identifier, boolean global, BucketFactory bf) throws MessageInvalidException {
                String type = subset.get("UploadFrom");
                if((type == null) || type.equalsIgnoreCase("direct")) {
-                       return new DirectDirPutFile(subset, identifier, bf);
+                       return new DirectDirPutFile(subset, identifier, global, 
bf);
                } else if(type.equalsIgnoreCase("disk")) {
-                       return new DiskDirPutFile(subset, identifier);
+                       return new DiskDirPutFile(subset, identifier, global);
                } else if(type.equalsIgnoreCase("redirect")) {
-                       return new RedirectDirPutFile(subset, identifier);
+                       return new RedirectDirPutFile(subset, identifier, 
global);
                } else {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Unsupported or 
unknown UploadFrom: "+type, identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Unsupported or 
unknown UploadFrom: "+type, identifier, global);
                }
        }


Modified: trunk/freenet/src/freenet/node/fcp/DirectDirPutFile.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/DirectDirPutFile.java    2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/DirectDirPutFile.java    2006-12-12 
02:54:51 UTC (rev 11352)
@@ -17,20 +17,20 @@
        private final Bucket data;
        private final long length;

-       public DirectDirPutFile(SimpleFieldSet subset, String identifier, 
BucketFactory bf) throws MessageInvalidException {
-               super(subset, identifier);
+       public DirectDirPutFile(SimpleFieldSet subset, String identifier, 
boolean global, BucketFactory bf) throws MessageInvalidException {
+               super(subset, identifier, global);
                String s = subset.get("DataLength");
                if(s == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "UploadFrom=direct 
requires a DataLength for "+name, identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "UploadFrom=direct 
requires a DataLength for "+name, identifier, global);
                try {
                        length = Long.parseLong(s);
                } catch (NumberFormatException e) {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Could not 
parse DataLength: "+e.toString(), identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Could not 
parse DataLength: "+e.toString(), identifier, global);
                }
                try {
                        data = bf.makeBucket(length);
                } catch (IOException e) {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.INTERNAL_ERROR, "Internal error: 
could not allocate temp bucket: "+e.toString(), identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.INTERNAL_ERROR, "Internal error: 
could not allocate temp bucket: "+e.toString(), identifier, global);
                }
        }


Modified: trunk/freenet/src/freenet/node/fcp/DiskDirPutFile.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/DiskDirPutFile.java      2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/DiskDirPutFile.java      2006-12-12 
02:54:51 UTC (rev 11352)
@@ -14,11 +14,11 @@

        final File file;

-       public DiskDirPutFile(SimpleFieldSet subset, String identifier) throws 
MessageInvalidException {
-               super(subset, identifier);
+       public DiskDirPutFile(SimpleFieldSet subset, String identifier, boolean 
global) throws MessageInvalidException {
+               super(subset, identifier, global);
                String s = subset.get("Filename");
                if(s == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Missing field: 
Filename on "+name, identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Missing field: 
Filename on "+name, identifier, global);
                file = new File(s);
        }


Modified: trunk/freenet/src/freenet/node/fcp/EndListPeerNotesMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/EndListPeerNotesMessage.java     
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/EndListPeerNotesMessage.java     
2006-12-12 02:54:51 UTC (rev 11352)
@@ -27,7 +27,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "EndListPeerNotes 
goes from server to client not the other way around", null);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "EndListPeerNotes 
goes from server to client not the other way around", null, false);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/EndListPeersMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/EndListPeersMessage.java 2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/EndListPeersMessage.java 2006-12-12 
02:54:51 UTC (rev 11352)
@@ -20,7 +20,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "EndListPeers 
goes from server to client not the other way around", null);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "EndListPeers 
goes from server to client not the other way around", null, false);
        }

 }

Modified: 
trunk/freenet/src/freenet/node/fcp/EndListPersistentRequestsMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/EndListPersistentRequestsMessage.java    
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/EndListPersistentRequestsMessage.java    
2006-12-12 02:54:51 UTC (rev 11352)
@@ -20,7 +20,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"EndListPersistentRequests goes from server to client not the other way 
around", null);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"EndListPersistentRequests goes from server to client not the other way 
around", null, false);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/FCPClient.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPClient.java   2006-12-12 02:13:49 UTC 
(rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/FCPClient.java   2006-12-12 02:54:51 UTC 
(rev 11352)
@@ -165,9 +165,9 @@
                synchronized(this) {
                        req = (ClientRequest) 
clientRequestsByIdentifier.get(identifier);
                        if(req == null)
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.NO_SUCH_IDENTIFIER, "Not in hash", 
identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.NO_SUCH_IDENTIFIER, "Not in hash", 
identifier, isGlobalQueue);
                        else if(!(runningPersistentRequests.remove(req) || 
completedUnackedRequests.remove(req)))
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.NO_SUCH_IDENTIFIER, "Not found", 
identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.NO_SUCH_IDENTIFIER, "Not found", 
identifier, isGlobalQueue);
                        clientRequestsByIdentifier.remove(identifier);
                }
                if(kill) {

Modified: trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java        
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java        
2006-12-12 02:54:51 UTC (rev 11352)
@@ -124,7 +124,7 @@
                }
                if(!success) {
                        Logger.normal(this, "Identifier collision on "+this);
-                       FCPMessage msg = new IdentifierCollisionMessage(id);
+                       FCPMessage msg = new IdentifierCollisionMessage(id, 
message.global);
                        outputHandler.queue(msg);
                        return;
                } else {
@@ -164,7 +164,7 @@
                }
                if(!success) {
                        Logger.normal(this, "Identifier collision on "+this);
-                       FCPMessage msg = new IdentifierCollisionMessage(id);
+                       FCPMessage msg = new IdentifierCollisionMessage(id, 
message.global);
                        outputHandler.queue(msg);
                        return;
                } else {
@@ -205,7 +205,7 @@
                }
                if(!success) {
                        Logger.normal(this, "Identifier collision on "+this);
-                       FCPMessage msg = new IdentifierCollisionMessage(id);
+                       FCPMessage msg = new IdentifierCollisionMessage(id, 
message.global);
                        outputHandler.queue(msg);
                        return;
                } else {

Modified: trunk/freenet/src/freenet/node/fcp/FCPConnectionInputHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPConnectionInputHandler.java   
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/FCPConnectionInputHandler.java   
2006-12-12 02:54:51 UTC (rev 11352)
@@ -59,12 +59,12 @@
                                msg = FCPMessage.create(messageType, fs, 
handler.bf, handler.server.core.persistentTempBucketFactory);
                                if(msg == null) continue;
                        } catch (MessageInvalidException e) {
-                               FCPMessage err = new 
ProtocolErrorMessage(e.protocolCode, false, e.getMessage(), e.ident);
+                               FCPMessage err = new 
ProtocolErrorMessage(e.protocolCode, false, e.getMessage(), e.ident, false);
                                handler.outputHandler.queue(err);
                                continue;
                        }
                        if(firstMessage && !(msg instanceof 
ClientHelloMessage)) {
-                               FCPMessage err = new 
ProtocolErrorMessage(ProtocolErrorMessage.CLIENT_HELLO_MUST_BE_FIRST_MESSAGE, 
true, null, null);
+                               FCPMessage err = new 
ProtocolErrorMessage(ProtocolErrorMessage.CLIENT_HELLO_MUST_BE_FIRST_MESSAGE, 
true, null, null, false);
                                handler.outputHandler.queue(err);
                                handler.close();
                                continue;
@@ -74,20 +74,20 @@
                                try {
                                        
((BaseDataCarryingMessage)msg).readFrom(lis, handler.bf, handler.server);
                                } catch (MessageInvalidException e) {
-                                       FCPMessage err = new 
ProtocolErrorMessage(e.protocolCode, false, e.getMessage(), e.ident);
+                                       FCPMessage err = new 
ProtocolErrorMessage(e.protocolCode, false, e.getMessage(), e.ident, e.global);
                                        handler.outputHandler.queue(err);
                                        continue;
                                }
                        }
                        if((!firstMessage) && (msg instanceof 
ClientHelloMessage)) {
-                               FCPMessage err = new 
ProtocolErrorMessage(ProtocolErrorMessage.NO_LATE_CLIENT_HELLOS, false, null, 
null);
+                               FCPMessage err = new 
ProtocolErrorMessage(ProtocolErrorMessage.NO_LATE_CLIENT_HELLOS, false, null, 
null, false);
                                handler.outputHandler.queue(err);
                                continue;
                        }
                        try {
                                msg.run(handler, handler.server.node);
                        } catch (MessageInvalidException e) {
-                               FCPMessage err = new 
ProtocolErrorMessage(e.protocolCode, false, e.getMessage(), e.ident);
+                               FCPMessage err = new 
ProtocolErrorMessage(e.protocolCode, false, e.getMessage(), e.ident, e.global);
                                handler.outputHandler.queue(err);
                                continue;
                        }

Modified: trunk/freenet/src/freenet/node/fcp/FCPMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPMessage.java  2006-12-12 02:13:49 UTC 
(rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/FCPMessage.java  2006-12-12 02:54:51 UTC 
(rev 11352)
@@ -78,7 +78,7 @@
                        return null;
                if(name.equals(NodeHelloMessage.name))
                        return new NodeHelloMessage(fs);
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "Unknown message 
name "+name, null);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "Unknown message 
name "+name, null, false);
 //             if(name.equals("ClientPut"))
 //                     return new ClientPutFCPMessage(fs);
                // TODO Auto-generated method stub

Modified: trunk/freenet/src/freenet/node/fcp/FinishedCompressionMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FinishedCompressionMessage.java  
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/FinishedCompressionMessage.java  
2006-12-12 02:54:51 UTC (rev 11352)
@@ -10,15 +10,17 @@
 public class FinishedCompressionMessage extends FCPMessage {

        final String identifier;
+       final boolean global;
        final int codec;
        final long origSize;
        final long compressedSize;

-       public FinishedCompressionMessage(String identifier, 
FinishedCompressionEvent event) {
+       public FinishedCompressionMessage(String identifier, boolean global, 
FinishedCompressionEvent event) {
                this.identifier = identifier;
                this.codec = event.codec;
                this.compressedSize = event.compressedSize;
                this.origSize = event.originalSize;
+               this.global = global;
        }

        public SimpleFieldSet getFieldSet() {
@@ -27,6 +29,7 @@
                fs.put("Codec", Integer.toString(codec));
                fs.put("OriginalSize", Long.toString(origSize));
                fs.put("CompressedSize", Long.toString(compressedSize));
+               if(global) fs.put("Global", "true");
                return fs;
        }

@@ -35,7 +38,7 @@
        }

        public void run(FCPConnectionHandler handler, Node node) throws 
MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"FinishedCompression goes from server to client not the other way around", 
identifier);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"FinishedCompression goes from server to client not the other way around", 
identifier, global);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/GetFailedMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/GetFailedMessage.java    2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/GetFailedMessage.java    2006-12-12 
02:54:51 UTC (rev 11352)
@@ -22,12 +22,13 @@
        final FailureCodeTracker tracker;
        final boolean isFatal;
        final String identifier;
+       final boolean global;
        final long expectedDataLength;
        final String expectedMimeType;
        final boolean finalizedExpected;
        final FreenetURI redirectURI;

-       public GetFailedMessage(FetchException e, String identifier) {
+       public GetFailedMessage(FetchException e, String identifier, boolean 
global) {
                if(Logger.shouldLog(Logger.MINOR, this))
                        Logger.minor(this, "Creating get failed from "+e+" for 
"+identifier, e);
                this.tracker = e.errorCodes;
@@ -37,6 +38,7 @@
                this.shortCodeDescription = 
FetchException.getShortMessage(code);
                this.isFatal = e.isFatal();
                this.identifier = identifier;
+               this.global = global;
                this.expectedDataLength = e.expectedSize;
                this.expectedMimeType = e.getExpectedMimeType();
                this.finalizedExpected = e.finalizedSize();
@@ -84,6 +86,7 @@
                        this.redirectURI = new FreenetURI(s);
                else
                        this.redirectURI = null;
+               this.global = Fields.stringToBool(fs.get("Global"), false);
        }

        public SimpleFieldSet getFieldSet() {
@@ -128,7 +131,7 @@
        }

        public void run(FCPConnectionHandler handler, Node node) throws 
MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "FetchError goes 
from server to client not the other way around", identifier);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "FetchError goes 
from server to client not the other way around", identifier, global);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/GetRequestStatusMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/GetRequestStatusMessage.java     
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/GetRequestStatusMessage.java     
2006-12-12 02:54:51 UTC (rev 11352)
@@ -38,7 +38,7 @@
                } else
                        req = handler.getClient().getRequest(identifier);
                if(req == null) {
-                       ProtocolErrorMessage msg = new 
ProtocolErrorMessage(ProtocolErrorMessage.NO_SUCH_IDENTIFIER, false, null, 
identifier);
+                       ProtocolErrorMessage msg = new 
ProtocolErrorMessage(ProtocolErrorMessage.NO_SUCH_IDENTIFIER, false, null, 
identifier, global);
                        handler.outputHandler.queue(msg);
                } else {
                        req.sendPendingMessages(handler.outputHandler, true, 
true, onlyData);

Modified: trunk/freenet/src/freenet/node/fcp/IdentifierCollisionMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/IdentifierCollisionMessage.java  
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/IdentifierCollisionMessage.java  
2006-12-12 02:54:51 UTC (rev 11352)
@@ -9,14 +9,17 @@
 public class IdentifierCollisionMessage extends FCPMessage {

        final String identifier;
+       final boolean global;

-       public IdentifierCollisionMessage(String id) {
+       public IdentifierCollisionMessage(String id, boolean global) {
                this.identifier = id;
+               this.global = global;
        }

        public SimpleFieldSet getFieldSet() {
                SimpleFieldSet sfs = new SimpleFieldSet();
                sfs.put("Identifier", identifier);
+               if(global) sfs.put("Global", "true");
                return sfs;
        }

@@ -26,7 +29,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"IdentifierCollision goes from server to client not the other way around", 
identifier);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"IdentifierCollision goes from server to client not the other way around", 
identifier, global);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/MessageInvalidException.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/MessageInvalidException.java     
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/MessageInvalidException.java     
2006-12-12 02:54:51 UTC (rev 11352)
@@ -12,13 +12,15 @@
 public class MessageInvalidException extends Exception {
        private static final long serialVersionUID = -1;

-       int protocolCode;
-       public String ident;
+       final int protocolCode;
+       public final String ident;
+       public final boolean global;

-       public MessageInvalidException(int protocolCode, String extra, String 
ident) {
+       public MessageInvalidException(int protocolCode, String extra, String 
ident, boolean global) {
                super(extra);
                this.protocolCode = protocolCode;
                this.ident = ident;
+               this.global = global;
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/ModifyPeerNote.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ModifyPeerNote.java      2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/ModifyPeerNote.java      2006-12-12 
02:54:51 UTC (rev 11352)
@@ -33,7 +33,7 @@
        public void run(FCPConnectionHandler handler, Node node) throws 
MessageInvalidException {
                String nodeIdentifier = fs.get("NodeIdentifier");
                if( nodeIdentifier == null ) {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Error: 
NodeIdentifier field missing", null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Error: 
NodeIdentifier field missing", null, false);
                }
                PeerNode pn = node.getPeerNode(nodeIdentifier);
                if(pn == null) {
@@ -45,11 +45,11 @@
                try {
                        peerNoteType = fs.getInt("PeerNoteType");
                } catch (FSParseException e) {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Error parsing 
PeerNoteType field: "+e.getMessage(), null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Error parsing 
PeerNoteType field: "+e.getMessage(), null, false);
                }
                String encodedNoteText = fs.get("NoteText");
                if( encodedNoteText == null ) {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Error: NoteText 
field missing", null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Error: NoteText 
field missing", null, false);
                }
                String noteText;
                // **FIXME** this should be generalized for multiple peer notes 
per peer, after PeerNode is similarly generalized

Modified: trunk/freenet/src/freenet/node/fcp/ModifyPersistentRequest.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ModifyPersistentRequest.java     
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/ModifyPersistentRequest.java     
2006-12-12 02:54:51 UTC (rev 11352)
@@ -32,19 +32,19 @@
        final String clientToken;

        ModifyPersistentRequest(SimpleFieldSet fs) throws 
MessageInvalidException {
+               this.global = Fields.stringToBool(fs.get("Global"), false);
                this.identifier = fs.get("Identifier");
                this.clientToken = fs.get("ClientToken");
                if(identifier == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Missing field: 
Identifier", null);
-               this.global = Fields.stringToBool(fs.get("Global"), false);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Missing field: 
Identifier", null, global);
                String prio = fs.get("PriorityClass");
                if(prio != null) {
                        try {
                                priorityClass = Short.parseShort(prio);
                                
if(!RequestStarter.isValidPriorityClass(priorityClass))
-                                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Invalid priority 
class "+priorityClass+" - range is "+RequestStarter.MINIMUM_PRIORITY_CLASS+" to 
"+RequestStarter.MAXIMUM_PRIORITY_CLASS, identifier);
+                                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Invalid priority 
class "+priorityClass+" - range is "+RequestStarter.MINIMUM_PRIORITY_CLASS+" to 
"+RequestStarter.MAXIMUM_PRIORITY_CLASS, identifier, global);
                        } catch (NumberFormatException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Could not 
parse PriorityClass: "+e.getMessage(), identifier);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, "Could not 
parse PriorityClass: "+e.getMessage(), identifier, global);
                        }
                } else
                        priorityClass = -1;

Modified: trunk/freenet/src/freenet/node/fcp/NodeData.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/NodeData.java    2006-12-12 02:13:49 UTC 
(rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/NodeData.java    2006-12-12 02:54:51 UTC 
(rev 11352)
@@ -41,7 +41,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "NodeData goes 
from server to client not the other way around", null);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "NodeData goes 
from server to client not the other way around", null, false);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/NodeHelloMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/NodeHelloMessage.java    2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/NodeHelloMessage.java    2006-12-12 
02:54:51 UTC (rev 11352)
@@ -32,25 +32,25 @@
        public NodeHelloMessage(SimpleFieldSet fs) throws 
MessageInvalidException {     
                this.nodeNode = fs.get("Node");
                if(nodeNode == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No Node!", null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No Node!", null, 
false);
                else if(!nodeNode.equals("Fred"))
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Not talking to 
Fred!", null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Not talking to 
Fred!", null, false);

                this.nodeFCPVersion = fs.get("FCPVersion");
                if(nodeFCPVersion == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No FCPVersion!", 
null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No FCPVersion!", 
null, false);
                else if(!nodeFCPVersion.equals("2.0"))
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.NOT_SUPPORTED, "FCPVersion is 
incompatible!", null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.NOT_SUPPORTED, "FCPVersion is 
incompatible!", null, false);

                this.nodeVersion = fs.get("Version");
                if(nodeVersion == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No Version!", 
null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No Version!", 
null, false);
                else if(!nodeVersion.startsWith("Fred,0.7,1.0,"))
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.NOT_SUPPORTED, "Fred Version is 
incompatible!", null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.NOT_SUPPORTED, "Fred Version is 
incompatible!", null, false);

                this.nodeCompressionCodecs = fs.get("CompressionCodecs");
                if(nodeCompressionCodecs == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No 
CompressionCodecs!", null);   
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No 
CompressionCodecs!", null, false);

                this.isTestnet = Fields.stringToBool(fs.get("Testnet"), false);
        }
@@ -79,7 +79,7 @@
        }

        public void run(FCPConnectionHandler handler, Node node) throws 
MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "NodeHello goes 
from server to client not the other way around", null);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "NodeHello goes 
from server to client not the other way around", null, false);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/Peer.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/Peer.java        2006-12-12 02:13:49 UTC 
(rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/Peer.java        2006-12-12 02:54:51 UTC 
(rev 11352)
@@ -43,7 +43,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "Peer goes from 
server to client not the other way around", null);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "Peer goes from 
server to client not the other way around", null, false);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/PeerNote.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/PeerNote.java    2006-12-12 02:13:49 UTC 
(rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/PeerNote.java    2006-12-12 02:54:51 UTC 
(rev 11352)
@@ -34,7 +34,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PeerNote goes 
from server to client not the other way around", null);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PeerNote goes 
from server to client not the other way around", null, false);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/PeerRemoved.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/PeerRemoved.java 2006-12-12 02:13:49 UTC 
(rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/PeerRemoved.java 2006-12-12 02:54:51 UTC 
(rev 11352)
@@ -30,7 +30,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PeerRemoved goes 
from server to client not the other way around", null);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PeerRemoved goes 
from server to client not the other way around", null, false);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/PersistentGet.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/PersistentGet.java       2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/PersistentGet.java       2006-12-12 
02:54:51 UTC (rev 11352)
@@ -74,7 +74,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PersistentGet 
goes from server to client not the other way around", identifier);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PersistentGet 
goes from server to client not the other way around", identifier, global);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/PersistentPut.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/PersistentPut.java       2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/PersistentPut.java       2006-12-12 
02:54:51 UTC (rev 11352)
@@ -82,7 +82,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PersistentPut 
goes from server to client not the other way around", identifier);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PersistentPut 
goes from server to client not the other way around", identifier, global);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/PersistentPutDir.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/PersistentPutDir.java    2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/PersistentPutDir.java    2006-12-12 
02:54:51 UTC (rev 11352)
@@ -101,7 +101,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PersistentPut 
goes from server to client not the other way around", identifier);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PersistentPut 
goes from server to client not the other way around", identifier, global);
        }



Modified: trunk/freenet/src/freenet/node/fcp/ProtocolErrorMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ProtocolErrorMessage.java        
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/ProtocolErrorMessage.java        
2006-12-12 02:54:51 UTC (rev 11352)
@@ -50,6 +50,7 @@
        final String extra;
        final boolean fatal;
        final String ident;
+       final boolean global;

        private String codeDescription() {
                switch(code) {
@@ -105,11 +106,12 @@
                }
        }

-       public ProtocolErrorMessage(int code, boolean fatal, String extra, 
String ident) {
+       public ProtocolErrorMessage(int code, boolean fatal, String extra, 
String ident, boolean global) {
                this.code = code;
                this.extra = extra;
                this.fatal = fatal;
                this.ident = ident;
+               this.global = global;
        }

        public ProtocolErrorMessage(SimpleFieldSet fs) {
@@ -117,6 +119,7 @@
                code = Integer.parseInt(fs.get("Code"));
                extra = fs.get("ExtraDescription");
                fatal = Fields.stringToBool(fs.get("Fatal"), false);
+               global = Fields.stringToBool(fs.get("Global"), false);
        }

        public SimpleFieldSet getFieldSet() {
@@ -128,6 +131,8 @@
                if(extra != null)
                        sfs.put("ExtraDescription", extra);
                sfs.put("Fatal", Boolean.toString(fatal));
+               if(global)
+                       sfs.put("Global", "true");
                return sfs;
        }


Modified: trunk/freenet/src/freenet/node/fcp/PutFailedMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/PutFailedMessage.java    2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/PutFailedMessage.java    2006-12-12 
02:54:51 UTC (rev 11352)
@@ -21,9 +21,10 @@
        final FailureCodeTracker tracker;
        final FreenetURI expectedURI;
        final String identifier;
+       final boolean global;
        final boolean isFatal;

-       public PutFailedMessage(InserterException e, String identifier) {
+       public PutFailedMessage(InserterException e, String identifier, boolean 
global) {
                this.code = e.getMode();
                this.codeDescription = InserterException.getMessage(code);
                this.shortCodeDescription = 
InserterException.getShortMessage(code);
@@ -31,6 +32,7 @@
                this.tracker = e.errorCodes;
                this.expectedURI = e.uri;
                this.identifier = identifier;
+               this.global = global;
                this.isFatal = InserterException.isFatal(code);
        }

@@ -45,6 +47,7 @@
        public PutFailedMessage(SimpleFieldSet fs, boolean useVerboseFields) 
throws MalformedURLException {
                identifier = fs.get("Identifier");
                if(identifier == null) throw new NullPointerException();
+               global = fs.getBoolean("Global", false);
                code = Integer.parseInt(fs.get("Code"));

                if(useVerboseFields) {
@@ -78,6 +81,7 @@
        public SimpleFieldSet getFieldSet(boolean verbose) {
                SimpleFieldSet fs = new SimpleFieldSet();
                fs.put("Identifier", identifier);
+               if(global) fs.put("Global", "true");
                fs.put("Code", Integer.toString(code));
                if(verbose)
                        fs.put("CodeDescription", codeDescription);
@@ -101,7 +105,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PutFailed goes 
from server to client not the other way around", identifier);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PutFailed goes 
from server to client not the other way around", identifier, global);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/PutFetchableMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/PutFetchableMessage.java 2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/PutFetchableMessage.java 2006-12-12 
02:54:51 UTC (rev 11352)
@@ -9,17 +9,20 @@

 public class PutFetchableMessage extends FCPMessage {

-       PutFetchableMessage(String ident, FreenetURI uri) {
+       PutFetchableMessage(String ident, boolean global, FreenetURI uri) {
                this.identifier = ident;
+               this.global = global;
                this.uri = uri;
        }

        final String identifier;
+       final boolean global;
        final FreenetURI uri;

        public SimpleFieldSet getFieldSet() {
                SimpleFieldSet fs = new SimpleFieldSet();
                fs.put("Identifier", identifier);
+               if(global) fs.put("Global", "true");
                if(uri != null)
                        fs.put("URI", uri.toString(false, false));
                return fs;
@@ -31,7 +34,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PutFetchable 
goes from server to client not the other way around", identifier);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PutFetchable 
goes from server to client not the other way around", identifier, global);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/PutSuccessfulMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/PutSuccessfulMessage.java        
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/PutSuccessfulMessage.java        
2006-12-12 02:54:51 UTC (rev 11352)
@@ -10,16 +10,19 @@
 public class PutSuccessfulMessage extends FCPMessage {

        public final String identifier;
+       public final boolean global;
        public final FreenetURI uri;

-       public PutSuccessfulMessage(String identifier, FreenetURI uri) {
+       public PutSuccessfulMessage(String identifier, boolean global, 
FreenetURI uri) {
                this.identifier = identifier;
+               this.global = global;
                this.uri = uri;
        }

        public SimpleFieldSet getFieldSet() {
                SimpleFieldSet fs = new SimpleFieldSet();
                fs.put("Identifier", identifier);
+               if(global) fs.put("Global", "true");
                // FIXME debug and remove!
                if(uri != null)
                        fs.put("URI", uri.toString());
@@ -32,7 +35,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "InsertSuccessful 
goes from server to client not the other way around", identifier);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "InsertSuccessful 
goes from server to client not the other way around", identifier, global);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/RedirectDirPutFile.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/RedirectDirPutFile.java  2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/RedirectDirPutFile.java  2006-12-12 
02:54:51 UTC (rev 11352)
@@ -13,15 +13,15 @@

        final FreenetURI targetURI;

-       public RedirectDirPutFile(SimpleFieldSet subset, String identifier) 
throws MessageInvalidException {
-               super(subset, identifier);
+       public RedirectDirPutFile(SimpleFieldSet subset, String identifier, 
boolean global) throws MessageInvalidException {
+               super(subset, identifier, global);
                String target = subset.get("TargetURI");
                if(target == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "TargetURI missing 
but UploadFrom=redirect", identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "TargetURI missing 
but UploadFrom=redirect", identifier, global);
                try {
                        targetURI = new FreenetURI(target);
                } catch (MalformedURLException e) {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Invalid TargetURI: 
"+e, identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Invalid TargetURI: 
"+e, identifier, global);
                }
         if(Logger.shouldLog(Logger.MINOR, this))
                Logger.minor(this, "targetURI = "+targetURI);

Modified: trunk/freenet/src/freenet/node/fcp/RemovePersistentRequest.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/RemovePersistentRequest.java     
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/RemovePersistentRequest.java     
2006-12-12 02:54:51 UTC (rev 11352)
@@ -18,10 +18,10 @@
        final boolean global;

        public RemovePersistentRequest(SimpleFieldSet fs) throws 
MessageInvalidException {
+               this.global = Fields.stringToBool(fs.get("Global"), false);
                this.identifier = fs.get("Identifier");
                if(identifier == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Must have 
Identifier", null);
-               this.global = Fields.stringToBool(fs.get("Global"), false);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Must have 
Identifier", null, global);
        }

        public SimpleFieldSet getFieldSet() {

Modified: trunk/freenet/src/freenet/node/fcp/SSKKeypairMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/SSKKeypairMessage.java   2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/SSKKeypairMessage.java   2006-12-12 
02:54:51 UTC (rev 11352)
@@ -33,7 +33,7 @@
        }

        public void run(FCPConnectionHandler handler, Node node) throws 
MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "SSKKeypair goes 
from server to client not the other way around", identifier);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "SSKKeypair goes 
from server to client not the other way around", identifier, false);
        }



Modified: trunk/freenet/src/freenet/node/fcp/ShutdownMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/ShutdownMessage.java     2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/ShutdownMessage.java     2006-12-12 
02:54:51 UTC (rev 11352)
@@ -22,7 +22,7 @@
        }

        public void run(FCPConnectionHandler handler, Node node) {
-               FCPMessage msg = new 
ProtocolErrorMessage(ProtocolErrorMessage.SHUTTING_DOWN,true,"The node is 
shutting down","Node");
+               FCPMessage msg = new 
ProtocolErrorMessage(ProtocolErrorMessage.SHUTTING_DOWN,true,"The node is 
shutting down","Node",false);
                handler.outputHandler.queue(msg);
                node.exit("Received FCP shutdown message");
        }       

Modified: trunk/freenet/src/freenet/node/fcp/SimpleProgressMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/SimpleProgressMessage.java       
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/SimpleProgressMessage.java       
2006-12-12 02:54:51 UTC (rev 11352)
@@ -10,11 +10,13 @@
 public class SimpleProgressMessage extends FCPMessage {

        private final String ident;
+       private final boolean global;
        private final SplitfileProgressEvent event;

-       public SimpleProgressMessage(String identifier, SplitfileProgressEvent 
event) {
+       public SimpleProgressMessage(String identifier, boolean global, 
SplitfileProgressEvent event) {
                this.ident = identifier;
                this.event = event;
+               this.global = global;
        }

        public SimpleFieldSet getFieldSet() {
@@ -26,6 +28,7 @@
                fs.put("Succeeded",Integer.toString(event.fetchedBlocks));
                fs.put("FinalizedTotal", 
Boolean.toString(event.finalizedTotal));
                fs.put("Identifier", ident);
+               if(global) fs.put("Global", "true");
                return fs;
        }

@@ -34,7 +37,7 @@
        }

        public void run(FCPConnectionHandler handler, Node node) throws 
MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "SimpleProgress 
goes from server to client not the other way around", ident);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "SimpleProgress 
goes from server to client not the other way around", ident, global);
        }

        public double getFraction() {

Modified: trunk/freenet/src/freenet/node/fcp/StartedCompressionMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/StartedCompressionMessage.java   
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/StartedCompressionMessage.java   
2006-12-12 02:54:51 UTC (rev 11352)
@@ -9,18 +9,21 @@
 public class StartedCompressionMessage extends FCPMessage {

        final String identifier;
+       final boolean global;

        final int codec;

-       public StartedCompressionMessage(String identifier, int codec) {
+       public StartedCompressionMessage(String identifier, boolean global, int 
codec) {
                this.identifier = identifier;
                this.codec = codec;
+               this.global = global;
        }

        public SimpleFieldSet getFieldSet() {
                SimpleFieldSet fs = new SimpleFieldSet();
                fs.put("Identifier", identifier);
                fs.put("Codec", Integer.toString(codec));
+               if(global) fs.put("Global", "true");
                return fs;
        }

@@ -30,7 +33,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"StartedCompression goes from server to client not the other way around", 
identifier);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"StartedCompression goes from server to client not the other way around", 
identifier, global);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/SubscribeUSKMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/SubscribeUSKMessage.java 2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/SubscribeUSKMessage.java 2006-12-12 
02:54:51 UTC (rev 11352)
@@ -32,16 +32,16 @@
        public SubscribeUSKMessage(SimpleFieldSet fs) throws 
MessageInvalidException {
                this.identifier = fs.get("Identifier");
                if(identifier == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No Identifier!", 
null);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "No Identifier!", 
null, false);
                String suri = fs.get("URI");
                if(suri == null)
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Expected a URI on 
SubscribeUSK", identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.MISSING_FIELD, "Expected a URI on 
SubscribeUSK", identifier, false);
                FreenetURI uri;
                try {
                        uri = new FreenetURI(suri);
                        key = USK.create(uri);
                } catch (MalformedURLException e) {
-                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Could not parse 
URI: "+e, identifier);
+                       throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_FIELD, "Could not parse 
URI: "+e, identifier, false);
                }
                this.dontPoll = Fields.stringToBool(fs.get("DontPoll"), false);
        }

Modified: trunk/freenet/src/freenet/node/fcp/SubscribedUSKUpdate.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/SubscribedUSKUpdate.java 2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/SubscribedUSKUpdate.java 2006-12-12 
02:54:51 UTC (rev 11352)
@@ -35,7 +35,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"SubscribedUSKUpdate goes from server to client not the other way around", 
identifier);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"SubscribedUSKUpdate goes from server to client not the other way around", 
identifier, false);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/URIGeneratedMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/URIGeneratedMessage.java 2006-12-12 
02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/URIGeneratedMessage.java 2006-12-12 
02:54:51 UTC (rev 11352)
@@ -30,7 +30,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "URIGenerated 
goes from server to client not the other way around", identifier);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "URIGenerated 
goes from server to client not the other way around", identifier, false);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/UnknownNodeIdentifierMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/UnknownNodeIdentifierMessage.java        
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/UnknownNodeIdentifierMessage.java        
2006-12-12 02:54:51 UTC (rev 11352)
@@ -26,7 +26,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"UnknownNodeIdentifier goes from server to client not the other way around", 
nodeIdentifier);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"UnknownNodeIdentifier goes from server to client not the other way around", 
nodeIdentifier, false);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/UnknownPeerNoteTypeMessage.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/UnknownPeerNoteTypeMessage.java  
2006-12-12 02:13:49 UTC (rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/UnknownPeerNoteTypeMessage.java  
2006-12-12 02:54:51 UTC (rev 11352)
@@ -26,7 +26,7 @@

        public void run(FCPConnectionHandler handler, Node node)
                        throws MessageInvalidException {
-               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"UnknownPeerNoteType goes from server to client not the other way around", 
null);
+               throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"UnknownPeerNoteType goes from server to client not the other way around", 
null, false);
        }

 }

Modified: trunk/freenet/src/freenet/node/fcp/WatchGlobal.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/WatchGlobal.java 2006-12-12 02:13:49 UTC 
(rev 11351)
+++ trunk/freenet/src/freenet/node/fcp/WatchGlobal.java 2006-12-12 02:54:51 UTC 
(rev 11352)
@@ -20,7 +20,7 @@
                        try {
                                verbosityMask = Integer.parseInt(s);
                        } catch (NumberFormatException e) {
-                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, 
e.toString(), null);
+                               throw new 
MessageInvalidException(ProtocolErrorMessage.ERROR_PARSING_NUMBER, 
e.toString(), null, false);
                        }
                else
                        verbosityMask = Integer.MAX_VALUE;


Reply via email to