adding printf for debugging

This commit is contained in:
Dario 2019-10-10 06:49:48 +02:00
parent 9d31478440
commit 77b7251502
2 changed files with 11 additions and 6 deletions

View File

@ -15,10 +15,11 @@ void ElopageWebhook::handleRequest(Poco::Net::HTTPServerRequest& request, Poco::
std::istream& stream = request.stream();
Poco::Net::NameValueCollection elopageRequestData;
while (!stream.eof()) {
char keyBuffer[30];
char valueBuffer[35];
char keyBuffer[30]; memset(keyBuffer, 0, 30);
char valueBuffer[35]; memset(valueBuffer, 0, 35);
stream.get(keyBuffer, 30, '=')
.get(valueBuffer, 35, '&');
printf("[ElopageWebhook::handleRequest] key: %s, value: %s\n", keyBuffer, valueBuffer);
elopageRequestData.set(keyBuffer, valueBuffer);
}
UniLib::controller::TaskPtr handleElopageTask(new HandleElopageRequestTask(elopageRequestData));

View File

@ -13,7 +13,7 @@ namespace UniLib {
int Thread::init(const char* threadName)
{
semaphore.wait();
//semaphore.wait();
mPocoThread = new Poco::Thread(threadName);
mPocoThread->start(*this);
return 0;
@ -21,15 +21,19 @@ namespace UniLib {
Thread::~Thread()
{
printf("[Thread::~Thread]\n");
if(mPocoThread)
{
//Post Exit to Thread
exitCalled = true;
semaphore.wait();
printf("[Thread::~Thread] before semaphore wait\n");
//semaphore.wait();
printf("[Thread::~Thread] after semaphore wait, before condSignal\n");
condSignal();
printf("[Thread::~Thread] after condSignal, before thread join\n");
//SDL_Delay(500);
mPocoThread->join();
printf("[Thread::~Thread] after thread join\n");
//SDL_WaitThread(thread, NULL);
//LOG_WARNING_SDL();
delete mPocoThread;
@ -54,7 +58,7 @@ namespace UniLib {
//Thread* t = this;
while (true) {
try {
semaphore.tryWait(100);
//semaphore.tryWait(100);
//printf("[Thread::%s] end worker thread\n", __FUNCTION__);
//break;
if (exitCalled) return;