Date: Thu, 17 Jan 2008 20:13:00 -0800 (PST) From: Michael Allman <msa@allman.ms> To: freebsd-java@FreeBSD.org Cc: landonf@macports.org Subject: bsd implementation of Java_sun_nio_ch_FileChannelImpl_transferTo0 ignores "count" argument Message-ID: <20080117200016.P64623@yvyyl.pfbsg.arg>
next in thread | raw e-mail | index | archive | help
There's a bug in the bsd patch to FileChannelImpl.c, as described in the subject of this message. FYI, I have verified this using the "current" jdk16 freebsd patchset found here: http://www.eyesbeyond.com/freebsddom/java/JDK16JRLConfirm.html I haven't fully analyzed the impact of this defect. I can say that in my case, if I call FileChannel.transferTo(0, 100, socketChannel), where 100 is less than the length of the file in question, it transfers the entire file to the destination. According to the docs for this method, it should only transfer a maximum of 100 bytes. This is key to my particular usage of this method. I can attempt to provide a patch, but C is not my thing, and I could not make a reliable claim as to the correctness of my patch. Also, there's the whole license issue. Fixing this seems simple enough, though. I would like to help insofar as I can. Also, I know this is getting pushy, but it seems like fixing this issue would be a great time to replace the current implementation of this method with a true bsd sendfile() call. I could give that a try, too. Cheers, Michael (CC'ing Landon Fuller because this is a bug in Soylatte, too)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080117200016.P64623>