[go: up one dir, main page]

File: size.c

package info (click to toggle)
libfcgi 2.4.0-8.3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,252 kB
  • ctags: 1,606
  • sloc: sh: 6,897; ansic: 4,800; java: 872; cpp: 290; makefile: 154; perl: 2
file content (41 lines) | stat: -rw-r--r-- 851 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <stdlib.h>
#include "fcgiapp.h"

int main(void)
{
  int i,scale;
  char* pathInfo;
  FCGX_Stream *in, *out, *err;
  FCGX_ParamArray envp;

  while (FCGX_Accept(&in, &out, &err, &envp) >= 0) 
  {
    FCGX_FPrintF(out,"Content-type: text/plain\r\n\r\n");      
    
    scale = 0;
    
    pathInfo = FCGX_GetParam("PATH_INFO",envp);
    
    if (pathInfo)
      scale = atoi(pathInfo+1);

    if (scale == 0)
      scale = 500;
 
    FCGX_FPrintF(out,"Dumping %6d Bytes ...\n", scale);

    scale = (scale-26)/80;

    for (i=0;i<scale;i++)
    {
      /* each line has 80 character */
      int rv = FCGX_FPrintF(out,"%4d:12345679890123456798901234567989012345679890123456798901234567989012345679890123\n",i);
      if (rv <= 0)
      {
          FCGX_FPrintF(out, "FCGX_FPrintF() failed..");
          break;
      }
    }
  }
  return 0;
}