Skip to content

Commit 6cf1347

Browse files
committed
rename
1 parent f17c21c commit 6cf1347

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

sample/sample_varnishlog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def execute(self, vap):
2020
'cb' : self.vapLineCallBack,
2121
'vxidcb' : self.vapVxidCallBack,
2222
'groupcb' : self.vapGroupCallBack,
23-
'groupcount' : 0,
23+
'maxread' : 0,
2424
}
2525
while 1:
2626
ret = self.vap.Dispatch(**arg)

src/varnishapi.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,7 +1616,7 @@ def __Setup10(self):
16161616
return(1)
16171617

16181618

1619-
def __Dispatch10(self, groupcount):
1619+
def __Dispatch10(self, maxread):
16201620
while True:
16211621
if not self.vslq:
16221622
# Reconnect VSM
@@ -1638,9 +1638,9 @@ def __Dispatch10(self, groupcount):
16381638
i = self.lva.VSLQ_Dispatch(
16391639
self.vslq, VSLQ_dispatch_f(self._callBack), None)
16401640

1641-
if i == 1 and groupcount != 1:
1642-
if groupcount > 1:
1643-
groupcount-=1
1641+
if i == 1 and maxread != 1:
1642+
if maxread > 1:
1643+
maxread-=1
16441644
continue
16451645
elif i > -2:
16461646
return i
@@ -1658,7 +1658,7 @@ def __Dispatch10(self, groupcount):
16581658
self.error = "Log overrun"
16591659
return i
16601660

1661-
def __Dispatch20(self, groupcount):
1661+
def __Dispatch20(self, maxread):
16621662
while True:
16631663
if self.vsm:
16641664
stat = self.lva.VSM_Status(self.vsm)
@@ -1681,9 +1681,9 @@ def __Dispatch20(self, groupcount):
16811681
i = self.lva.VSLQ_Dispatch(
16821682
self.vslq, VSLQ_dispatch_f(self._callBack), None)
16831683

1684-
if i == 1 and groupcount != 1:
1685-
if groupcount > 1:
1686-
groupcount-=1
1684+
if i == 1 and maxread != 1:
1685+
if maxread > 1:
1686+
maxread-=1
16871687
continue
16881688
elif i > -2:
16891689
return i
@@ -1699,15 +1699,15 @@ def __Dispatch20(self, groupcount):
16991699
self.error = "Log overrun"
17001700
return i
17011701

1702-
def Dispatch(self, cb=None, priv=None, groupcount=1, vxidcb=None, groupcb=None):
1702+
def Dispatch(self, cb=None, priv=None, maxread=1, vxidcb=None, groupcb=None):
17031703
self._cb = cb
17041704
self._vxidcb = vxidcb
17051705
self._groupcb = groupcb
17061706
self._priv = priv
17071707
if self.lva.apiversion >= 2.0:
1708-
return self.__Dispatch20(groupcount)
1708+
return self.__Dispatch20(maxread)
17091709
else:
1710-
return self.__Dispatch10(groupcount)
1710+
return self.__Dispatch10(maxread)
17111711

17121712
def Fini(self):
17131713
if self.vslq:

0 commit comments

Comments
 (0)