-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathsize.c
41 lines (32 loc) · 851 Bytes
/
size.c
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;
}