Mark Hindess wrote: > In message <[EMAIL PROTECTED]>, > "Mark Hindess" writes: >> When running >> org.apache.harmony.luni.tests...protocol.http.HttpURLConnectionTest >> I am seeing a hang in testConnectionPersistence method on linux >> (x86-64 and x86). >> [snip] > > Ok. It looks like there is a problem with the selectRead implementation on > unix. The use of this function in: > > Java_org_apache_harmony_luni_platform_OSNetworkSystem_readDirect > > compares the result of the selectRead call using portlib constants. This > is valid for the windows implementation of selectRead - because it uses > hysock_select. However, the unix implementation uses poll which is returning: > > On success, a positive number is returned; [snip]. A value of 0 > indicates that the call timed out and no file descriptors were ready. > On error, -1 is returned, and errno is set appropriately. > > I think the fix is: > > 1) Check for other uses of selectRead and make sure they all use portlib > constants. > > 2) Fix selectRead on unix to map the poll return codes to portlib constants. > > I'll take a look at doing this. Shout if you don't think this is a good > approach.
Having selectRead return different values on different platforms is not a good idea (even though it is not a portlib function), so yes it should be fixed. There is plenty of work left in tidying up and optimizing the networking code. Thanks for tracking this down. Regards, Tim
