]> git.ipfire.org Git - thirdparty/squid.git/commit - src/ipc/Kids.cc
Do not abuse argv[0] to supply roles and IDs to SMP kids (#176) M-staged-PR176
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Mon, 30 Apr 2018 16:57:53 +0000 (16:57 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Mon, 30 Apr 2018 16:57:58 +0000 (16:57 +0000)
commit28bca1f7ed8d8ce939e901df544c9d7a0b4594cb
tree181c7e7928087ef3fb60bbebafd34e49ca83c9f4
parent23da195f75b394d00ddac4fa67ce6895d96292d7
Do not abuse argv[0] to supply roles and IDs to SMP kids (#176)

Use a newly added "--kid role-ID" command line option instead. Just like
argv[0], the new option is not meant for direct/human use.

This change allows exec(3)-wrapping tools like Valgrind to work with SMP
Squid: When launching kid processes, Valgrind does not pass Squid-formed
argv[0] to kid processes, breaking old kid role and ID detection code.

This change does not alter argv[0] of Squid processes. There is nothing
wrong with Squid-formed argv[0] values for Squid kids.

Also added a CommandLine class to support command line parsing without
code duplication. Squid needs to handle the new --kid option way before
the old mainParseOptions() handles the other options. The new class also
encapsulates argv manipulations, reducing main.cc pollution.
src/CommandLine.cc [new file with mode: 0644]
src/CommandLine.h [new file with mode: 0644]
src/Makefile.am
src/cache_cf.cc
src/ipc/Kid.cc
src/ipc/Kid.h
src/ipc/Kids.cc
src/ipc/Kids.h
src/main.cc
src/squid.8.in