GithubHelp home page GithubHelp logo

fim / icapclient3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vrasneur/icapclient

4.0 4.0 3.0 46 KB

A Python3 module for creating ICAP clients

License: GNU General Public License v3.0

C 94.27% Makefile 0.28% Python 5.46%

icapclient3's People

Contributors

antonyc avatar fim avatar tomers avatar vrasneur avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

icapclient3's Issues

Please add LICENSE to tarball

Please add the LICENSE file to the tarball when making releases.

The tarball downloaded from pypi does not carry it.

Thanks.

Module won't compile

Trying to compile icapclient3 on Debian 9 (64bit) fails:

# python3 setup.py build
running build
running build_ext
building 'icapclient' extension
creating build
creating build/temp.linux-x86_64-3.5
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c icapclient.c -o build/temp.linux-x86_64-3.5/icapclient.o -std=gnu99 -Wextra -D_REENTRANT -g -O2 -fdebug-prefix-map=/build/c-icap-0.4.4=. -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include -I/usr/include/c_icap
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c ICAPConnection.c -o build/temp.linux-x86_64-3.5/ICAPConnection.o -std=gnu99 -Wextra -D_REENTRANT -g -O2 -fdebug-prefix-map=/build/c-icap-0.4.4=. -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include -I/usr/include/c_icap
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c ICAPResponse.c -o build/temp.linux-x86_64-3.5/ICAPResponse.o -std=gnu99 -Wextra -D_REENTRANT -g -O2 -fdebug-prefix-map=/build/c-icap-0.4.4=. -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include -I/usr/include/c_icap
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -c cicap_compat.c -o build/temp.linux-x86_64-3.5/cicap_compat.o -std=gnu99 -Wextra -D_REENTRANT -g -O2 -fdebug-prefix-map=/build/c-icap-0.4.4=. -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include -I/usr/include/c_icap
creating build/lib.linux-x86_64-3.5
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fdebug-prefix-map=/build/python3.5-MLq5fN/python3.5-3.5.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.5/icapclient.o build/temp.linux-x86_64-3.5/ICAPConnection.o build/temp.linux-x86_64-3.5/ICAPResponse.o build/temp.linux-x86_64-3.5/cicap_compat.o -o build/lib.linux-x86_64-3.5/icapclient.cpython-35m-x86_64-linux-gnu.so -L/usr/lib/x86_64-linux-gnu/ -licapapi
/usr/bin/ld: build/temp.linux-x86_64-3.5/icapclient.o: relocation R_X86_64_PC32 against undefined symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

However, all package requirements seem to be satisfied:

# dpkg -l | grep icap
ii  libicapapi-dev                1:0.4.4-1                      amd64        ICAP API library development files
ii  libicapapi4                   1:0.4.4-1                      amd64        ICAP API library

# dpkg -l | grep python3-dev
ii  libpython3-dev:amd64          3.5.3-1                        amd64        header files and a static library for Python (default)
ii  python3-dev                   3.5.3-1                        amd64        header files and a static library for Python (default)

Output of uname -a:

Linux machine 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64 GNU/Linux

Could you point me in the right direction? Thanks in advance.

Error on installing this module on Ubuntu

Hello there,

I want to install this package, after installing libicapapi dependencies on my system, I still cannot install it.

I got this error message when I tried to install it via pip install icapclient3:

  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6bp7xdah/icapclient3/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6bp7xdah/icapclient3/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-d6pnun5q
       cwd: /tmp/pip-install-6bp7xdah/icapclient3/
  Complete output (16 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'icapclient' extension
  creating build
  creating build/temp.linux-x86_64-3.8
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c icapclient.c -o build/temp.linux-x86_64-3.8/icapclient.o -std=gnu99 -Wextra -D_REENTRANT -g -O2 -fdebug-prefix-map=/build/c-icap-PpBRfz/c-icap-0.5.6=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include -I/usr/include/c_icap
  In file included from /usr/include/c_icap/request.h:31,
                   from cicap_compat.h:23,
                   from ICAPConnection.h:22,
                   from icapclient.c:21:
  /usr/include/c_icap/net_io.h:37:10: fatal error: openssl/bio.h: No such file or directory
     37 | #include <openssl/bio.h>
        |          ^~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for icapclient3
  Running setup.py clean for icapclient3
Failed to build icapclient3
Installing collected packages: icapclient3
    Running setup.py install for icapclient3 ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6bp7xdah/icapclient3/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6bp7xdah/icapclient3/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-w5fwlki3/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/bahram/.local/include/python3.8/icapclient3
         cwd: /tmp/pip-install-6bp7xdah/icapclient3/
    Complete output (16 lines):
    running install
    running build
    running build_ext
    building 'icapclient' extension
    creating build
    creating build/temp.linux-x86_64-3.8
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c icapclient.c -o build/temp.linux-x86_64-3.8/icapclient.o -std=gnu99 -Wextra -D_REENTRANT -g -O2 -fdebug-prefix-map=/build/c-icap-PpBRfz/c-icap-0.5.6=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include -I/usr/include/c_icap
    In file included from /usr/include/c_icap/request.h:31,
                     from cicap_compat.h:23,
                     from ICAPConnection.h:22,
                     from icapclient.c:21:
    /usr/include/c_icap/net_io.h:37:10: fatal error: openssl/bio.h: No such file or directory
       37 | #include <openssl/bio.h>
          |          ^~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6bp7xdah/icapclient3/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6bp7xdah/icapclient3/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-w5fwlki3/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/bahram/.local/include/python3.8/icapclient3 Check the logs for full command output.

I tried to build it via python3 setup.py build:

running build
running build_ext
building 'icapclient' extension
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c icapclient.c -o build/temp.linux-x86_64-3.8/icapclient.o -std=gnu99 -Wextra -D_REENTRANT -g -O2 -fdebug-prefix-map=/build/c-icap-PpBRfz/c-icap-0.5.6=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wall -D_FILE_OFFSET_BITS=64 -I/usr/include -I/usr/include/c_icap
In file included from /usr/include/c_icap/request.h:31,
                 from cicap_compat.h:23,
                 from ICAPConnection.h:22,
                 from icapclient.c:21:
/usr/include/c_icap/net_io.h:37:10: fatal error: openssl/bio.h: No such file or directory
   37 | #include <openssl/bio.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

Terminating chunk not sent?

Hi,

Maybe I am not using this correctly, but it seems the encoding of requests is not correct: the terminating chunk (size 0) is not sent.

The client code is the one from the example:

conn = icapclient.ICAPConnection('127.0.0.1')
conn.request('REQMOD', 'eicar.com.txt', service="avscan")
resp = conn.getresponse()

My server rejects the request (REQMOD), because it does not receive the 0\r\n that is expected.

Capturing the traffic confirms this (edited to show only the end of the request):

Transfer-Encoding: chunked

44
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*

(not the absence of '0\r\n').

If the server tries to read again, nothing is sent.

Am I missing something?

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.