mirror of
https://github.com/schollz/croc.git
synced 2024-12-11 06:35:01 +03:00
change buffer size
This commit is contained in:
parent
b469d5db4b
commit
73791a4dc7
@ -19,7 +19,7 @@ const (
|
||||
pingPeriod = (pongWait * 9) / 10
|
||||
|
||||
// Maximum message size allowed from peer.
|
||||
maxMessageSize = 1024 * 1024 * 1
|
||||
maxMessageSize = 1024 * 1024 * 16
|
||||
)
|
||||
|
||||
var upgrader = websocket.Upgrader{
|
||||
|
@ -69,11 +69,13 @@ func (h *hub) run() {
|
||||
case s := <-h.unregister:
|
||||
// if one leaves, close all of them
|
||||
h.rooms.Lock()
|
||||
for connection := range h.rooms.rooms[s.room] {
|
||||
close(connection.send)
|
||||
if _, ok := h.rooms.rooms[s.room]; ok {
|
||||
for connection := range h.rooms.rooms[s.room] {
|
||||
close(connection.send)
|
||||
}
|
||||
log.Debugf("deleting room %s", s.room)
|
||||
delete(h.rooms.rooms, s.room)
|
||||
}
|
||||
log.Debugf("deleting room %s", s.room)
|
||||
delete(h.rooms.rooms, s.room)
|
||||
h.rooms.Unlock()
|
||||
case m := <-h.broadcast:
|
||||
h.rooms.Lock()
|
||||
|
@ -157,7 +157,7 @@ func send(c *websocket.Conn, fname string, codephrase string) (err error) {
|
||||
|
||||
fmt.Fprintf(os.Stderr, "Sending...\n")
|
||||
// send file, compure hash simultaneously
|
||||
buffer := make([]byte, 1024*512)
|
||||
buffer := make([]byte, 1024*1024*8)
|
||||
bar := progressbar.NewOptions(
|
||||
int(fstats.Size),
|
||||
progressbar.OptionSetRenderBlankState(true),
|
||||
|
Loading…
Reference in New Issue
Block a user