Changeset 2939 for trunk/gsdl/src/recpt/cgiwrapper.cpp
- Timestamp:
- 2002-02-04T11:26:20+13:00 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/cgiwrapper.cpp
r2344 r2939 193 193 errortext += "correctly.\n"; 194 194 195 text_t init_file = filename_cat (gsdlhome, "etc", "initout.txt"); 196 char *ifile = init_file.getcstr(); 197 ifstream initin (ifile); 198 delete ifile; 199 if (initin) { 200 errortext += "The initialisation error log, " + init_file + ", contains the\n"; 201 errortext += "following information:\n\n"; 202 if (!debug) errortext += "<pre>\n"; 203 204 char c; 205 initin.get(c); 206 while (!initin.eof ()) { 207 errortext.push_back(c); 208 initin.get(c); 209 } 210 211 if (!debug) errortext += "</pre>\n"; 212 213 initin.close(); 214 215 } else { 216 errortext += "Please consult " + init_file + " for more information.\n"; 217 } 218 219 format_error_string (errorpage, errortext, debug); 220 } 221 222 static void page_errorparseargs (const text_t &gsdlhome, bool debug, text_t &errorpage) { 223 224 text_t errortext = "An error occurred during the parsing of the cgi arguments.\n"; 225 226 text_t error_file = filename_cat (gsdlhome, "etc", "errout.txt"); 195 text_t error_file = filename_cat (gsdlhome, "etc", "error.txt"); 227 196 char *efile = error_file.getcstr(); 228 197 ifstream errin (efile); … … 239 208 errin.get(c); 240 209 } 210 241 211 if (!debug) errortext += "</pre>\n"; 212 242 213 errin.close(); 243 214 … … 249 220 } 250 221 251 static void page_error cgipage(const text_t &gsdlhome, bool debug, text_t &errorpage) {252 253 text_t errortext = "An error occurred during the construction of the cgi page.\n";254 255 text_t error_file = filename_cat (gsdlhome, "etc", "erro ut.txt");222 static void page_errorparseargs (const text_t &gsdlhome, bool debug, text_t &errorpage) { 223 224 text_t errortext = "An error occurred during the parsing of the cgi arguments.\n"; 225 226 text_t error_file = filename_cat (gsdlhome, "etc", "error.txt"); 256 227 char *efile = error_file.getcstr(); 257 228 ifstream errin (efile); … … 278 249 } 279 250 251 static void page_errorcgipage (const text_t &gsdlhome, bool debug, text_t &errorpage) { 252 253 text_t errortext = "An error occurred during the construction of the cgi page.\n"; 254 255 text_t error_file = filename_cat (gsdlhome, "etc", "error.txt"); 256 char *efile = error_file.getcstr(); 257 ifstream errin (efile); 258 delete efile; 259 if (errin) { 260 errortext += "The error log, " + error_file + ", contains the\n"; 261 errortext += "following information:\n\n"; 262 if (!debug) errortext += "<pre>\n"; 263 264 char c; 265 errin.get(c); 266 while (!errin.eof ()) { 267 errortext.push_back(c); 268 errin.get(c); 269 } 270 if (!debug) errortext += "</pre>\n"; 271 errin.close(); 272 273 } else { 274 errortext += "Please consult " + error_file + " for more information.\n"; 275 } 276 277 format_error_string (errorpage, errortext, debug); 278 } 279 280 280 static void print_debug_info (receptionist &recpt) { 281 281 … … 289 289 << "Configuration and initialization completed successfully.\n" 290 290 << " Note that more debug information may be available in the\n" 291 << " initialization and error logs initout.txt and errout.txt\n" 292 << " in " << etc_dir << ".\n" 291 << " initialization and error log error.txt in " << etc_dir << ".\n" 293 292 << "------------------------------------------------------------\n\n"; 294 293 … … 542 541 } 543 542 544 text_t init_file = filename_cat (gsdlhome, "etc", "initout.txt");545 char * iout = init_file.getcstr();546 ofstream initout (iout);547 delete iout;548 if (!recpt.init( initout)) {543 text_t error_file = filename_cat (gsdlhome, "etc", "error.txt"); 544 char *eout = error_file.getcstr(); 545 ofstream errout (eout, ios::app); 546 delete eout; 547 if (!recpt.init(errout)) { 549 548 // an error occurred during the initialisation 550 initout.close();549 errout.close(); 551 550 page_errorinit(gsdlhome, debug, errorpage); 552 551 } 553 initout.close();552 errout.close(); 554 553 } 555 554 … … 648 647 // output page 649 648 if (errorpage.empty()) { 650 text_t error_file = filename_cat (gsdlhome, "etc", "erro ut.txt");649 text_t error_file = filename_cat (gsdlhome, "etc", "error.txt"); 651 650 char *eout = error_file.getcstr(); 652 651 ofstream errout (eout, ios::app);
Note:
See TracChangeset
for help on using the changeset viewer.