Project

General

Profile

Bug #696

D1Client failing to serialize document stream correctly in multipart form

Added by Chad Berkley over 14 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
High
Assignee:
Chad Berkley
Category:
Metacat
Target version:
Start date:
Due date:
% Done:

100%

Milestone:
None
Product Version:
*
Story Points:
Sprint:

Description

The data stream that comes from D1Client in the multipart message for create is truncated for larger documents. This causes the create to fail since some of the document does not get transferred.

History

#1 Updated by Chad Berkley over 14 years ago

  • Status changed from New to In Progress

#2 Updated by Chad Berkley over 14 years ago

  • Status changed from In Progress to Closed

this is not a bug in D1Client. This is a bug in metacat. However, I cannot find a real fix for this. I have implemented a work-around. The gist of the problem is that when the MimeMultipart message is read in ResourceHandler, it iterates through each BodyPart then calls BodyPart.getInputStream() to read the actual part. This works fine for parts that are smaller than about 6kB. After about 6kB, it fails to read the rest of the stream.

I confirmed this by reading the stream manually. I can read the entire stream if I just iterate over it, but as soon as I try to read it with BodyPart.getInputStream(), it fails.

The work-around that I implemented just reads the entire multipart message, then parses out the different parts into new streams. The problem with the work-around is that it requires that the stream be put into memory before being split into parts. This does not appear to be the case using MMP, however since it doesn't work, I don't see another choice.

If someone sees a better way to do this, or has any idea why BodyPart would not return the full stream, please let me know. I did a ton of searching for this and couldn't find anything, so I'm wondering if we're doing something wrong, or if no one is using MMP for larger parts.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)