summaryrefslogtreecommitdiff
path: root/bkucommon/src/main/java/at/gv/egiz
diff options
context:
space:
mode:
authormcentner <mcentner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2009-10-16 14:58:21 +0000
committermcentner <mcentner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2009-10-16 14:58:21 +0000
commitaaf34f6dfc26ef28c6ddbe2987ebf7c3dd48e664 (patch)
tree229c0f7a3dd2cb380d8fc8de27d6ee708c788549 /bkucommon/src/main/java/at/gv/egiz
parent27e674646e9d8cb6ffb69598858c2316f4e8e73b (diff)
downloadmocca-aaf34f6dfc26ef28c6ddbe2987ebf7c3dd48e664.tar.gz
mocca-aaf34f6dfc26ef28c6ddbe2987ebf7c3dd48e664.tar.bz2
mocca-aaf34f6dfc26ef28c6ddbe2987ebf7c3dd48e664.zip
Fixed some further issues in XWWWFormUrlInputIterator.
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@532 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'bkucommon/src/main/java/at/gv/egiz')
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/XWWWFormUrlInputIterator.java34
1 files changed, 19 insertions, 15 deletions
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/binding/XWWWFormUrlInputIterator.java b/bkucommon/src/main/java/at/gv/egiz/bku/binding/XWWWFormUrlInputIterator.java
index f60b42b3..9279130d 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/binding/XWWWFormUrlInputIterator.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/binding/XWWWFormUrlInputIterator.java
@@ -83,23 +83,25 @@ public class XWWWFormUrlInputIterator implements Iterator<FormParameter> {
if (done) {
return false;
}
- if (currentParameter != null) {
- // we have to disconnect the current parameter
- // to look for further parameters
- try {
+ try {
+ if (currentParameter != null) {
+ // we have to disconnect the current parameter
+ // to look for further parameters
currentParameter.formParameterValue.disconnect();
- // fill buffer if empty
- if (pos >= count) {
- if ((count = in.read(buf)) == -1) {
- // done
- done = true;
- return false;
- }
- pos = 0;
+ }
+ // fill buffer if empty
+ if (pos >= count) {
+ if ((count = in.read(buf)) == -1) {
+ // done
+ done = true;
+ return false;
}
- } catch (IOException e) {
- deferredIOException = e;
+ pos = 0;
}
+ } catch (IOException e) {
+ deferredIOException = e;
+ // return true to be able to report error
+ return true;
}
return true;
}
@@ -108,7 +110,9 @@ public class XWWWFormUrlInputIterator implements Iterator<FormParameter> {
public FormParameter next() {
if (hasNext()) {
// skip separator
- pos++;
+ if (buf[pos] == PARAM_SEP) {
+ pos++;
+ }
currentParameter = new XWWWFormUrlEncodedParameter();
return currentParameter;
} else {