MCPcopy Create free account
hub / github.com/OpenPrinting/cups / main

Function main

cgi-bin/testcgi.c:23–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21 */
22
23int /* O - Exit status */
24main(void)
25{
26 /*
27 * Test file upload/multi-part submissions...
28 */
29
30 freopen("multipart.dat", "rb", stdin);
31
32 putenv("CONTENT_TYPE=multipart/form-data; "
33 "boundary=---------------------------1977426492562745908748943111");
34 putenv("REQUEST_METHOD=POST");
35
36 printf("cgiInitialize: ");
37 if (cgiInitialize())
38 {
39 const cgi_file_t *file; /* Upload file */
40
41 if ((file = cgiGetFile()) != NULL)
42 {
43 puts("PASS");
44 printf(" tempfile=\"%s\"\n", file->tempfile);
45 printf(" name=\"%s\"\n", file->name);
46 printf(" filename=\"%s\"\n", file->filename);
47 printf(" mimetype=\"%s\"\n", file->mimetype);
48 }
49 else
50 puts("FAIL (no file!)");
51 }
52 else
53 puts("FAIL (init)");
54
55 /*
56 * Return with no errors...
57 */
58
59 return (0);
60}

Callers

nothing calls this directly

Calls 2

cgiInitializeFunction · 0.85
cgiGetFileFunction · 0.85

Tested by

no test coverage detected