]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
url_fake_rewrite: concurrency channel support
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 5 May 2014 11:56:25 +0000 (04:56 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 5 May 2014 11:56:25 +0000 (04:56 -0700)
helpers/url_rewrite/fake/fake.cc

index 314e507c485741bd5b0c96acca4fb92aa76610fe..09e12787d99c8e121e3956f10eee1e706e9956f7 100644 (file)
@@ -109,9 +109,16 @@ main(int argc, char *argv[])
 
         debug("Got %d bytes '%s' from Squid\n", buflen, buf);
 
-        /* send 'no-change' result back to Squid */
-        fprintf(stdout,"\n");
+        p = NULL;
+        int64_t channelId = strtoll(buf, &p, 10);
+        if (*p != ' ') {
+            /* send 'no-change' result back to Squid in non-concurrent format */
+            fprintf(stdout,"ERR\n");
+        } else {
+            /* send 'no-change' result back to Squid in concurrent format */
+            fprintf(stdout, "%" PRId64 " ERR\n", channelId);
+        }
     }
     debug("%s build " __DATE__ ", " __TIME__ " shutting down...\n", my_program_name);
-    exit(0);
+    return 0;
 }