ahhh SCHEIẞE... kann keinen memberfunction als mg callback nehm :(

This commit is contained in:
john stone 2014-01-18 15:10:23 +01:00
parent 959c8b134c
commit 64f2193b2a
3 changed files with 9 additions and 7 deletions

View File

@ -6,12 +6,14 @@ using std::strcmp;
#include "Foohash.H"
#include "Routerin.H"
#include "UltraSimpleStaticFileHandler.H"
using std::cout;
using std::endl;
Routerin::Routerin():
sfh(new UltraSimpleStaticFileHandler())
sfh( UltraSimpleStaticFileHandler())
{
cout << "Konstr Routering" << std::endl;
}
@ -93,7 +95,7 @@ int Routerin::rq_static(char const * const reststr , struct mg_event *event)
{
std::cerr << " a static file is reqested!" << endl;
std::cerr << " path: " << reststr << endl;
sfh->answer_pathreq(reststr,event->conn);
sfh.answer_pathreq(reststr,event->conn);
return 1;
}

View File

@ -1,7 +1,7 @@
#pragma once
#include "StaticFileHandler.H"
#include "SimpleStaticFileHandler.h"
class UltraSimpleStaticFileHandler : StaticFileHandler
class UltraSimpleStaticFileHandler :public StaticFileHandler
{
public:
int answer_pathreq(const char * const path, struct mg_connection *conn);

View File

@ -18,7 +18,7 @@ class MongooseHandler{
struct mg_context *ctx;
//const char *options[];
unsigned short listenport;
Routerin routerin;
// = {"listening_ports", "8080", NULL};
public:
@ -32,7 +32,7 @@ class MongooseHandler{
std::snprintf(portstring,8,"%d",this->listenport);
const char *options[] =
{"listening_ports",portstring,nullptr};
this->ctx= mg_start(options, &(routerin::event_route),nullptr);
this->ctx= mg_start(options, routerin.event_route,nullptr);
}
//no copy constructor: