Cooperation/Connection.py

changeset 165
3302a726fd1e
parent 164
b395b006d2a8
child 323
75182cd9b2c5
child 792
a13346916170
equal deleted inserted replaced
164:b395b006d2a8 165:3302a726fd1e
170 self.__currentDataType = Connection.Undefined 170 self.__currentDataType = Connection.Undefined
171 self.__numBytesForCurrentDataType = 0 171 self.__numBytesForCurrentDataType = 0
172 self.__buffer.clear() 172 self.__buffer.clear()
173 173
174 if not self.isValid(): 174 if not self.isValid():
175 self.abort()
176 return
177
178 bannedName = "{0}@{1}".format(
179 user,
180 self.peerAddress().toString()
181 )
182 Preferences.syncPreferences()
183 if bannedName in Preferences.getCooperation("BannedUsers"):
184 self.rejected.emit(
185 self.trUtf8("* Connection attempted by banned user '{0}'.")\
186 .format(bannedName))
175 self.abort() 187 self.abort()
176 return 188 return
177 189
178 if self.__serverPort != self.peerPort() and \ 190 if self.__serverPort != self.peerPort() and \
179 not Preferences.getCooperation("AutoAcceptConnections"): 191 not Preferences.getCooperation("AutoAcceptConnections"):

eric ide

mercurial