[Mono-bugs] [Bug 59688][Blo] Changed - Critical Bug causing large HTTP POSTs to fail in Internet Explorer

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 10 Jun 2004 07:28:31 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by gonzalo@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=59688

--- shadow/59688	2004-06-10 06:45:43.000000000 -0400
+++ shadow/59688.tmp.15697	2004-06-10 07:28:31.000000000 -0400
@@ -303,6 +303,58 @@
 
 and
 
 "When a Content-Length is given in a message where a message-body is
 allowed, its field value MUST exactly match the number of OCTETs in
 the message-body."
+
+------- Additional Comments From gonzalo@ximian.com  2004-06-10 07:28 -------
+Seems like reading only 2 bytes will not fix the problems we might
+encounter. We have to read everything as per Apache 2.0 sources:
+
+    /* Close the connection, being careful to send out whatever is still
+     * in our buffers.  If possible, try to avoid a hard close until the
+     * client has ACKed our FIN and/or has stopped sending us data.
+     */
+
+    /* Send any leftover data to the client, but never try to again */
+    ap_flush_conn(c);
+
+    if (c->aborted) {
+        apr_socket_close(csd);
+        return;
+    }
+
+    /* Shut down the socket for write, which will send a FIN
+     * to the peer.
+     */
+    if (apr_shutdown(csd, APR_SHUTDOWN_WRITE) != APR_SUCCESS
+        || c->aborted) {
+        apr_socket_close(csd);
+        return;
+    }
+
+    /* Read all data from the peer until we reach "end-of-file" (FIN
+     * from peer) or we've exceeded our overall timeout. If the client
+does
+     * not send us bytes within 2 seconds (a value pulled from Apache 1.3
+     * which seems to work well), close the connection.
+     */
+    timeout = apr_time_from_sec(SECONDS_TO_LINGER);
+    apr_socket_timeout_set(csd, timeout);
+    apr_socket_opt_set(csd, APR_INCOMPLETE_READ, 1);
+    while (1) {
+        nbytes = sizeof(dummybuf);
+        rc = apr_recv(csd, dummybuf, &nbytes);
+        if (rc != APR_SUCCESS || nbytes == 0)
+            break;
+
+        total_linger_time += SECONDS_TO_LINGER;
+        if (total_linger_time >= MAX_SECS_TO_LINGER) {
+            break;
+        }
+    }
+
+    apr_socket_close(csd);
+-----
+
+I will do this.