@@ -140,38 +140,34 @@ def etaProgressUpdate(charTime, index):
140
140
141
141
142
142
def downloadThread ():
143
- while True :
144
- idxlock .acquire ()
145
-
146
- if index [0 ] >= length :
147
- idxlock .release ()
148
-
149
- return
143
+ try :
144
+ while True :
145
+ idxlock .acquire ()
150
146
151
- index [0 ] += 1
152
- curidx = index [0 ]
153
- idxlock .release ()
147
+ if index [0 ] >= length :
148
+ idxlock .release ()
154
149
155
- charStart = time .time ()
156
- val = getChar (curidx )
150
+ return
157
151
158
- if val == None :
159
- raise sqlmapValueException , "failed to get character at index %d (expected %d total)" % (curidx , length )
152
+ index [0 ] += 1
153
+ curidx = index [0 ]
154
+ idxlock .release ()
160
155
161
- value [curidx - 1 ] = val
156
+ charStart = time .time ()
157
+ val = getChar (curidx )
162
158
163
- if showEta :
164
- etaProgressUpdate (time .time () - charStart , index [0 ])
165
- elif conf .verbose in ( 1 , 2 ):
166
- s = "" .join ([c or "_" for c in value ])
167
- iolock .acquire ()
168
- dataToStdout ("\r [%s] [INFO] retrieved: %s" % (time .strftime ("%X" ), s ))
169
- iolock .release ()
159
+ if val == None :
160
+ raise sqlmapValueException , "failed to get character at index %d (expected %d total)" % (curidx , length )
170
161
162
+ value [curidx - 1 ] = val
171
163
172
- def downloadThreadProxy (numThread ):
173
- try :
174
- downloadThread ()
164
+ if showEta :
165
+ etaProgressUpdate (time .time () - charStart , index [0 ])
166
+ elif conf .verbose in ( 1 , 2 ):
167
+ s = "" .join ([c or "_" for c in value ])
168
+ iolock .acquire ()
169
+ dataToStdout ("\r [%s] [INFO] retrieved: %s" % (time .strftime ("%X" ), s ))
170
+ iolock .release ()
175
171
176
172
except (sqlmapConnectionException , sqlmapValueException ), errMsg :
177
173
conf .threadException = True
@@ -199,7 +195,7 @@ def downloadThreadProxy(numThread):
199
195
200
196
# Start the threads
201
197
for numThread in range (numThreads ):
202
- thread = threading .Thread (target = downloadThreadProxy ( numThread ) )
198
+ thread = threading .Thread (target = downloadThread )
203
199
thread .start ()
204
200
threads .append (thread )
205
201
0 commit comments