Author: toad
Date: 2009-01-29 21:01:20 +0000 (Thu, 29 Jan 2009)
New Revision: 25382

Modified:
   branches/db4o/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
Log:
Fix some rare NPEs, don't start if it's a collision


Modified: branches/db4o/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/FCPConnectionHandler.java        
2009-01-29 20:46:09 UTC (rev 25381)
+++ branches/db4o/freenet/src/freenet/node/fcp/FCPConnectionHandler.java        
2009-01-29 21:01:20 UTC (rev 25382)
@@ -307,9 +307,9 @@
                                } catch (MalformedURLException e) {
                                        failedMessage = new 
ProtocolErrorMessage(ProtocolErrorMessage.FREENET_URI_PARSE_ERROR, true, null, 
id, message.global);
                                }
-                               if(!persistent)
+                               if(cp != null && !persistent)
                                        requestsByIdentifier.put(id, cp);
-                               else if(message.persistenceType == 
ClientRequest.PERSIST_FOREVER) {
+                               else if(cp != null && message.persistenceType 
== ClientRequest.PERSIST_FOREVER) {
                                        final ClientPut putter = cp;
                                        
server.core.clientContext.jobRunner.queue(new DBJob() {
 
@@ -388,12 +388,12 @@
                        } catch (MalformedURLException e) {
                                failedMessage = new 
ProtocolErrorMessage(ProtocolErrorMessage.FREENET_URI_PARSE_ERROR, true, null, 
id, message.global);
                        }
-                       if(!persistent) {
+                       if(cp != null && !persistent) {
                                synchronized(this) {
                                        requestsByIdentifier.put(id, cp);
                                }
                                // FIXME register non-persistent requests in 
the constructors also, we already register persistent ones...
-                       } else if(message.persistenceType == 
ClientRequest.PERSIST_FOREVER) {
+                       } else if(cp != null && message.persistenceType == 
ClientRequest.PERSIST_FOREVER) {
                                final ClientPutDir putter = cp;
                                server.core.clientContext.jobRunner.queue(new 
DBJob() {
 

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to