Opened 2 years ago

Closed 19 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

Description

I.e. on:
http://localhost:11111/ows/wcs?service=WCS&version=2.0.0&request=ProcessCoverages&query=for%20c%20in%20(mean_summer_airtemp)%20return%20encode(c,%20%22csv%22)

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 23 months ago by dmisev

  • Milestone set to 9.2

comment:2 Changed 19 months ago by bphamhuu

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

comment:3 Changed 19 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 19 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 19 months ago by bphamhuu

@Dimitar: I copy the command from

http://rasdaman.org/browser/applications/petascope/src/main/java/petascope/PetascopeInterface.java#L680

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 19 months ago by dmisev

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

comment:7 Changed 19 months ago by bphamhuu

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

comment:8 Changed 19 months ago by mdumitru

@Bang

+                    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 19 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.