We need this in a few places and while calling Gestalt() isn’t that much code, that function is deprecated in 10.8 and the alternative is a lot more code, so we don’t want to repeat that once we update the code.
Instead of passing the file descriptor to the child, and have the child close it, we set FD_CLOEXEC on the file descriptor in the parent process.
While it limits the window in which another thread can fork() and cause the file descriptor to be “leaked”, it doesn’t eliminate the problem.
This should hopefully solve the issue with the (on some systems) fairly aggressive temp cleaner.
Also remove the archive incase the user cancels the update, now that we are extracting it to a less temporary location.
This used to contain an UUID used for identifying the client in network requests, but for majority of users, this is unset, so now we create our own UUID for the user agent string used when polling for software updates.
Since the PAC URL is user supplied it’s unknown what state it actually is in, so we try to create a CFURL object from the raw string and if that fails, we URL-escape it (though not escaping slashes and colons).
Should fix issue #228.
We now bypass the global proxy if trying to connect to localhost (as some of our tests do) and we also hand the actual target URL to the potential proxy auto configuration (PAC) script.
The cf::wrap function returns a temporary object that can be converted to a CFType, but this object’s lifetime is that of the temporary object returned. By putting the result of cf::wrap into a C array we keep the CFTypeRef around longer than the temporary object.
Previously this was under the OakSystem framework which depends on the io framework meaning that the io framework itself was unable to obtain a basic environment, which is necessary for next commit.
GlimmerBlocker (http://GlimmerBlocker.org) and other proxies may intercept the web data and replace the HTTP/1.0 response with a HTTP/1.1 response.
Modified test to accept either.