mirror of
https://github.com/schollz/croc.git
synced 2024-11-23 15:44:16 +03:00
increase buffer
This commit is contained in:
parent
9cf6bdf4a8
commit
54b22cd732
4
main.go
4
main.go
@ -144,6 +144,8 @@ func send(c *cli.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fname, _ = filepath.Abs(fname)
|
||||
fname = filepath.Clean(fname)
|
||||
_, filename := filepath.Split(fname)
|
||||
fileOrFolder := "file"
|
||||
fsize := finfo.Size()
|
||||
@ -155,7 +157,7 @@ func send(c *cli.Context) error {
|
||||
}
|
||||
}
|
||||
fmt.Fprintf(os.Stderr,
|
||||
"Sending %s %s name '%s'\nCode is: %s\nOn the other computer, please run:\n\ncroc %s\n\n",
|
||||
"Sending %s %s named '%s'\nCode is: %s\nOn the other computer, please run:\n\ncroc %s\n\n",
|
||||
humanize.Bytes(uint64(fsize)),
|
||||
fileOrFolder,
|
||||
filename,
|
||||
|
@ -19,12 +19,12 @@ const (
|
||||
pingPeriod = (pongWait * 9) / 10
|
||||
|
||||
// Maximum message size allowed from peer.
|
||||
maxMessageSize = 1024 * 1024
|
||||
maxMessageSize = 1024 * 1024 * 16
|
||||
)
|
||||
|
||||
var upgrader = websocket.Upgrader{
|
||||
ReadBufferSize: 1024 * 1024,
|
||||
WriteBufferSize: 1024 * 1024,
|
||||
ReadBufferSize: 1024 * 1024 * 8,
|
||||
WriteBufferSize: 1024 * 1024 * 8,
|
||||
}
|
||||
|
||||
// connection is an middleman between the websocket connection and the hub.
|
||||
|
@ -156,7 +156,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*4)
|
||||
bar := progressbar.NewOptions(
|
||||
int(fstats.Size),
|
||||
progressbar.OptionSetRenderBlankState(true),
|
||||
|
Loading…
Reference in New Issue
Block a user