permit RWS to be disabled

RESOLVED FIXED

Status

Core Graveyard
Widget: OS/2
RESOLVED FIXED
10 years ago
3 years ago

People

(Reporter: Rich Walsh, Assigned: Peter Weilbacher)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

10 years ago
Created attachment 303160 [details] [diff] [review]
patch to nsRwsService.cpp

Currently, there's no reliable way to disable the RWS08 library's WPS-integration features.  The attached patch to nsRwsService.cpp tests for the environment variable "MOZ_NORWS" in the class's constructor.  If it exists, the constructor returns NS_ERROR_NOT_AVAILABLE - the same as when the library can't be found.
(Assignee)

Comment 1

10 years ago
Yes, that is a good idea, will make the doc part in README.txt easier. How about calling the variable MOZ_DISABLE_RWS instead? The other environment variable we have also test the value to be 1 or true. As there is no good way (that I know of) to unset a variable in standard CMD we should still use RWS if MOZ_DISABLE_RWS=0. Like we use for the hires timer in NSPR:

   char *envp;
   if ((envp = getenv("NSPR_OS2_NO_HIRES_TIMER")) != NULL) {
       if (atoi(envp) == 1)
           return;
   }
(Reporter)

Comment 2

10 years ago
(In reply to comment #1)

> How about calling the variable MOZ_DISABLE_RWS instead?

You already have MOZ_NO_REMOTE & NSPR_OS2_NO_HIRES_TIMER, so MOZ_NO_RWS would be more consistent (and somewhat easier to remember).

>  As there is no good way (that I know of) to unset a variable in standard CMD

"SET MOZ_NO_RWS="

> The other environment variable we have also test the value to be 1 or true.
> [...] we should still use RWS if MOZ_DISABLE_RWS=0. Like we use for the hires
> timer in NSPR:

I was more nearly emulating MOZ_NO_REMOTE:

    if (getenv("MOZ_NO_REMOTE")) {
        mUseDDE = PR_FALSE;
        *aResult = PR_TRUE;
        return NS_OK;
    }

Use whichever model you wish - and feel free to change my DosScanEnv() to getenv().
(Assignee)

Comment 3

10 years ago
(In reply to comment #2)
> You already have MOZ_NO_REMOTE & NSPR_OS2_NO_HIRES_TIMER, so MOZ_NO_RWS would
> be more consistent (and somewhat easier to remember).

OK, convinced.

> >  As there is no good way (that I know of) to unset a variable in standard CMD
> 
> "SET MOZ_NO_RWS="

Last time I tried that it wasn't really removed from the environment (still got something back from getenv()). Will retest, perhaps I messed something up back then.
(Assignee)

Comment 4

10 years ago
(In reply to comment #3)
> (In reply to comment #2)
> > >  As there is no good way (that I know of) to unset a variable in standard CMD
> > 
> > "SET MOZ_NO_RWS="
> 
> Last time I tried that it wasn't really removed from the environment (still got
> something back from getenv()). Will retest, perhaps I messed something up back
> then.

OK, turns out that that this is a bug in the YAOS shell that I still always come back to despite all the other great CMD replacements that are available.
(Assignee)

Comment 5

10 years ago
Created attachment 308229 [details] [diff] [review]
working patch

OK, I couldn't get DosScanEnv to compile (problems with const char** vs char** that I didn't just want to cast away) so I used PR_GetEnv instead. Rich, does that look OK to you, too?
Attachment #303160 - Attachment is obsolete: true
(Reporter)

Comment 6

10 years ago
(In reply to comment #5)
> Created an attachment (id=308229) [details]
> working patch
> 
> I used PR_GetEnv instead. Rich, does that look OK to you, too?

Sure.  I suppose PR_GetEnv() was always the "proper" way to do this.
(Assignee)

Comment 7

10 years ago
Great, fix checked into trunk.
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.