18 |
|
{ |
19 |
|
XMLPlatformUtils::Initialize(); |
20 |
|
XalanTransformer::initialize(); |
21 |
< |
|
21 |
> |
|
22 |
|
Bender bender; |
23 |
|
|
24 |
|
XalanTransformer::terminate(); |
31 |
|
Bender::Bender() |
32 |
|
{ |
33 |
|
string path = sgetenv("PATH_TRANSLATED"); |
34 |
– |
ifstream file(path.c_str()); |
34 |
|
|
35 |
< |
if (path != "" && file.is_open()) |
35 |
> |
|
36 |
> |
if (path != "") |
37 |
|
{ |
38 |
< |
file.close(); |
39 |
< |
|
40 |
< |
bend(path, sgetenv("HTTP_USER_AGENT")); |
38 |
> |
ifstream file(path.c_str()); |
39 |
> |
|
40 |
> |
if (file.is_open()) |
41 |
> |
{ |
42 |
> |
file.close(); |
43 |
> |
|
44 |
> |
bend(path, sgetenv("HTTP_USER_AGENT")); |
45 |
> |
} |
46 |
> |
else |
47 |
> |
{ |
48 |
> |
cout << "Status: 404\n" |
49 |
> |
<< "Content-Type: text/html; charset=ISO-8859-1\n\n" |
50 |
> |
<< "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n" |
51 |
> |
<< "<html><head>\n" |
52 |
> |
<< "<title>404 Not Found</title>\n" |
53 |
> |
<< "</head><body>\n" |
54 |
> |
<< "<h1>Not Found</h1>\n" |
55 |
> |
<< "<p>The requested URL " << sgetenv("PATH_INFO") << " was no" |
56 |
> |
<< "t found on this server.</p>\n" |
57 |
> |
<< "<hr />\n" |
58 |
> |
<< sgetenv("SERVER_SIGNATURE") |
59 |
> |
<< "</body></html>\n"; |
60 |
> |
} |
61 |
|
} |
62 |
|
else |
63 |
|
{ |
64 |
< |
cout << "Status: 404\n" |
45 |
< |
<< "Content-Type: text/html; charset=ISO-8859-1\n\n" |
46 |
< |
<< "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n" |
47 |
< |
<< "<html><head>\n" |
48 |
< |
<< "<title>404 Not Found</title>\n" |
49 |
< |
<< "</head><body>\n" |
50 |
< |
<< "<h1>Not Found</h1>\n" |
51 |
< |
<< "<p>The requested URL " << sgetenv("PATH_INFO") << " was not fo" |
52 |
< |
<< "und on this server.</p>\n" |
53 |
< |
<< "<hr />\n" |
54 |
< |
<< sgetenv("SERVER_SIGNATURE") |
55 |
< |
<< "</body></html>\n"; |
64 |
> |
cout << "Location: http://computers.douglasthrift.net/bender.xml\n\n"; |
65 |
|
} |
66 |
|
} |
67 |
|
|
128 |
|
{ |
129 |
|
type = matcher[1]; |
130 |
|
} |
131 |
< |
|
131 |
> |
|
132 |
|
cout << "Content-Type: " << type << "\n\n" << output.str(); |
133 |
|
} |
134 |
|
else |