fim / icapclient3 Goto Github PK
View Code? Open in Web Editor NEWThis project forked from vrasneur/icapclient
A Python3 module for creating ICAP clients
License: GNU General Public License v3.0
This project forked from vrasneur/icapclient
A Python3 module for creating ICAP clients
License: GNU General Public License v3.0
Please add the LICENSE file to the tarball when making releases.
The tarball downloaded from pypi does not carry it.
Thanks.
Anything using the library segfaults when compiling against the latest c-icap from git (soon to be 0.5.11 or 0.6.0).
Thanks.
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.
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
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?
To get detailled information about a remote ICAP server, I need to send an OPTIONS request to it (as desrcibed in RFC 3507 4.10 and RFC 3507 4.3.2. This does not seem to be implemented in icapclient3
, yet.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.