Changeset 1130561


Ignore:
Timestamp:
2010-12-28T13:04:34Z (14 years ago)
Author:
Philippe Crama <pcfeb0009@…>
Branches:
master
Children:
f85837a
Parents:
d45adcf
Message:

Check that connection is still valid before sending/retrying

Since another thread might close the socket, make sure after the
lock is acquired that the connection is still valid.

Add global declaration for completeness

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skype/skyped.py

    rd45adcf r1130561  
    102102
    103103def send(sock, txt):
     104        global options
    104105        count = 1
    105106        done = False
    106         while (not done) and (count < 10):
     107        while (not done) and (count < 10) and options.conn:
    107108                if wait_for_lock(options.lock, 3, 10, "socket send"):
    108109                        try:
    109                                 sock.send(txt)
     110                                if options.conn: sock.send(txt)
    110111                                options.lock.release()
    111112                                done = True
Note: See TracChangeset for help on using the changeset viewer.