Isn't this logic backwards? Have I just not had enough sugar yet this morning?

+worker_score *ap_get_servers_scoreboard(int x, int y)
+{
+int hard_server_limit;
+int hard_thread_limit;
+
+    ap_mpm_query(AP_MPMQ_HARD_LIMIT_DAEMONS, &hard_server_limit);
+    ap_mpm_query(AP_MPMQ_HARD_LIMIT_THREADS, &hard_thread_limit);
+
+    if (((x < 0) || (hard_server_limit < x)) &&
+        ((y < 0) || (hard_thread_limit < y))) {
+        return(&ap_scoreboard_image->servers[x][y]);
+    }
+    return(NULL);
+}

Shouldn't it be something more like:

+worker_score *ap_get_servers_scoreboard(int x, int y)
+{
+int hard_server_limit;
+int hard_thread_limit;
+
+    ap_mpm_query(AP_MPMQ_HARD_LIMIT_DAEMONS, &hard_server_limit);
+    ap_mpm_query(AP_MPMQ_HARD_LIMIT_THREADS, &hard_thread_limit);
+
+    if ((x > 0) && (x < hard_server_limit) &&
+        (y > 0) && (y < hard_thread_limit)) {
+        return(&ap_scoreboard_image->servers[x][y]);
+    }
+    return(NULL);
+}

I'm going to go get more sugar now, maybe it'll look different in a bit.

-- 
Paul J. Reder
-----------------------------------------------------------
"The strength of the Constitution lies entirely in the determination of each
citizen to defend it.  Only if every single citizen feels duty bound to do
his share in this defense are the constitutional rights secure."
-- Albert Einstein

Reply via email to