Re: denyMessage() vs setDenyMessage()

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 21 Nov 2012 14:09:22 +1300

On 21.11.2012 07:29, Alex Rousskov wrote:
> Hello,
>
> Should the following calls use setDenyMessage() instead?
>
>> ./auth/negotiate/UserRequest.cc:
>> auth_user_request->denyMessage("Authentication in progress");
>> ./auth/negotiate/UserRequest.cc:
>> auth_user_request->denyMessage("NTLM authentication requires a
>> persistent connection");
>> ./auth/negotiate/UserRequest.cc:
>> auth_user_request->denyMessage("Login successful");
>> ./auth/negotiate/UserRequest.cc:
>> auth_user_request->denyMessage(arg);
>> ./auth/negotiate/UserRequest.cc:
>> auth_user_request->denyMessage(blob);
>> ./auth/ntlm/UserRequest.cc:
>> auth_user_request->denyMessage("Authentication in progress");
>> ./auth/ntlm/UserRequest.cc:
>> auth_user_request->denyMessage("NTLM authentication requires a
>> persistent connection");
>> ./auth/ntlm/UserRequest.cc:
>> auth_user_request->denyMessage("Login successful");
>> ./auth/ntlm/UserRequest.cc:
>> auth_user_request->denyMessage(blob);
>> ./auth/ntlm/UserRequest.cc:
>> auth_user_request->denyMessage(blob);
>
>

Yes they should.

I think more importantly that the three forms of this accessor should
be combined into the more normal overloaded forms ASAP:
   void denyMessage(const char *msg);
   const char *denyMessage(void);

There are only three points in the code needing that default-string
accessor and a fast inline get()?get():default pattern would seem to be
very appropriate for all those usage points.

Amos
Received on Wed Nov 21 2012 - 01:09:26 MST

This archive was generated by hypermail 2.2.0 : Wed Nov 21 2012 - 12:00:08 MST