Skip to content
Browse files

trace start recieve service info in forever loop (untill stop)

  • Loading branch information...
1 parent f022e1e commit e4d2b33a41ffa33ec10417da0344f5d4b392afe3 @nakagami committed
Showing with 7 additions and 5 deletions.
  1. +7 −5 firebirdsql/fbcore.py
View
12 firebirdsql/fbcore.py
@@ -1292,11 +1292,13 @@ def trace_start(self, name=None, cfg=None, file=None):
self._op_service_start(spb)
(h, oid, buf) = self._op_response()
self.svc_handle = h
-
- self._op_service_info(bs([0x02]), bs([0x3e]))
- (h, oid, buf) = self._op_response()
- ln = bytes_to_int(buf[1:2])
- (file if file else sys.stdout).write(self.bytes_to_str(buf[3:3+ln]))
+ while True:
+ self._op_service_info(bs([0x02]), bs([0x3e]))
+ (h, oid, buf) = self._op_response()
+ if buf[:4] == bs([0x3e,0x00,0x00,0x01]):
+ break
+ ln = bytes_to_int(buf[1:2])
+ (file if file else sys.stdout).write(self.bytes_to_str(buf[3:3+ln]))
def trace_stop(self, id, file=None):
id = int(id)

0 comments on commit e4d2b33

Please sign in to comment.
Something went wrong with that request. Please try again.