Our team studies the consistent edits of Httpd during evolution. We find that 
there may be several missed edits in the latest release of httpd. 

For example, we find that two consistent edits in historical commits. They are 
respectively:

1) Version: httpd 2.2.34 – httpd-2.3.6
   File: modules/generators/mod_cgi.c

     fd.desc_type = APR_POLL_FILE;
     fd.reqevents = APR_POLLIN;
     fd.p = r->pool;
     fd.desc.f = out; /* script's stdout */
     fd.client_data = (void *)1;
     rv = apr_pollset_add(data->pollset, &fd);
-    AP_DEBUG_ASSERT(rv == APR_SUCCESS);
+    if (rv != APR_SUCCESS) {
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+                     "cgi: apr_pollset_add(); check system or user limits");
+        return NULL;
+    }
2) Version: httpd 2.2.34 – httpd-2.3.6
      File: modules/generators/mod_cgi.c

     fd.desc.f = err; /* script's stderr */
     fd.client_data = (void *)2;
     rv = apr_pollset_add(data->pollset, &fd);
-    AP_DEBUG_ASSERT(rv == APR_SUCCESS);
+    if (rv != APR_SUCCESS) {
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+                     "cgi: apr_pollset_add(); check system or user limits");
+        return NULL;
+    }
 
     data->r = r;
     b->data = data;
     return b;
 }

They both update the assert statement to if structure which both checks the 
return value of apr_pollset_add(), but the if structure in a more friendly way.

And we find one candidate that may also need similar edit:
File: httpd-2.4.27/modules/filters/mod_ext_filter.c

static apr_status_t init_ext_filter_process(ap_filter_t *f)
{
….
    92          rc = apr_pollset_add(ctx->pollset, &pfd);
    93          ap_assert(rc == APR_SUCCESS);
    94  
....
}

More recommendations are stored in the attach file. It is so nice of you to 
share your opinion on those suggestions.Thanks for your reading ^ ^.

<<attachment: httpd_recommendation_4.doc>>

<<attachment: httpd_recommendation_3.doc>>

<<attachment: httpd_recommendation_2.doc>>

<<attachment: httpd_recommendation_1.doc>>

Reply via email to