1
0
mirror of https://github.com/schollz/croc.git synced 2024-11-23 15:44:16 +03:00

increase buffer

This commit is contained in:
Zack Scholl 2018-09-22 07:15:43 -07:00
parent 9cf6bdf4a8
commit 54b22cd732
3 changed files with 7 additions and 5 deletions

View File

@ -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,

View File

@ -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.

View File

@ -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),