0

I'm working on a CUPS filter in C++ (g++ as compiler). The code is a authentication process and a only can release the job if the authentication is correct. If it's wrong, I have to cancel the print job.

When I print a document and the filter works, it runs a bunch of code in the authentication process, but suddenly, he stops works. If I comment a piece of code (doesn't matter what piece is), it runs correct a little more at the sequence of authentication. I tested the code when I split then, and the flow works fine.

There are a possible cause for this bug - a stack size limit, a time limit or other common bug?

Thanks.

Code:

Waiting for response of authentication (Java creates a data file)

/** Start monitor of authentication response **/

time_t starttime, now;
time(&starttime);

pthread_t thread_id = starttime;
pthread_create(&thread_id, 0, &FileManager, NULL);

do{
    sleep(1);
    time(&now);
}while(!file_available && difftime(now, starttime) < config.GetJobTimeout());

pthread_cancel(thread_id);

...

ReturningJob returningJob;
returningJob.Execute(path + expected_filename);

ReturningJob file

this->Fill(filepath);

std::string xml = this->GetSerializedXML();
this->SaveFile(this->GenerateFilename(path), xml);
msantiago
  • 346
  • 2
  • 4
  • 14

0 Answers0