From: Amos Jeffries Date: Mon, 5 May 2014 11:56:25 +0000 (-0700) Subject: url_fake_rewrite: concurrency channel support X-Git-Tag: SQUID_3_5_0_1~247 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb93aaa47625d637f9523ea77f29b2871c1b8817;p=thirdparty%2Fsquid.git url_fake_rewrite: concurrency channel support --- diff --git a/helpers/url_rewrite/fake/fake.cc b/helpers/url_rewrite/fake/fake.cc index 314e507c48..09e12787d9 100644 --- a/helpers/url_rewrite/fake/fake.cc +++ b/helpers/url_rewrite/fake/fake.cc @@ -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; }