30 Commits

Author SHA1 Message Date
Andrei Kapishnikov
1e64ab3e56 Replace absolute_uri with absolute_path when HTTP request is forwarded to non-proxy server.
According to the spec (http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html):
When Request-URI is used to identify a resource on an origin server or
gateway, the absolute path of the URI MUST be transmitted as the
Request-URI.

Before the change,the proxy sent absolute_uri, which is used to send
HTTP requests to proxies: “The absoluteURI form is REQUIRED when the
request is being made to a proxy.”

Related Bug 18776631

Other changes:
1. Remove proxy-connection header when the request is sent to an
origin server.

2. Added “connection = close” header to indicate that the origin
server needs to close the connection right after the response.
Currently, our proxy does not support keep-alive (persistent)
connections because it analyses only the first request for a given
connection and; therefore, cannot perform required request content
substitutions.

3. Fixed an issue when a non-numeric host port number resulted in
forwarding requests to default 443 port for SSL connections, e.g.
request to https://google.com:ZZZ, would be translated to
https://google.com:443.

4. Fixed an issue when the proxy tries to establish direct connection
to the origin server even when it is not supposed to do that
according to PAC. That happened when PAC returned a proxy server
that is not available.

5. Prevent ProxyServer from crashing when PacService throws
an exception by intercepting all exception types.

Change-Id: I7d50b13b4cb24199a690a53c1925e87c15a8d45b
2015-02-11 14:58:31 -05:00
Andrei Kapishnikov
44c0259037 Do not throw NullPointerException from PacService
Do not throw NullPointerException from PacService
since the calling client may not expect it and crash.

Fix of Bug 18818567

Change-Id: Ic36e8a1ca13cdaa7f605b6ade9cc6783517cbf40
2015-01-16 15:57:55 -05:00
Dan Albert
47249598cb am 582bdf9a: am d8c169fe: am 0c437fd3: Merge "Add appropriate casts for char16_t."
* commit '582bdf9a5961a32de27556832e23e0611c4d1cbb':
  Add appropriate casts for char16_t.
2014-11-20 23:19:06 +00:00
Dan Albert
6698749dd4 Add appropriate casts for char16_t.
C++11 defines a real char16_t, which is not implicitly convertible to
uint16_t (and by extension jchar). Add casts as needed.

Bug: 18300613
Change-Id: I00752002ef2e938bdb57f70947e8fd53ec103293
2014-11-20 11:47:40 -08:00
Andreas Gampe
18fddfe020 am c25e0dce: am 5b50cd13: Merge "Frameworks/base: Fix build"
* commit 'c25e0dcea982468225c4150dcb699db5185a1eee':
  Frameworks/base: Fix build
2014-11-14 19:15:59 +00:00
Andreas Gampe
2e4ad0a641 am d99c25ef: am 37079e29: Merge "Frameworks/base: Wall Werror in packages"
* commit 'd99c25eff3ad421b900caf7af82f970b23a81733':
  Frameworks/base: Wall Werror in packages
2014-11-14 19:15:52 +00:00
Andreas Gampe
577f48c1c9 Frameworks/base: Fix build
Fix a typo.

Change-Id: Ida417c842563576b053d9f5553a2aa8d5862897c
2014-11-13 15:44:27 -08:00
Andreas Gampe
423ba098bd Frameworks/base: Wall Werror in packages
Turn on -Wall -Werror in packages/. Fix warnings.

Change-Id: I4ec7256a7df46017e1895575719f2b5aca978bd0
2014-11-13 15:25:34 -08:00
Dan Albert
45670c1dc5 am b28ff487: resolved conflicts for merge of 5e6cf242 to lmp-mr1-dev-plus-aosp
* commit 'b28ff487fb6db4a44e4d18aa17d8253f00a63bb6':
  Move frameworks/base over to libc++.
2014-11-12 21:31:33 +00:00
Dan Albert
ff1d8a6635 Move frameworks/base over to libc++.
Bug: 15193147
Change-Id: I96109d2d383f0c8a4aaa611f29fcf887afb3c69e
2014-11-12 11:22:20 -08:00
Jason Monk
ae392155a2 Remove unused constant and associated STOPSHIP
Bug: 10459877
Change-Id: Ic8a6632176a9417af246709c940f658639e42317
2014-09-19 13:19:06 +00:00
Narayan Kamath
80aceae89e am f4e0bf9f: am 98993813: am b75b3aaa: Merge "Build PacProcessor for 64 bit."
* commit 'f4e0bf9fe191ab86ff1dd6ba8060a34826017928':
  Build PacProcessor for 64 bit.
2014-05-28 18:02:16 +00:00
Narayan Kamath
96132a1907 Build PacProcessor for 64 bit.
external/chromium-libpac can now build for 64 bit.

Change-Id: I0bfd068ef4ea7d57686f11b79c32803e38bab719
2014-05-27 17:06:18 +01:00
Andreas Gampe
4694175624 PacProccesor: Only build for 32-bit
PacProcessor relies on libpac from chromium, which is not built
for 64b right now.

(cherry picked from commit f8749200c06a8714ffd46f5e2ec81be57ad4f7f4)

Change-Id: Ic128e17b7437c130df29eeab3293b9c01f01d70b
2014-05-27 11:56:22 +01:00
Ying Wang
38250d9b84 Use LOCAL_JNI_SHARED_LIBRARIES to install JNI libs.
Change-Id: Ibef01983891377b859d28cff801f48ef5d8eabb2
2014-04-18 16:39:47 -07:00
Andreas Gampe
f8749200c0 PacProccesor: Only build for 32-bit
PacProcessor relies on libpac from chromium, which is not built
for 64b right now.

Change-Id: I034932343b9aef239748511d8deb498b46e77cf2
2014-04-18 23:12:39 +00:00
Ying Wang
56f43240f9 Use LOCAL_JNI_SHARED_LIBRARIES to install JNI libs.
Change-Id: Ibef01983891377b859d28cff801f48ef5d8eabb2
2014-04-17 18:14:50 -07:00
Glenn Kasten
9eed0c624e am 6afcecdc: am 2fb4a6bb: am 48988921: am d6408735: Merge "PacProcessor should be 32 bit only."
* commit '6afcecdc15b0baec1398e344f90666e13b8e337c':
  PacProcessor should be 32 bit only.
2014-03-19 19:54:03 +00:00
Narayan Kamath
58f9a645e1 PacProcessor should be 32 bit only.
It depends on external/v8, which isn't ready for 64 bit yet.

Change-Id: Ibc9705665b81d3667826dedd6217f2eb6d451c81
2014-03-19 11:39:43 +00:00
John Spurlock
6090995951 Remove unused imports from frameworks/base.
Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
2013-11-20 11:31:47 -05:00
Jason Monk
179d6e8e20 Change PacProxySelector to return unresolved addr
This was found by a bug in Firefox where it expects the addresses from a
ProxySelector to be unresolved.  Since ProxySelectorImpl returns unresolved
addresses the PAC version should as well to avoid breaking apps.

The ProxyServer also needed to be updated to reflect this change as it was
expecting a resolved InetSocketAddress.

Bug: 11443853
Change-Id: I3a4e9e248d22d7808603c147660df708e01cdf82
2013-10-31 14:17:48 -04:00
Jason Monk
fa4518f763 PAC Local Proxy to only receive lo connections
This changes the Local Proxy used in PAC to only accept connections coming
from the device.

Bug: 10230718
Change-Id: I5fbeb3aa018df5179a403301021f452e910a517d
2013-09-18 09:22:11 -04:00
Jason Monk
6f8a68f49a Guarantee that PAC Local Proxy owns Port
This changes the PAC support to not broadcast the Proxy information until
the Local Proxy has started up and successfully bound to a port so that
the local proxy information can be guaranteed to be owned by the proxy.

Bug: 10459877
Change-Id: I175cd3388c758c55e341115e4a8241884b90d633
2013-09-13 09:53:26 -04:00
Jason Monk
e6b4163f38 Merge "Verify inputs to PAC resolving." into klp-dev 2013-09-10 20:27:23 +00:00
Jason Monk
da205a749f System binds PAC Local Proxy instead of self start
The PAC Local Proxy priviously caught proxy broadcasts and started itself
when needed.  Now it is bound by the system the same way the pac processing
service is started.

Bug: 10425091
Change-Id: I746daa21645a11aa18ef464f00c8cb5536d8c86f
2013-08-22 16:33:26 -04:00
Jason Monk
7a6af1c093 Verify inputs to PAC resolving.
This verifies both the URL and host are valid before they are passed to the
javascript for PAC.  This is to protect against injection attacks.

Bug: 10230771
Change-Id: Ib1996181971a49ccd390f181ec3848124801e4d5
2013-08-22 15:46:11 -04:00
Jason Monk
ff796e5a24 Merge "Change PacProcessor to Android Service" into klp-dev 2013-08-20 23:35:26 +00:00
Jason Monk
9ced3cd9d6 Change PacProcessor to Android Service
This switches the PacProcessor over to an Android Service.  The service
is bound and unbound by the PacManager, which also adds it to the
ServiceManager, allowing for Context-Free access by the PacProxySelector
in all DVMs.

bug:10182711
Change-Id: Id1ff7660be56e8976cdcccd76e041feb47a17a61
2013-08-20 17:36:39 -04:00
Jason Monk
433ba46fcc Fix ProxyHandler to only run when needed
Changes ProxyHandler service to only be active when needed for PAC services.

Bug: 10260877
Change-Id: If42e53e805488fd08381baa96409ba3027661c70
2013-08-20 15:27:51 -04:00
Jason Monk
602b232a06 Add PAC File support for proxy configuration
PAC (Proxy auto-config) files contain a single javascript function,
FindProxyForURL(url, host).  It gets called to determine what proxy should be
used for a specific request.

This adds PAC support to the system.  The ProxyProperties has been modified
to hold the PAC file when one is present.  The Proxy method
setHttpProxySystemProperty has been modified to insert a PacProxySelector
as the default ProxySelector when it is required.  This new ProxySelector
makes calls to the ConnectivityService to parse the PAC file.

The ConnectivityService and the WifiConfigStore have been modified to support
saving the extra PAC file data.

The ConnectivityService now has a class attached (PacProxyNative) that
interfaces to the native calls for PAC files.  The parsing of the PAC file
is handled by libpac (which is being added to external/) which utilizes
libv8 to parse the javascript.

As a fallback to applications that don't use the java ProxySelector,  the proxy
is setup to point to a local proxy server that will handle the pac parsing.

bug:10182711
Change-Id: I5eb8df893c632fd3e1b732385cb7720ad646f401
2013-08-07 21:01:39 -04:00