Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-12-12 03:48:06 -0500
committerEike Stepper2015-12-12 03:48:06 -0500
commit58cfed8178aef26bdaa6676a8d115f803bd7d36e (patch)
treeb8b8533c1133479621ceb32870258fb37f63bab9
parenta3359af34658cec0d2579684138677c66b72b533 (diff)
downloaduss-58cfed8178aef26bdaa6676a8d115f803bd7d36e.tar.gz
uss-58cfed8178aef26bdaa6676a8d115f803bd7d36e.tar.xz
uss-58cfed8178aef26bdaa6676a8d115f803bd7d36e.zip
Don't miss calls to TeeInputStream.reachedEndOfFile()
-rw-r--r--org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Session.java22
-rw-r--r--org.eclipse.userstorage/src/org/eclipse/userstorage/internal/util/IOUtil.java3
2 files changed, 24 insertions, 1 deletions
diff --git a/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Session.java b/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Session.java
index 9ef8932..18569a2 100644
--- a/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Session.java
+++ b/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Session.java
@@ -167,6 +167,12 @@ public class Session implements Headers, Codes
if (useETag)
{
String eTag = properties.get(Blob.ETAG);
+
+ if (DEBUG)
+ {
+ System.out.println("Retrieving etag = " + eTag);
+ }
+
if (!StringUtil.isEmpty(eTag))
{
request.setHeader(IF_NONE_MATCH, "\"" + eTag + "\"");
@@ -184,6 +190,11 @@ public class Session implements Headers, Codes
String eTag = getETag(response);
if (eTag != null)
{
+ if (DEBUG)
+ {
+ System.out.println("Retrieved etag = " + eTag);
+ }
+
properties.put(Blob.ETAG, eTag);
}
@@ -228,6 +239,12 @@ public class Session implements Headers, Codes
Request request = configureRequest(Request.Put(uri), uri);
String eTag = properties.get(Blob.ETAG);
+
+ if (DEBUG)
+ {
+ System.out.println("Updating etag = " + eTag);
+ }
+
if (!StringUtil.isEmpty(eTag))
{
request.setHeader(IF_MATCH, "\"" + eTag + "\"");
@@ -256,6 +273,11 @@ public class Session implements Headers, Codes
throw new ProtocolException("PUT", uri, getProtocolVersion(response.getStatusLine()), BAD_RESPONSE, "Bad Response : No ETag");
}
+ if (DEBUG)
+ {
+ System.out.println("Updated etag = " + eTag);
+ }
+
properties.put(Blob.ETAG, eTag);
return statusCode == CREATED;
}
diff --git a/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/util/IOUtil.java b/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/util/IOUtil.java
index c32aa5e..4a21e26 100644
--- a/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/util/IOUtil.java
+++ b/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/util/IOUtil.java
@@ -327,7 +327,8 @@ public final class IOUtil
{
out.write(b, off, n);
}
- else
+
+ if (n < len)
{
reachedEndOfFile();
}

Back to the top