crotwell / seisFile

A library for reading and writing seismic file formats in java.
GNU Lesser General Public License v3.0
27 stars 20 forks source link

I found a bug #10

Closed andreabono closed 5 years ago

andreabono commented 5 years ago

I found a bug in edu.sc.seis.seisFile.waveserver.WaveServer.java.
You use a PrintWriter to write some message to screen.
The matter is that PrintWriter is NOT platform independent and uses different codes for newline depending on the OS platform. So, when called on MacOSX or Linux it uses "\n" , that is properly interpreted by the Earthworm Wave Server, BUT when used on MSWindows, it attaches a "\r" as a newline... And the EW WS hangs waiting for the newline... And a timeout exception is raised.

So, int the getMenu() method:

PrintWriter socketOut = getOut();
socketOut.println("MENU: " + nextReqId + " SCNL");

should be replaced by:

System.out.print("MENU: " + nextReqId + " SCNL\n");

Cheers. Andrea

crotwell commented 5 years ago

Fixed in 964b391dd85574dc193c526c9588937925be4a4a

Will be in the next release.

Thanks for the bug report.

andreabono commented 5 years ago

How about a new release in a maven repository?

crotwell commented 5 years ago

1.8.1 was released a week ago with this fix in it.

andreabono commented 5 years ago

Sorry for bothering you... It works great!!!!
Thanks!!
Andrea