Changeset 109 in code for trunk


Ignore:
Timestamp:
Mar 16, 2020, 2:08:56 PM (5 years ago)
Author:
contact
Message:

Protect upstreamConn.history with a lock

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r108 r109  
    556556                var seqPtr *uint64
    557557                if firstDownstream {
     558                        uc.lock.Lock()
    558559                        seq, ok := uc.history[historyName]
     560                        uc.lock.Unlock()
    559561                        if ok {
    560562                                seqPtr = &seq
     
    584586
    585587                        if lastDownstream {
     588                                uc.lock.Lock()
    586589                                uc.history[historyName] = seq
     590                                uc.lock.Unlock()
    587591                        }
    588592                }()
  • trunk/upstream.go

    r103 r109  
    99        "strconv"
    1010        "strings"
     11        "sync"
    1112        "time"
    1213
     
    4950        modes      modeSet
    5051        channels   map[string]*upstreamChannel
    51         history    map[string]uint64
    5252        caps       map[string]string
    5353
    5454        saslClient  sasl.Client
    5555        saslStarted bool
     56
     57        lock    sync.Mutex
     58        history map[string]uint64 // TODO: move to network
    5659}
    5760
Note: See TracChangeset for help on using the changeset viewer.