FreeBSD Bugzilla – Attachment 148691 Details for
Bug 194623
fix net/libproxy, net/libproxy-webkit auto proxy configuration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch file
patch-net_libproxy.diff (text/plain), 4.55 KB, created by
Eric Camachat
on 2014-10-27 06:28:26 UTC
(
hide
)
Description:
patch file
Filename:
MIME Type:
Creator:
Eric Camachat
Created:
2014-10-27 06:28:26 UTC
Size:
4.55 KB
patch
obsolete
>Index: net/libproxy/files/patch-libproxy_modules_config_envvar.cpp >=================================================================== >--- net/libproxy/files/patch-libproxy_modules_config_envvar.cpp (revision 0) >+++ net/libproxy/files/patch-libproxy_modules_config_envvar.cpp (working copy) >@@ -0,0 +1,15 @@ >+--- libproxy/modules/config_envvar.cpp.orig 2014-10-22 23:01:48.000000000 -0700 >++++ libproxy/modules/config_envvar.cpp 2014-10-22 23:09:25.000000000 -0700 >+@@ -27,6 +27,12 @@ public: >+ url get_config(url url) throw (runtime_error) { >+ char *proxy = NULL; >+ >++ if (!(proxy = getenv("auto_proxy"))) >++ proxy = getenv("AUTO_PROXY"); >++ if (proxy) { >++ return libproxy::url(string("pac+") + string(proxy)); >++ } >++ >+ // If the URL is an ftp url, try to read the ftp proxy >+ if (url.get_scheme() == "ftp") { >+ if (!(proxy = getenv("ftp_proxy"))) > >Property changes on: net/libproxy/files/patch-libproxy_modules_config_envvar.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: net/libproxy/files/patch-libproxy_modules_pacrunner__webkit.cpp >=================================================================== >--- net/libproxy/files/patch-libproxy_modules_pacrunner__webkit.cpp (revision 371530) >+++ net/libproxy/files/patch-libproxy_modules_pacrunner__webkit.cpp (working copy) >@@ -1,10 +1,39 @@ > --- libproxy/modules/pacrunner_webkit.cpp.orig 2010-09-01 20:23:34.000000000 +0000 >-+++ libproxy/modules/pacrunner_webkit.cpp >-@@ -20,6 +20,7 @@ >++++ libproxy/modules/pacrunner_webkit.cpp 2014-10-23 13:56:06.000000000 -0700 >+@@ -20,6 +20,9 @@ > #include "../extension_pacrunner.hpp" > using namespace libproxy; > >++#include <stdlib.h> > +#include <unistd.h> >++#include <iostream> > #ifdef __APPLE__ > // JavaScriptCore.h requires CoreFoundation > // This is only found on Mac OS X >+@@ -126,8 +129,25 @@ public: >+ JSStringRelease(str); >+ >+ // Add the PAC into the context >++ JSValueRef result; >+ str = JSStringCreateWithUTF8CString(pac.c_str()); >+- if (!JSCheckScriptSyntax(this->jsctx, str, NULL, 0, NULL)) goto error; >++ if (!JSCheckScriptSyntax(this->jsctx, str, NULL, 0, &result)) { >++ if (getenv("_PX_DEBUG")){ >++ JSStringRef valueAsString = JSValueToStringCopy(this->jsctx, result, NULL); >++ size_t errlen = JSStringGetMaximumUTF8CStringSize(valueAsString); >++ char *errmsg = (char*)calloc(1, errlen); >++ if (errmsg) { >++ JSStringGetUTF8CString(valueAsString, errmsg, errlen); >++ cerr << "PAC " << errmsg << "\n"; >++ free(errmsg); >++ } else { >++ cerr << "PAC SyntaxError.\n"; >++ } >++ JSStringRelease(valueAsString); >++ cerr << pac.c_str() << "\n"; >++ } >++ goto error; >++ } >+ JSEvaluateScript(this->jsctx, str, NULL, NULL, 1, NULL); >+ JSStringRelease(str); >+ return; >Index: net/libproxy/files/patch-libproxy_url.cpp >=================================================================== >--- net/libproxy/files/patch-libproxy_url.cpp (revision 371530) >+++ net/libproxy/files/patch-libproxy_url.cpp (working copy) >@@ -1,5 +1,5 @@ >---- libproxy/url.cpp~ >-+++ libproxy/url.cpp >+--- libproxy/url.cpp.orig 2010-09-01 13:23:34.000000000 -0700 >++++ libproxy/url.cpp 2014-10-26 23:11:56.000000000 -0700 > @@ -27,6 +27,7 @@ > #define close _close > #endif >@@ -8,3 +8,33 @@ > #include <cstring> // For memcpy() > #include <sstream> // For int/string conversion (using stringstream) > #include <cstdio> // For sscanf() >+@@ -41,8 +42,12 @@ >+ #define read _read >+ #define SHUT_RDWR SD_BOTH >+ #else >++#ifdef __FreeBSD__ >++#define pfsize(st) (st.st_size) >++#else >+ #define pfsize(st) (st.st_blksize * st.st_blocks) >+ #endif >++#endif >+ >+ #include "url.hpp" >+ using namespace libproxy; >+@@ -402,6 +407,7 @@ char* url::get_pac() { >+ return NULL; >+ if (!fstat(sock, &st) && pfsize(st) < PAC_MAX_SIZE) { >+ buffer = new char[pfsize(st)+1]; >++ buffer[pfsize(st)] = '\0'; >+ if (read(sock, buffer, pfsize(st)) == 0) { >+ delete buffer; >+ buffer = NULL; >+@@ -437,7 +443,7 @@ char* url::get_pac() { >+ // Build the request string >+ request = "GET " + m_path + " HTTP/1.1\r\n"; >+ request += "Host: " + m_host + "\r\n"; >+- request += "Accept: " + string(PAC_MIME_TYPE) + "\r\n"; >++ request += "Accept: " + string(PAC_MIME_TYPE) + string(", ") + string(PAC_MIME_TYPE_FB) + "\r\n"; >+ request += "Connection: close\r\n"; >+ request += "\r\n"; >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 194623
: 148691