]> granicus.if.org Git - apache/commitdiff
explicitly controlling write timeouts, not properly in place from vhost
authorStefan Eissing <icing@apache.org>
Tue, 2 Feb 2016 12:12:29 +0000 (12:12 +0000)
committerStefan Eissing <icing@apache.org>
Tue, 2 Feb 2016 12:12:29 +0000 (12:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728096 13f79535-47bb-0310-9956-ffa450edef68

modules/http2/h2_conn.c
modules/http2/h2_session.c

index 60ec831b2134c97d42a6106df5a9ef30d03050f8..3162365abef755abdeaeabe163d28364e78caadb 100644 (file)
@@ -89,7 +89,6 @@ apr_status_t h2_conn_child_init(apr_pool_t *pool, server_rec *s)
     
     status = ap_mpm_query(AP_MPMQ_IS_ASYNC, &async_mpm);
     if (status != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_TRACE1, status, s, "querying MPM for async");
         /* some MPMs do not implemnent this */
         async_mpm = 0;
         status = APR_SUCCESS;
index 2e4253a042dd17bf5682cd8d34edf19d112eb1e5..6076cd170426a2d2468c66cfda5327cc7a2e5e16 100644 (file)
@@ -1548,7 +1548,21 @@ int h2_session_push_enabled(h2_session *session)
 
 static apr_status_t h2_session_send(h2_session *session)
 {
-    int rv = nghttp2_session_send(session->ngh2);
+    apr_interval_time_t saved_timeout;
+    int rv;
+    apr_socket_t *socket;
+    
+    socket = ap_get_conn_socket(session->c);
+    if (socket) {
+        apr_socket_timeout_get(socket, &saved_timeout);
+        apr_socket_timeout_set(socket, session->s->timeout);
+    }
+    
+    rv = nghttp2_session_send(session->ngh2);
+    
+    if (socket) {
+        apr_socket_timeout_set(socket, saved_timeout);
+    }
     if (rv != 0) {
         if (nghttp2_is_fatal(rv)) {
             dispatch_event(session, H2_SESSION_EV_PROTO_ERROR, rv, nghttp2_strerror(rv));
@@ -2071,10 +2085,7 @@ apr_status_t h2_session_process(h2_session *session, int async)
                 else {
                     /* We wait in smaller increments, using a 1 second timeout.
                      * That gives us the chance to check for MPMQ_STOPPING often. */
-                    h2_filter_cin_timeout_set(session->cin, 
-                                              (h2_stream_set_is_empty(session->streams)?
-                                              session->s->keep_alive_timeout :
-                                              session->s->timeout));
+                    h2_filter_cin_timeout_set(session->cin, apr_time_from_sec(1));
                     status = h2_session_read(session, 1, 10);
                     if (status == APR_SUCCESS) {
                         have_read = 1;