|
|
|
@ -6,15 +6,16 @@ using std::strcmp;
|
|
|
|
|
#include "Foohash.H"
|
|
|
|
|
#include "Routerin.H"
|
|
|
|
|
|
|
|
|
|
#include "StaticFileHandler.H"
|
|
|
|
|
#include "UltraSimpleStaticFileHandler.H"
|
|
|
|
|
//#include "StaticFileHandler.H"
|
|
|
|
|
//#include "UltraSimpleStaticFileHandler.H"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
using std::cout;
|
|
|
|
|
using std::endl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Routerin::Routerin():
|
|
|
|
|
sfh( new UltraSimpleStaticFileHandler())
|
|
|
|
|
sfh( new MediocreSimpleStaticFileHandler())
|
|
|
|
|
{
|
|
|
|
|
cout << "Konstr Routering" << std::endl;
|
|
|
|
|
}
|
|
|
|
@ -57,10 +58,12 @@ int Routerin::event_request_route(struct mg_event *event){
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
std::cerr << "fallback ";
|
|
|
|
|
retval = rq_static((pntrstr),event);
|
|
|
|
|
retval = rq_static("illegalurl.htm",event);
|
|
|
|
|
};
|
|
|
|
|
}else{
|
|
|
|
|
std::cerr << "no blub! in " << __LINE__ << endl;
|
|
|
|
|
retval = rq_static("illegalurl.htm",event);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
std::free(tmpstr);
|
|
|
|
@ -74,7 +77,6 @@ int Routerin::event_request_route(struct mg_event *event){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int Routerin::rq_static(char const * const reststr , struct mg_event *event)
|
|
|
|
|
{
|
|
|
|
|
std::cerr << " a static file is reqested!" << endl;
|
|
|
|
|