Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#56560 closed enhancement (worksforme)

squid3 port file has no --enable-http-violations option or variant

Reported by: essandess (Steve Smith) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: squid3

Description (last modified by mf2k (Frank Schima))

The port file for squid3 does not have an option to set the --enable-http-violations configuration flag. This option is necessary for squid to edit HTTP headers.

It is possible to add this flag by hand with the edit sudo vi `port file squid3`, and adding it manually under configure.args. This works, but obviously any update to the squid3 port file will wipe it away.

Would you please consider adding the --enable-http-violations to the squid3 port? My own rank-order preferences to accomplish this are:

  1. The flag --enable-http-violations is a default in the standard squid3 port file.
  2. Create a squid3 port variant for --enable-http-violations.
  3. Add a user-configurable config options list that can be modified on the port command line call.

Change History (8)

comment:1 Changed 6 years ago by essandess (Steve Smith)

Type: defectenhancement

comment:2 Changed 6 years ago by mf2k (Frank Schima)

Cc: jmroot removed
Keywords: enable http violations config.args port file removed
Milestone: MacPorts 2.7.0
Owner: set to jmroot
Status: newassigned
Version: 2.5.0

The Milestone field is for use by Macports team members only, please do not set it.

comment:3 Changed 6 years ago by mf2k (Frank Schima)

Description: modified (diff)

comment:4 Changed 6 years ago by jmroot (Joshua Root)

I'm confused, ./configure --help only lists a --disable-http-violations option, which the Portfile is not using.

comment:5 Changed 6 years ago by jmroot (Joshua Root)

Resolution: worksforme
Status: assignedclosed

And indeed in the configure output:

configure: HTTP violations support enabled: yes
Last edited 6 years ago by jmroot (Joshua Root) (previous) (diff)

comment:6 Changed 5 years ago by essandess (Steve Smith)

@jmroot

The ./configure file code shows that --enable-http-violations must be set explicitly. I know this is true for version 4, and also believe it was true for version 3.

  1. I observe that squid does not modify headers unless it is configured explicitly with this flag.
  1. I checked its ./configure file and see that it is not set by default. Sanity checking:
( cd ~/Downloads/ ; tar xkf /opt/local/var/macports/distfiles/squid4/squid-4.6.tar.xz )
cd ~/Downloads/squid-4.6/
less ./configure
# Check whether --enable-http-violations was given.
if test "${enable_http_violations+set}" = set; then :
  enableval=$enable_http_violations;

As you can see, unless --enable-http-violations is explicitly passed to ./configure, it isn't set.

comment:7 Changed 5 years ago by jmroot (Joshua Root)

You are misreading the code. The part relevant to the default behaviour is further down:

squid_tmp_define=""
case "${enable_http_violations:=yes}" in
  yes|true|1) squid_tmp_define="1" ;;
  no|false|0|"") squid_tmp_define="0" ;;
  *) as_fn_error $? "SQUID_DEFINE_BOOL: unrecognized value for USE_HTTP_VIOLATIONS: '${enable_http_violations:=yes}'" "$LINENO" 5 ;;
esac

cat >>confdefs.h <<_ACEOF
#define USE_HTTP_VIOLATIONS $squid_tmp_define
_ACEOF

Note the :=yes in the line case "${enable_http_violations:=yes}" in. If no explicit value was passed in, it defaults to yes.

comment:8 Changed 5 years ago by essandess (Steve Smith)

@jmroot You are correct, and I am wrong.

I even see after the code I posted the yes default parameter setting in ${enable_http_violations:=yes} a few lines below.

Sorry for raising this again. I recall after an opaque debugging session this not being set or working back in version 2.7, and am now apparently still trying to debug it in version 4.

Note: See TracTickets for help on using tickets.