Opened 2 years ago

Closed 22 months ago

#910 closed defect (fixed)

WCS ProcessRequest does not work on Webkit browsers

Reported by: mdumitru Owned by: bphamhuu
Priority: major Milestone: 9.2
Component: undecided Version: development
Keywords: Cc:
Complexity: Medium


I.e. on:

No response is received by the browser. This seems to be due to incorrect used of multipart response in petascope interface.

Change History (9)

comment:1 Changed 2 years ago by dmisev

  • Milestone set to 9.2

comment:2 Changed 22 months ago by bphamhuu

  • Owner changed from mdumitru to bphamhuu
  • Status changed from new to assigned

comment:3 Changed 22 months ago by bphamhuu

Yes, as Alex expected, this has problem with MultipartResponse? as it has not support with some Browser (I've checked although this is from old information), so I change to another way to write Byte Array to Output Stream and it looks it can work correctly with Chrome (Webkit Browser). After few test, I will submit this patch and please have a validation. Thanks.

comment:4 Changed 22 months ago by dmisev

Bang your patch is not valid, Alex pointed out that "IOUtils.close() calls flush() and then close(). Calling them once more is undefined behaviour and can lead to bugs."

comment:5 Changed 22 months ago by bphamhuu

@Dimitar: I copy the command from

but as Alex has pointed out in Java close() also invoke flush() so don't need flush() anymore. I will make a patch that eliminate the above line also. Thanks.

comment:6 Changed 22 months ago by dmisev

Ok could you please fix the line you copied from as well?

comment:7 Changed 22 months ago by bphamhuu

yes, my pleasure to do this, please accept the patch after viewing.

comment:8 Changed 22 months ago by mdumitru


+                    IOUtils.closeQuietly(os);
+                    if (os != null) {
+                        os.close();
+                    }

should be

+                    IOUtils.closeQuietly(os);

IOUtils.closeQuietly(os) is defined as {try{os.flush(); os.close()} catch(Exception e) {}}. As you can see, it already closes the stream, so closing once more or doing any operation on it is undefined behavior (it can just return or it can crash). So there's no need for the if statment. The same holds for the other lines.

comment:9 Changed 22 months ago by bphamhuu

  • Resolution set to fixed
  • Status changed from assigned to closed

As this patch has been accepted, I would close the ticket and thanks for Alex with your careful reviewing in times.

Note: See TracTickets for help on using tickets.