Skip to content

Commit e6a49c4

Browse files
committed
Fixed some formatting
1 parent 3e31019 commit e6a49c4

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

core/client.go

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const CLIENT_DEBUG = false
1515

1616
// Buffer up to this many messages going out
1717
const OUTGOING_BUFFER = 100
18+
1819
// Buffer up to this many messages coming in
1920
const INCOMING_BUFFER = 100
2021

@@ -29,7 +30,7 @@ type client struct {
2930
request *http.Request
3031
permissions auth.Permissions
3132
connected bool
32-
closing bool
33+
closing bool
3334
subscriptions []string
3435
write permissionCache
3536
outgoing chan []byte
@@ -51,23 +52,33 @@ func (c *client) Close() {
5152
connectedClients--
5253

5354
// Close the incoming channel, throw away any extra messages that might be coming our way
54-
if CLIENT_DEBUG { log.Printf("Closing incoming queue for %s", c.GetRemoteAddr()) }
55+
if CLIENT_DEBUG {
56+
log.Printf("Closing incoming queue for %s", c.GetRemoteAddr())
57+
}
5558
close(c.incoming)
5659

5760
// Wait for the outgoing channel to empty
58-
if CLIENT_DEBUG { log.Printf("Waiting for %s outgoing queue", c.GetRemoteAddr()) }
61+
if CLIENT_DEBUG {
62+
log.Printf("Waiting for %s outgoing queue", c.GetRemoteAddr())
63+
}
5964
c.outgoingWG.Wait()
6065

61-
if CLIENT_DEBUG { log.Printf("Closing outgoing queue for %s", c.GetRemoteAddr()) }
66+
if CLIENT_DEBUG {
67+
log.Printf("Closing outgoing queue for %s", c.GetRemoteAddr())
68+
}
6269
close(c.outgoing)
6370

64-
if CLIENT_DEBUG { log.Printf("Unsubscribing %s", c.GetRemoteAddr()) }
71+
if CLIENT_DEBUG {
72+
log.Printf("Unsubscribing %s", c.GetRemoteAddr())
73+
}
6574

6675
for _, channel := range c.subscriptions {
6776
unsubscribe(channel, c)
6877
}
6978

70-
if CLIENT_DEBUG { log.Printf("Closing %s", c.GetRemoteAddr()) }
79+
if CLIENT_DEBUG {
80+
log.Printf("Closing %s", c.GetRemoteAddr())
81+
}
7182

7283
c.connection.Close()
7384
}
@@ -309,9 +320,9 @@ func (c *client) Handle() {
309320
} else {
310321
select {
311322
case c.incoming <- message:
312-
// Message was sent to incoming queue
323+
// Message was sent to incoming queue
313324
default:
314-
// Incoming queue was full
325+
// Incoming queue was full
315326
log.Printf("Client from %s filled incoming message queue, disconnecting.", c.GetRemoteAddr())
316327
c.Close()
317328
return

0 commit comments

Comments
 (0)