Giter Site home page Giter Site logo

manugarg / pacparser Goto Github PK

View Code? Open in Web Editor NEW
490.0 490.0 116.0 4.54 MB

A library to parse proxy auto-config (PAC) files

Home Page: http://pacparser.manugarg.com

License: GNU Lesser General Public License v3.0

Python 0.32% C 90.78% Makefile 5.66% Shell 0.14% JavaScript 0.07% C++ 2.58% Perl 0.24% Assembly 0.16% sed 0.03% Dockerfile 0.02%

pacparser's Introduction

Hello 👋, I am a software engineer, particularly interested in systems and reliability. My linkedIn profile has work related info, so won't repeat that here.

pacparser's People

Contributors

a-detiste avatar cliftondhanee avatar da2x avatar dependabot[bot] avatar ehaupt avatar joycebrum avatar kitterma avatar kravietz avatar kujiy avatar logich avatar manugarg avatar mitchblank avatar mzpqnxow avatar orbea avatar slattarini avatar t13801206 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pacparser's Issues

New release version

The last "official" release of this library was over 2 years ago. For the purpose of sanity and version control can a new release (or even a tag) be created against this repo.

make fails on OSX 10.6

From [email protected] on May 23, 2011 17:46:46

What steps will reproduce the problem? Make fails on OSX 10.6

ahammond@lappy386:~/Downloads/pacparser-1.2.9/src $ make
cd spidermonkey && SMCFLAGS=" " make jsapi
mkdir -p js/src/Darwin_DBG.OBJ
CFLAGS=" " make -C js/src -f Makefile.ref libjs.a
cat: ../../dist/Darwin_DBG.OBJ/nspr/Version: No such file or directory
make[2]: Circular jscpucfg.h <- Darwin_DBG.OBJ/jsautocfg.h dependency dropped.
make[2]: Circular Darwin_DBG.OBJ/jsautocfg.h <- Darwin_DBG.OBJ/jsautocfg.h dependency dropped.
cc -o Darwin_DBG.OBJ/jsprf.o -c   -Wall -Wno-format -g -DXP_UNIX -DSVR4 -DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DDARWIN -DX86_LINUX  -DDEBUG -DDEBUG_ahammond -DEDITLINE -IDarwin_DBG.OBJ  jsprf.c
jsprf.c: In function ‘BuildArgArray’:
jsprf.c:644: error: incompatible types in assignment
make[2]: *** [Darwin_DBG.OBJ/jsprf.o] Error 1
make[1]: *** [js-buildstamp] Error 2
make: *** [jsapi_buildstamp] Error 2 What is the expected output? What do you see instead? ... binary should get built. What version of the product are you using? On what operating system? 1.2.9 on OSX 10.6.7

Original issue: http://code.google.com/p/pacparser/issues/detail?id=11

array of ip addresses not used

Is there a way to determine if the system is using an array of IP addresses for the host that myIpAddressEx() provides. It doesn't give the same functionality of the browser because of that. I had to add my system's list of ip returned by myIpAddressEx in setmyip() to get the same behavior. Otherwise it seems like it just returns the first IP?

resolve_host in pacparser.c returns garbled IP address list

From manugarg on December 07, 2010 09:06:31

What steps will reproduce the problem? A proxy.pac with following content:
function FindProxyForURL(url, host) { return myIpAddress(); }

manugarg@minesofmoria:/code/manugarg-pacparser-dev/tests$ pactester -p proxy.pac -u http://www.google.com (,�@��;127.0.0.1
manugarg@minesofmoria:
/code/manugarg-pacparser-dev/tests$ pactester -v
1.2.6-1

What is the expected output?
127.0.0.1

resolve_host function in pacparser.c doesn't behave properly. I could verify that by using that function in another test C program. It returns garbage characters in ip address list.

Original issue: http://code.google.com/p/pacparser/issues/detail?id=7

Wrong exit status if pactester fails while executing FindProxyForURL.

From manugarg on July 03, 2011 05:49:25

pactester exits with a wrong status message when there is problem in finding proxy.

Opening it on behalf of sgo77:
( http://groups.google.com/group/pactester/msg/7cad25a51515fcd5 )

Example (file bad.pac) :
if (
         shExpMatch(host, "hhhh.xxxx.fr") ||
         shExpMatcs(host, "zzzz.aaaa.fr") ||
         shExpMatch(host, "clientaccess.blabla.com")
       )
    {
      return "proxy1:8080";
    }
]# ./pactester -p ./bad.pac -u http://www.google.fr ; echo "*** $?
***"
JSERROR: PAC script:532:
    ReferenceError: shExpMatcs is not defined
undefined
*** 0 ***

Original issue: http://code.google.com/p/pacparser/issues/detail?id=12

lack of init function (PyInit_pacparser)

Hi,
I download the 1.3.5 release binary package, and install well on windows 7 with python 3.4. I added system search path to MinGW (that pacparser.dll required), when import pacparser, it report error:
ImportError: dynamic module does not define init function (PyInit_pacparser)

hope I can get a fix version soon.
thanks.

Suggestion: Remove README or README.md

Within the project there is both README and README.md I would suggest removing README.

Reasons:

  • Having a duplicated file makes no sense.
  • README is out of date with README.md
  • README.md is not difficult to read even if reading the source file.

Add support for Microsoft PAC extensions for IPv6

From manugarg on June 29, 2010 12:32:01

hese extensions are used by Google Chrome as well. These extensions include - dnsResolveEx, myIpAddressEx and isResolvableEx.

(There are a few more defined by Microsoft, but not implemented by Google Chrome. For detailed list look here - http://blogs.msdn.com/b/wndp/archive/2006/07/18/ipv6-wpad-for-winhttp-and-wininet.aspx )

pacparser and pactester should support these new extension - at least the ones supported by Google Chrome.

Original issue: http://code.google.com/p/pacparser/issues/detail?id=4

Long wait when hostname has a leading "."

From [email protected] on May 18, 2011 19:54:32

What steps will reproduce the problem? 1. pactester -p proxy.pac -u " http://.google.com/ " What is the expected output? What do you see instead? Correct output, but code takes about 10 seconds to return. What version of the product are you using? On what operating system? 1.2.9 Please provide any additional information below. Seems to be a problem parsing the URL, and is independent of the contents of the proxy.pac files itself.

Original issue: http://code.google.com/p/pacparser/issues/detail?id=10

PAC Files with myIpAddress() used seem to cause a reference error

From [email protected] on April 14, 2008 05:11:02

What steps will reproduce the problem? 1. Use included myip.dat as input for the pacparser test sample
2. The dat file as all lines commented out apart from the one with myIpAddress() What is the expected output? What do you see instead? Expected output - a valid proxy as returned by the file.

Returned output -

  JSERROR: c:\myip.dat:11:
    ReferenceError: myIpAddress is not defined What version of the product are you using? On what operating system? pacparser 1.0.3, Windows 2003 Server, Visual Studio 2003. Please provide any additional information below. I have tried almost all the different types of pac files that can be found on the internet. This
seems to be the only function that gives a problem.

I am not sure how prevelant usage of myIpAddress() is, but would be a nice addition to the
library.

Original issue: http://code.google.com/p/pacparser/issues/detail?id=1

Report

I can report that the python module works fine on default python installation on CentOS 6:

[root@xxx0014 plugins]# python -V
Python 2.6.6

Marcel

memory leak in pacparser_find_proxy()

From [email protected] on February 26, 2013 11:02:03

In pacparser-1.3.0, the function pacparser_find_proxy() in pacparser.c does a malloc of a "script" string and never frees it.  JS_EvaluateScript() must not free its parameter because just above that point it is called with a string constant instead of a malloced string.

Based on the fact that pacparser_just_find_proxy() does (in effect) a strdup() of the return value of pacparser_find_proxy(), I am assuming that the return value of the latter is freed by pacparser_cleanup().  It would be good to document the fact that the caller of pacparser_just_find_proxy() is responsible for freeing its returned string.

Original issue: http://code.google.com/p/pacparser/issues/detail?id=22

Always perform syntax checking

From [email protected] on December 29, 2011 08:17:31

If you have a syntax error, pactester doesn't always report it.

Our "WPAD.DAT" file consists mostly of lines like this:
if (
        dnsDomainIs(host, "nfe.fazenda.sp.gov.br") ||
        dnsDomainIS(host, "produtos.sondaprocwork.com.br") ||
        dnsDomainIs(host, ".proxibid.com")
        )
return Direct_Access;

Notice the capital "S" in the 2nd condition?  That will break the file in IE on Windows and EVERYTHING will go directly out instead of through our proxy.

When I run pactester against this, if I don't test for that specific host name, pactester will not generate an error, so I think that my file is working great, but proxying is actually broken.

pactester.exe -p wpad.dat -f url_list.txt http://nfe.fazenda.sp.gov.br : DIRECT
JSERROR: PAC script:43:
    ReferenceError: dnsDomainIS is not defined
pacparser.c: pacparser_find_proxy: Problem in executing FindProxyForURL.

pactester.c: Problem in finding proxy for http://produtos.sondaprocwork.com.br .

I've just downloaded the latest version from the pacparser page (v1.3.0) and I'm running it on Windows 7 Enterprise 64-bit.

The older version from the pactester page worked as expected, but I really like that the new version prints the URL in addition to the result.

This is a GREAT utility as folks don't always pay attention to detail and there's really no other way that I've found to accurately test this is IE.

Original issue: http://code.google.com/p/pacparser/issues/detail?id=18

pactester 1.2.6 isResolvable returns always false and dnsResolve returns always null

From [email protected] on November 18, 2010 06:52:41

What steps will reproduce the problem? 1. if (!isResolvable(host)) { return proxy_internet; }
2. var dnsResolve_host = dnsResolve(host); 3. What is the expected output? What do you see instead? What version of the product are you using? On what operating system? pactester from pacparser-1.2.6-win32
xp prof sp2 32 bit IE6
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing) Please provide any additional information below. With pactester from pactester-pacparser-1.0.4-1-win32 it was ok.

Original issue: http://code.google.com/p/pacparser/issues/detail?id=5

Parallel build fails on OSX

From [email protected] on May 28, 2013 14:25:48

What steps will reproduce the problem? 'make -j 4' on a dual-core MacBook Pro What is the expected output? What do you see instead? Expect:
    All tests were successful.
  Instead see:
    cc -dynamiclib -framework System -install_name /usr/lib/libpacparser.1.dylib -o libpacparser.1.dylib pacparser.o libjs.a -lm
    ld: malformed archive TOC entry for _printVal, offset 2032640 is beyond end of file 1318912 for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation) What version of the product are you using? On what operating system? pacparser version 1.3.1
  Mac OSX version 10.6.8 Please provide any additional information below. Different errors show up with different levels of parallelism

Original issue: http://code.google.com/p/pacparser/issues/detail?id=27

pacparser should be able to parse pac string directly instead of requiring an input file.

From [email protected] on March 12, 2011 12:17:58

pacparser (and pactester) should be able to parse a PAC string directly, instead of requiring an input file. This is much desired as in some cases an application might have already obtained PAC string from other sources than PAC file (e.g. curl, network stream, system libraries).

Opening this issue on behalf of Ludek Finstrle. ( https://groups.google.com/group/pacparser/browse_thread/thread/b9ffabbf6dc6e6fa )

Original issue: http://code.google.com/p/pacparser/issues/detail?id=9

Raw IPv6 addresses parsed incorrectly

From [email protected] on September 12, 2011 14:15:31

Example (with vanilla pactester 1.2.9):

DEBUG=1 ./pactester -e -p proxy.pac -u http://[2001:67c:168:170::10]/

...
DEBUG: Finding proxy for URL: http://[2001:67c:168:170::10]/ and Host: [2001

Host ist parsed as '[2001'

With the patch:

DEBUG=1 ./pactester -e -p proxy.pac -u http://[2001:67c:168:170::10]/

...
DEBUG: Finding proxy for URL: http://[2001:67c:168:170::10]/ and Host: [2001:67c:168:170::10]

Actually, I don't know if the brackets have to be stripped before
being evaluated in FindProxyForURL.

Original issue: http://code.google.com/p/pacparser/issues/detail?id=15

Wrong argument in freeaddrinfo tries to free nullpointer

From [email protected] on December 07, 2010 02:24:52

Using runtest on Solaris with Sun Studio 12 yields in a coredump with the following stacktrace:

core 'core' of 5830:    /home/dam/mgar/pkg/pacparser/trunk/work/solaris9-sparc/build-isa-sparc
 ff1e4880 freeaddrinfo (0, ff1680a8, ffbfec26, ffbfea5e, 0, 0) + 4
 ff026e9c resolve_host (ffbfeb20, ffbfec26, 1, 4d948, 1, ffbfed58) + 19c
 ff027204 ???????? (24fa8, 276c0, 0, 4d950, ffbfed58, 4f8a3)
 ff0a16f4 js_Invoke (24fa8, 0, 0, ffbff0b4, ffbff038, 4f8a3) + 116c
 ff0b5d2c js_Interpret (24fa8, 4c298, ffbff170, 24ff0, 0, 0) + 11ffc
 ff0a2544 js_Execute (24fa8, 276c0, 4c268, 0, 0, ffbff378) + 474
 ff0468b0 JS_EvaluateUCScriptForPrincipals (24fa8, 276c0, 0, 4c1e8, 3a, 0) + d0
 ff0467ac JS_EvaluateUCScript (24fa8, 276c0, 4c1e8, 3a, 0, 1) + 5c
 ff046608 JS_EvaluateScript (24fa8, 276c0, 3d5d8, 3a, 0, 1) + 98
 ff028184 pacparser_find_proxy (ffbffa4b, 4d64f, 11a3c, 4d64f, 4d64f, 4d65d) + 454
 00011564 main     (5, ffbff85c, ffbff874, 0, 7d8, ffbff964) + 384
 00010b60 _start   (0, ffbff85c, 1, ff3dc608, ff3ee834, ff3ee000) + 108

The problem is that freeaddrinfo is called on "ai" which may be null. This fixes the issue:

--- a/src/pacparser.c
+++ b/src/pacparser.c
@``@ -112,7 +112,7 @``@ resolve_host(const char *hostname, char *ipaddr_list, int max_results)
     if (ipaddr_list[0] == '\0') sprintf(ipaddr_list, "%s", ipaddr);
     else sprintf(ipaddr_list, "%s;%s", ipaddr_list, ipaddr);
   }
-  freeaddrinfo(ai);
+  freeaddrinfo(result);
   return 0;
 }

Original issue: http://code.google.com/p/pacparser/issues/detail?id=6

64-bit version of the Python DLL

From [email protected] on March 08, 2012 01:50:16

What steps will reproduce the problem? import pacparser What is the expected output? What do you see instead? expected
nothing, import succeeded
instead
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pacparser_init_.py", line 31, in <module>
    from pacparser import _pacparser
ImportError: DLL load failed: %1 is not a valid Win32 application. What version of the product are you using? On what operating system? pacparser 1.3.0 python module
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32 Please provide any additional information below.

Original issue: http://code.google.com/p/pacparser/issues/detail?id=19

Specify DNS Server(s) to use.

It would be a nice feature to be able to set the DNS Server I want to use for testing.

My PAC file acts differently when using Company DNS Servers versus outside DNS servers.

Currently, my PAC file test script changes the server DNS temporarily to run the test against Google DNS. I would like better support for this from this tool, please.

Feature request: error message reporting to a function

From [email protected] on March 04, 2013 14:42:01

It's rather nasty for libraries to send error messages to stderr because different applications do different things with error messages, for example many applications send them to syslog.  The underlying JavaScript library handles that with JS_SetErrorReporter to supply a callback function.  An alternate method some libraries use is to have an error reporting function (for example dlerror()) that the caller can use to request error messages after some other API function returns an error.  Either one works.

As it stands now, it looks like I'm going to have to patch pacparser.[ch] to add this or turn stderr into a pipe and catch messages that way.  The latter is too disgusting so I'll probably do the former.

Original issue: http://code.google.com/p/pacparser/issues/detail?id=23

Hope for full support for Microsoft PAC Extension

From [email protected] on April 23, 2013 08:14:47

Thanks for your work. I've used it to test my script for a long time. But recently, I switch to Chrome which support ipv6 extension for pac.
I see it support a function of enable_microsoft_extensions(). It surely support dnsResolveEx() function. But it lacks support for sortIpAddressList().

I'm using python_pacparser1.3.0 in ubuntu with python2.7.

Here is their definitions: http://msdn.microsoft.com/en-us/library/windows/desktop/gg308477&#37;28v=vs.85&#37;29.aspx Here is Chrome's support code: https://code.google.com/p/chromium/codesearch#chromium/src/net/proxy/proxy_resolver_v8.cc&q=sortIpA&sq=package:chromium&l=37 My test script and pac script are listed below:

Original issue: http://code.google.com/p/pacparser/issues/detail?id=26

Remove print statements from code base and use Exceptions

There are a number of occurrences within the code base where print is being used to send back / alert the user that some action has failed. In these cases Exceptions should be being used as they are a lot more useful to the developer using the library.

I shall write a patch which will improve this.

Change install location for 64 bit linux

Original issue by ignacio.hernandez at:
https://code.google.com/p/pacparser/issues/detail?id=35

Added some checks in the Makefile to allow the installation to /usr/lib64 for 64 bit Linux.

--- a/src/Makefile
+++ b/src/Makefile
@@ -25,6 +25,7 @@
VERSION ?= $(shell git describe --always --tags --candidate=100)

PREFIX ?= /usr
+MACHINE := $(shell uname -m)
OS_ARCH := $(subst /,,$(shell uname -s | sed /\ /s///))

LIBRARY_NAME = libpacparser
@@ -67,7 +68,11 @@

LIBRARY_LINK = $(LIBRARY_NAME).$(SO_SUFFIX)
PREFIX := $(DESTDIR)$(PREFIX)
-LIB_PREFIX = $(PREFIX)/lib
+ifeq ($(MACHINE), x86_64)
+LIB_PREFIX ?= $(PREFIX)/lib64
+else
+LIB_PREFIX ?= $(PREFIX)/lib
+endif
INC_PREFIX = $(PREFIX)/include
BIN_PREFIX = $(PREFIX)/bin
MAN_PREFIX = $(PREFIX)/share/man

myipaddress() returning IPv6 Address instead of IPv4 Address

From [email protected] on March 20, 2013 14:12:54

What steps will reproduce the problem? IPv6 enabled on windows 7 machine with pac file using myipaddress() function returns the machines IPv6 address instead of IPv4 IP address What is the expected output? What do you see instead? IPv4 IP address What version of the product are you using? On what operating system? Version 1.3.0-1 on Windows 7 Please provide any additional information below.

Original issue: http://code.google.com/p/pacparser/issues/detail?id=25

IOError is not raised when pac file is not found

An IOError is not raised when parse_pac_file is called with a file which cannot be opened for what ever reason. It should be that IOError can be handled in the end users application code. Patch to follow shortly

Fail on URL of file

From [email protected] on October 03, 2011 01:39:27

What steps will reproduce the problem? Try to open proxy.pac file from URL instead system path What is the expected output? What do you see instead? PAC file http://.../pac/proxy.pac doesn't exist What version of the product are you using? On what operating system? pacparser-python27-1.3.0, WindowsXP and Windows 7.

Original issue: http://code.google.com/p/pacparser/issues/detail?id=17

make fails on Centos 5.5

From [email protected] on August 06, 2011 12:17:48

Hi,
when i try to build pacparser-1.2.9 on a centos server, i've got the following error:

[root@localhost pacparser-1.2.9]# make -C src pymod
make: entrant dans le répertoire « /root/tmp/pacparser-1.2.9/src »
cd pymod && ARCHFLAGS="" python setup.py build
running build
running build_py
running build_ext
python ../tests/runtests.py
Traceback (most recent call last):
  File "../tests/runtests.py", line 80, in ?
    main()
  File "../tests/runtests.py", line 77, in main
    runtests(pacfile, testdata, tests_dir)
  File "../tests/runtests.py", line 46, in runtests
    import pacparser
  File "/root/tmp/pacparser-1.2.9/src/../tests/../src/pymod/build/lib.linux-x86_64-2.4/pacparser/init.py", line 57
    except IOError as e:
                    ^
SyntaxError: invalid syntax
make: *** [pymod] Erreur 1
make: quittant le répertoire « /root/tmp/pacparser-1.2.9/src »

So i have to modify this code in the /src/pymod/build/lib.linux-x86_64-2.4/pacparser/init.py file :

     54   try:
     55     f = open(pacfile)
     56     pac_script = f.read()
     57   except IOError as e:
     58     print('Could not read the pacfile: %s\n%s' % (pacfile, e))
     59     return
     60   f.close()
By:
     54
     55   f = open(pacfile)
     56   pac_script = f.read()
     57   f.close()

Regards

Original issue: http://code.google.com/p/pacparser/issues/detail?id=13

libtool: unrecognized option `-static'

From ckujau on December 21, 2013 01:01:26

What steps will reproduce the problem? $ make -C src
[...]
All tests were successful.
libtool -static -o libpacparser.a pacparser.o libjs.a
libtool: unrecognized option -static' libtool: Try libtool --help' for more information.
make: *** [libpacparser.a] Error 1 What is the expected output? What do you see instead? It should compile :-) What version of the product are you using? On what operating system? $ libtool --version | head -1
libtool (GNU libtool) 2.4.2

This is on Fedora 20 (Linux). Please provide any additional information below. I've seen reports on the net that on MacOS the Apple version of "libtool" should be used instead. However, in this case I don't have access to this version. The manpage states (and an old report[0] of this) states, that --mode must be provided, but this won't work either:

 $ libtool --mode=compile -static -o libpacparser.a pacparser.o libjs.a
 libtool: link: unrecognized option `-static'

[0] https://lists.gnu.org/archive/html/bug-libtool/2001-09/msg00015.html

Original issue: http://code.google.com/p/pacparser/issues/detail?id=30

Patch to compile on Python 3

From [email protected] on October 17, 2012 09:02:27

--- pacparser_py.c      2012-10-17 17:56:25.038235264 +0200
+++ pacparser_py.c.new  2012-10-17 17:51:57.648909350 +0200
@``@ -31,6 +31,22 @``@
 #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
 #endif

+#if PY_MAJOR_VERSION >= 3
+  #define MOD_ERROR_VAL NULL
+  #define MOD_SUCCESS_VAL(val) val
+  #define MOD_INIT(name) PyMODINIT_FUNC PyInit_##name(void)
+  #define MOD_DEF(ob, name, doc, methods)
+              static struct PyModuleDef moduledef = {
+                              PyModuleDef_HEAD_INIT, name, doc, -1, methods, };
+                  ob = PyModule_Create(&moduledef);
+#else
+  #define MOD_ERROR_VAL
+  #define MOD_SUCCESS_VAL(val)
+  #define MOD_INIT(name) void init##name(void)
+  #define MOD_DEF(ob, name, doc, methods)
+              ob = Py_InitModule3(name, methods, doc);
+#endif
+
 static PyObject *PacparserError;
 // Initialize PAC parser.
 //
@``@ -137,12 +153,14 @``@
   {NULL, NULL, 0, NULL}
 };

-PyMODINIT_FUNC
-init_pacparser(void)
+MOD_INIT(_pacparser)
 {
   PyObject *m;
-  m = Py_InitModule("_pacparser", PpMethods);
+  MOD_DEF(m, "_pacparser", NULL, PpMethods)
+  if(m == NULL)
+      return MOD_ERROR_VAL;
   PacparserError = PyErr_NewException("pacparser.error", NULL, NULL);
   Py_INCREF(PacparserError);
   PyModule_AddObject(m, "error", PacparserError);
+  return MOD_SUCCESS_VAL(m);
 }

Original issue: http://code.google.com/p/pacparser/issues/detail?id=21

Case-sensitive host-matching behaviour

From [email protected] on September 16, 2013 13:06:54

What steps will reproduce the problem? Supplying a URL with different case formats, e.g., www.mydomain.com vs. WWW.mydomain.com, pacparser treats the two as different resources. What is the expected output? What do you see instead? The expected result of an evaluation like this should be identical in both cases, since hostnames are case-insensitive. However, I am getting two distinct results for what should be the same host. Explicitly converting strings to all lowercase causes both queries to return the identical, expected result. What version of the product are you using? On what operating system? 1.3.1 on OSX 10.8 Please provide any additional information below. According to the FAQ here: http://findproxyforurl.com/misconceptions/ "In order to perform host matching the host variable must be converted to lowercase.
False. Implementing such code has been found unnecessary in all major browsers (Internet Explorer, Firefox, Chrome, and Safari).
No browser has been found to require that the host be converted to lowercase in order to prevent case sensitive matching issues. Unlike URLs, hosts are case insensitive therefore any PAC rule mechanism should automatically assume case insensitivity when matching hosts."

cheers,
Klaus

Original issue: http://code.google.com/p/pacparser/issues/detail?id=29

runtests.sh failing when building on non interconnected hosts

From [email protected] on August 28, 2011 13:56:02

When building pacparser on hosts not connected to the internet (e.g. internal systems or build service), runtests.sh, and thus building, fails beacuse of missing DNS resolution.

The attached patch makes running tests optional and permits building on not interconnected hosts. Tests may still be run by explicitly calling the relative target.

Original issue: http://code.google.com/p/pacparser/issues/detail?id=14

Retrieve the pac file used by IE

From [email protected] on February 01, 2010 15:10:55

This is all good. Thanks for your excellent work. But I really think it
would be a good thing if this library could be extended to optionally use
the proxy configuration file currently used by IE. As it is working now you
need to provide your own proxy.pac, but normally you just want to use the
current settings on the machine (BTW this is how the HTTP classes in .NET
works. If you want to open an URL you just specify it and the framework will
pick up the right proxy to use by parsing the proxy.pac).

Original issue: http://code.google.com/p/pacparser/issues/detail?id=3

tests/runtests.sh overwrite LD_LIBRARY_PATH

From [email protected] on February 13, 2014 05:47:06

hi,

compiling pacparser-1.3.1 with the intel compiler produces the following error:
echo "Running tests for pactester."
Running tests for pactester.
NO_INTERNET= ../tests/runtests.sh
pactester: error while loading shared libraries: libimf.so: cannot open shared object file: No such file or directory

when you use:

  • setup icc
  • make -C src

this is caused by this line: https://code.google.com/p/pacparser/source/browse/tests/runtests.sh#10 which needs to be changed to:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$library_path

otherwise the script overwrites LD_LIBRARY_PATH and libimf.so cannot be found.

could this be fixed?

thanks,
rocco

Original issue: http://code.google.com/p/pacparser/issues/detail?id=31

Fix install Instructions

The INSTALL file mentions

On Win-32 Systems:
#################

Binary Distribution:
===================

Compiled packages for win32 systems can be downloaded from:
http://code.google.com/p/pacparser/downloads/list

The Link is broken. Please update the current location for Win Binary Distribution

Provide python3 installation for windows

It would be good if you could provide a python3 build for windows. Is this something which is possible?

Turns out python3 is supported but there is a syntax error in the code. I will attach a merge request.

There is bug in weekdayRange() utility function. It doesn't handle 'SAT' properly

From manugarg on August 03, 2009 04:45:04

Originally reported here: https://code.google.com/p/pactester/issues/detail?id=5 The bug is specifically in pac_utils.h
( https://code.google.com/p/pacparser/source/browse/trunk/pac_utils.h ) which
contains utility functions used by pac files. function getDay(), defined
inside weekdayRange function, returns -1 for 'SAT', while it should return
6. This bug has also been entered into mozilla bugzilla
( https://bugzilla.mozilla.org/show_bug.cgi?id=398077 ).

Original issue: http://code.google.com/p/pacparser/issues/detail?id=2

FindProxyForURLEx does not work in 1.3.5

The release announcement for 1.3.5 says FindProxyForURLEx is supported, but it does not work if you define that instead of FindProxyForURL. It returns an error
pacparser.c: pacparser_find_proxy: Javascript function FindProxyForURL not defined.
I see FindProxyForURLEx getting called from a function findProxyForURL in pac_utils.h, but findProxyForURL is not referenced anywhere, and pacparser_find_proxy still requires FindProxyForURL. If I change all occurrences of FindProxyForURL to findProxyForURL in pacparser.c, it works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.