]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Make pickCmd take the jobtype, not the request
authorAidan Van Dyk <aidan@ifax.com>
Fri, 4 May 2007 17:21:05 +0000 (17:21 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Fri, 4 May 2007 17:21:05 +0000 (17:21 +0000)
faxd/faxQueueApp.c++
faxd/faxQueueApp.h

index 2677da79f563768fa63d9827f8e4b3059a3f94e7..01439ce1856a279d847a392d7efbf2c932f473f2 100644 (file)
@@ -1211,11 +1211,11 @@ faxQueueApp::makeCoverPage(Job& job, FaxRequest& req, const Class2Params& params
 }
 
 const fxStr&
-faxQueueApp::pickCmd(const FaxRequest& req)
+faxQueueApp::pickCmd(const fxStr& jobtype)
 {
-    if (req.jobtype == "pager")
+    if (jobtype == "pager")
        return (sendPageCmd);
-    if (req.jobtype == "uucp")
+    if (jobtype == "uucp")
        return (sendUUCPCmd);
     return (sendFaxCmd);                       // XXX gotta return something
 }
@@ -1300,7 +1300,7 @@ faxQueueApp::sendJobStart(Job& job, FaxRequest* req)
 {
     job.start = Sys::now();                    // start of transmission
     // XXX start deadman timeout on active jobs
-    const fxStr& cmd = pickCmd(*req);
+    const fxStr& cmd = pickCmd(req->jobtype);
     fxStr dargs(job.getJCI().getArgs());
     pid_t pid = fork();
     switch (pid) {
@@ -1361,7 +1361,7 @@ faxQueueApp::sendJobDone(Job& job, int status)
        logError("JOB %s: %s", (const char*)job.jobid, (const char*) req->notice);
     } else if ((status >>= 8) == 127) {
        req->notice = "Send program terminated abnormally; unable to exec " |
-           pickCmd(*req);
+           pickCmd(req->jobtype);
        req->status = send_failed;
        logError("JOB %s: %s",
                (const char*)job.jobid, (const char*)req->notice);
index 14258a463ac554ecc7132f24fa4b033a2ec8b067..9288a9bd9b3002d488211c8d8367c89598ecb48a 100644 (file)
@@ -183,7 +183,7 @@ private:
 // miscellaneous stuff
     void       startTimeout(long ms);
     void       stopTimeout(const char* whichdir);
-    const fxStr& pickCmd(const FaxRequest& req);
+    const fxStr& pickCmd(const fxStr& jobtype);
 // FIFO-related stuff
     void       childStatus(pid_t, int);        // Dispatcher hook
     int                inputReady(int);                // Dispatcher hook