This is a discussion on Bizarre PUT behavior (2.0.47) within the Apache Web Server forums, part of the Web Server and Related Forums category; My Java middleware server publishes binary files to my Apache Web server via the PUT method. I'm using a ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
My Java middleware server publishes binary files to my Apache Web server
via the PUT method. I'm using a native Apache PUT module from gknw.net (mod_put), which I can build and configure into the server successfully. The Java server connects to the Apache server, and uploads the file with the name and size expected. But uploading the same file multiple times (with distinct names) results in each file having different content (but all the same size as the original)! And none of the result files matches the original file! AFAIK, Apache is not using any input filters. I have tapped the data from within the PUT module code before Apache saves it, and verified that the corruption has occurred at that point (by writing it using vanilla creat/write/close calls to a temp file). Places left to look are the Apache ap_get_client_block() routine and the handling of the data on the Java side. The Apache call is simple because I send Content-length with the PUT rather than chunking, so I don't think it's doing anything to the data. The Java call is a question; I use HttpURLConnection to connect to Apache. The OutputStream object is a sun.net.www.http.PosterOutputStream. I wonder if that is somehow transforming the binary data, and how I would suppress that. Thanks in advance, TW -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ |
|
|||
|
On Tue, 11 Nov 2003 01:42:47 GMT, Tim Wood <timwood0spamx@pacbell.net>
wrote: > The Java server connects to the Apache server, and uploads the file with > the name and size expected. But uploading the same file multiple times > (with distinct names) results in each file having different content (but > all the same size as the original)! And none of the result files matches > the original file! This problem confounded me because I had lifted the code from a standalone test case which worked, into the server which didn't. THE DIFFERENCE being that the test code assembled the input directly from database result rows, whereas the server was first dropping those rows into a (randomly ordered) HashSet. Explains why the result file was different each time. So now the server drops the rows into an ordered set (a List) before passing the data back up to the Apache comm. level. Thanks to all for any thinking to this point. TW |