For the moment we "solved" the issue modifyng the file binding.py.
Inside function handler we modified the function reqeust from
def request(url, message, **kwargs):
scheme, host, port, path = _spliturl(url)
body = message.get("body", "")
head = {
"Content-Length": str(len(body)),
"Host": host,
"User-Agent": "splunk-sdk-python/0.1",
"Accept": "*/*",
} # defaults
for key, value in message["headers"]:
head[key] = value
method = message.get("method", "GET")
connection = connect(scheme, host, port)
try:
connection.request(method, path, body, head)
if timeout is not None:
connection.sock.settimeout(timeout)
response = connection.getresponse()
finally:
connection.close()
return {
"status": response.status,
"reason": response.reason,
"headers": response.getheaders(),
"body": ResponseReader(response),
}
to
def request(url, message, **kwargs):
scheme, host, port, path = _spliturl(url)
body = message.get("body", "")
head = {
"Content-Length": str(len(body)),
"Host": host,
"User-Agent": "splunk-sdk-python/0.1",
"Accept": "*/*",
} # defaults
for key, value in message["headers"]:
head[key] = value
method = message.get("method", "GET")
connection = connect(scheme, host, port)
try:
connection.request(method, path, body, head)
if timeout is not None:
connection.sock.settimeout(timeout)
response = connection.getresponse()
finally:
# connection.close()
pass
return {
"status": response.status,
"reason": response.reason,
"headers": response.getheaders(),
"body": ResponseReader(response),
}
Basically we removed the connection.close()
... View more