Author: toad
Date: 2007-06-16 21:01:59 +0000 (Sat, 16 Jun 2007)
New Revision: 13632

Modified:
   trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
Log:
Include new MIME type and possibly size in the error

Modified: trunk/freenet/src/freenet/client/async/SingleFileFetcher.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SingleFileFetcher.java       
2007-06-16 21:00:52 UTC (rev 13631)
+++ trunk/freenet/src/freenet/client/async/SingleFileFetcher.java       
2007-06-16 21:01:59 UTC (rev 13632)
@@ -309,7 +309,7 @@
                                
clientMetadata.mergeNoOverwrite(metadata.getClientMetadata());
                                if(clientMetadata.getMIMETypeNoParams() != null 
&& ctx.allowedMIMETypes != null &&
                                                
!ctx.allowedMIMETypes.contains(clientMetadata.getMIMETypeNoParams())) {
-                                       onFailure(new 
FetchException(FetchException.WRONG_MIME_TYPE));
+                                       onFailure(new 
FetchException(FetchException.WRONG_MIME_TYPE, -1, false, 
clientMetadata.getMIMEType()));
                                        return;
                                }
                                // Fetch it from the archive
@@ -388,7 +388,7 @@

                                if(mimeType != null && ctx.allowedMIMETypes != 
null && 
                                                
!ctx.allowedMIMETypes.contains(mimeType)) {
-                                       onFailure(new 
FetchException(FetchException.WRONG_MIME_TYPE));
+                                       onFailure(new 
FetchException(FetchException.WRONG_MIME_TYPE, -1, false, 
clientMetadata.getMIMEType()));
                                        return;
                                }

@@ -446,7 +446,7 @@

                                if(mimeType != null && ctx.allowedMIMETypes != 
null &&
                                                
!ctx.allowedMIMETypes.contains(mimeType)) {
-                                       onFailure(new 
FetchException(FetchException.WRONG_MIME_TYPE));
+                                       onFailure(new 
FetchException(FetchException.WRONG_MIME_TYPE, 
metadata.uncompressedDataLength(), false, clientMetadata.getMIMEType()));
                                        return;
                                }



Reply via email to