Skip to content

Commit 2b0c68a

Browse files
committed
Resolve #173
Actually there is some bug in an upstream, that breaks all chunked GET requests. I've switched to POST method in all requests, even if it is actually a get. But there was still a funny bug, due to which all requests were GET. Also, fixed an issue with checking connection to bap server.
1 parent 5f6be1f commit 2b0c68a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

bap.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def __init__(self, server={}):
247247
for attempt in range(RETRIES):
248248
try:
249249
self.capabilities = self.call({'init' : {
250-
'version' : '0.1'}})
250+
'version' : '0.1'}}).next()['capabilities']
251251
except Exception:
252252
if attempt + 1 == RETRIES:
253253
raise
@@ -256,7 +256,6 @@ def __init__(self, server={}):
256256

257257
if not "capabilities" in self.__dict__:
258258
raise RuntimeError("Failed to connect to BAP server")
259-
260259
self.data = {}
261260
self.temp = NamedTemporaryFile('rw+b', prefix="bap-")
262261

@@ -306,8 +305,6 @@ def dumps(self,dic):
306305
def call(self, data):
307306
if isinstance(data, dict):
308307
method = request.post
309-
if 'get_insns' or 'get_resource' in data:
310-
method = request.get
311308
return jsons(method(self.url, data=self.dumps(data)))
312309
else:
313310
gen = (self.dumps(msg) for msg in data)

0 commit comments

Comments
 (0)