PILLUTLAAVINASH / google-enterprise-connector-manager

Automatically exported from code.google.com/p/google-enterprise-connector-manager
0 stars 0 forks source link

Base64FilterInputStream assumes a fully-available underlying stream. #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run QueryTraverser over a repository with a FeedConnection that captures
the output.
2. Return a google:content property with a stream that is not guaranteed to
return the requested number of bytes. Examples include PipedInputStream and
the return value from URLConnection.getInputStream. A simple
FilterInputStream could be written that does the same thing.

What is the expected output? What do you see instead?

The expected output is an URL-encoded feed URL that contains a
Base6-encoded content string. But the Base64FilterInputStream assumes that
the underlying stream returned the requested number of bytes (3072), or at
least some multiple of 3. When the underlying stream does not do so, the
Base64Encoder class adds padding to the end of the encoded buffer which
then appears in the middle of the Base64-encoded content string.

Please use labels and text to provide additional information.

It would be possible for the decoding in the GSA to handle this, if it
keeps the extra bits and skips over the padding. I don't know whether the
GSA correctly handles this or not.

If the GSA does correctly handle this, then the documentation in
Base64FilterInputStream should reflect that. Right now it says "Choose a
raw buffer size that is divisible by three so we don't have any leftover
bytes."

Original issue reported on code.google.com by jl1615@gmail.com on 19 Jan 2007 at 8:46

GoogleCodeExporter commented 8 years ago
Brian, please add to backlog.

Original comment by donald.z...@gmail.com on 24 Jan 2007 at 11:46

GoogleCodeExporter commented 8 years ago
Google Bug #243976

Original comment by vjo...@gmail.com on 9 Feb 2007 at 4:03

GoogleCodeExporter commented 8 years ago
Fixed in r347.

Original comment by mgron...@gmail.com on 3 Oct 2007 at 9:25

GoogleCodeExporter commented 8 years ago

Original comment by mgron...@gmail.com on 3 Oct 2007 at 9:29

GoogleCodeExporter commented 8 years ago

Original comment by mgron...@gmail.com on 3 Oct 2007 at 10:48