httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garey Smiley" <ga...@main.slink.com>
Subject OS/2 mod_status fixes.
Date Fri, 02 Aug 1996 02:05:31 GMT
Under the OS/2 EMX libraries times() is broken and can sometimes cause
a core dump. So I made the following mods to allow mod_status to work
under OS/2, but without the CPU stats. If everyone approves could
someone please commit this.

*** mod_status.c.orig	Sat Jun 29 15:23:24 1996
--- mod_status.c	Thu Aug 01 13:19:20 1996
***************
*** 301,308 ****
--- 301,311 ----
      {
          rprintf(r,"Total Accesses: %lu\nTotal Bytes:
%lu\n",count,bcount);
  
+ #ifndef __EMX__
+     /* Allow for OS/2 not having CPU stats */
      if(ts || tu || tcu || tcs)
          rprintf(r,"CPULoad: %g\n",(tu+ts+tcu+tcs)/tick/up_time*100.);
+ #endif
  
      rprintf(r,"Uptime: %ld\n",(long)(up_time));
      if (up_time>0)
***************
*** 317,328 ****
--- 320,335 ----
      {
      rprintf(r,"Total accesses: %lu - Total Traffic: ", count);
      format_byte_out(r,bcount);
+ 
+ #ifndef __EMX__
+     /* Allow for OS/2 not having CPU stats */
      rputs("<br>\n",r);
          rprintf(r,"CPU Usage: u%g s%g cu%g cs%g",
          tu/tick,ts/tick,tcu/tick,tcs/tick);
  
      if(ts || tu || tcu || tcs)
          rprintf(r," - %.3g%% CPU
load",(tu+ts+tcu+tcs)/tick/up_time*100.);
+ #endif
  
      rputs("<br>\n",r);
  
***************
*** 386,392 ****
--- 393,404 ----
          if(no_table_report)
              rputs("<p><hr><h2>Server Details</h2>\n\n",r);
      else
+ #ifdef __EMX__
+             /* Allow for OS/2 not having CPU stats */
+             rputs("<p>\n\n<table
border=0><tr><th>Srv<th>PID<th>Acc<th>M\n<th>SS<th>Conn<th>Child<th>Slot
<th>Host<th>Request</tr>\n\n",r);
+ #else
              rputs("<p>\n\n<table
border=0><tr><th>Srv<th>PID<th>Acc<th>M<th>CPU\n<th>SS<th>Conn<th>Child<
th>Slot<th>Host<th>Request</tr>\n\n",r);
+ #endif
  
  
      for (i = 0; i<HARD_SERVER_LIMIT; ++i)
***************
*** 435,446 ****
--- 447,464 ----
                      rputs("Dead",r);
                      break;
              }
+ #ifdef __EMX__
+             /* Allow for OS/2 not having CPU stats */
+             rprintf(r,"]\n %s (",
+                 asctime(localtime(&score_record.last_used)));
+ #else
              rprintf(r,"] u%g s%g cu%g cs%g\n %s (",
                  score_record.times.tms_utime/tick,
                  score_record.times.tms_stime/tick,
                  score_record.times.tms_cutime/tick,
                  score_record.times.tms_cstime/tick,
                  asctime(localtime(&score_record.last_used)));
+ #endif
              format_byte_out(r,conn_bytes);
              rputs("|",r);
              format_byte_out(r,my_bytes);
***************
*** 482,493 ****
--- 500,517 ----
                      rputs("<td>.",r);
                      break;
              }
+ #ifdef __EMX__
+             /* Allow for OS/2 not having CPU stats */
+             rprintf(r,"\n<td>%.0f",
+                 difftime(nowtime, score_record.last_used));
+ #else
              rprintf(r,"\n<td>%.2f<td>%.0f",
                  (score_record.times.tms_utime +
                  score_record.times.tms_stime +
                  score_record.times.tms_cutime +
                  score_record.times.tms_cstime)/tick,
                  difftime(nowtime, score_record.last_used));
+ #endif
              rprintf(r,"<td>%-1.1f<td>%-2.2f<td>%-2.2f\n",
              (float)conn_bytes/KBYTE, (float)my_bytes/MBYTE,
              (float)bytes/MBYTE);
***************
*** 500,505 ****
--- 524,544 ----
  
      if (!(short_report || no_table_report))
      {
+ #ifdef __EMX__
+ /* Allow for OS/2 not having CPU stats */
+     rputs("</table>\n \
+ <hr> \
+ <table>\n \
+ <tr><th>Srv<td>Server number\n \
+ <tr><th>PID<td>OS process ID\n \
+ <tr><th>Acc<td>Number of accesses this connection / this child / this
slot\n \
+ <tr><th>M<td>Mode of operation\n \
+ <tr><th>SS<td>Seconds since beginning of most recent request\n \
+ <tr><th>Conn<td>Kilobytes transferred this connection\n \
+ <tr><th>Child<td>Megabytes transferred this child\n \
+ <tr><th>Slot<td>Total megabytes transferred this slot\n \
+ </table>\n",r);
+ #else
      rputs("</table>\n \
  <hr> \
  <table>\n \
***************
*** 513,518 ****
--- 552,558 ----
  <tr><th>Child<td>Megabytes transferred this child\n \
  <tr><th>Slot<td>Total megabytes transferred this slot\n \
  </table>\n",r);
+ #endif
      }
  
  #else /* !defined(STATUS) */
***************
*** 556,591 ****
     NULL,			/* fixups */
     NULL				/* logger */
  };
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
  
--- 596,599 ----


Garey Smiley
SoftLink Services
garey@slink.com
http://www.slink.com/
(330)848-1312 FAX/Data(330)699-4474

Mime
View raw message