From 3f38e00703caf05a1867070873c8715438b41264 Mon Sep 17 00:00:00 2001
From: Christian Pointner <equinox@helsinki.at>
Date: Fri, 24 Jun 2016 06:33:56 +0200
Subject: set chunk size for websocket file uploads to 40k...


diff --git a/src/rhimportd/ctrlWebSocket.go b/src/rhimportd/ctrlWebSocket.go
index 6095250..4dd43a7 100644
--- a/src/rhimportd/ctrlWebSocket.go
+++ b/src/rhimportd/ctrlWebSocket.go
@@ -310,7 +310,7 @@ func webSocketSessionHandler(reqchan <-chan webSocketRequestData, binchan <-chan
 func webSocketHandler(conf *rhimport.Config, db *rddb.DBChan, sessions *rhimport.SessionStoreChan, trusted bool, w http.ResponseWriter, r *http.Request) {
 	rhdl.Printf("WebSocketHandler: request for '%s'", html.EscapeString(r.URL.Path))
 
-	ws, err := websocket.Upgrade(w, r, nil, 1024, 1024)
+	ws, err := websocket.Upgrade(w, r, nil, 64*1024, 64*1024)
 	if _, ok := err.(websocket.HandshakeError); ok {
 		http.Error(w, "Not a websocket handshake", 400)
 		return
diff --git a/src/rhimportd/main.go b/src/rhimportd/main.go
index 97a12ec..7f0a4ce 100644
--- a/src/rhimportd/main.go
+++ b/src/rhimportd/main.go
@@ -112,7 +112,7 @@ func main() {
 		rhl.Println("Error parsing RHIMPORTD_UPLOAD_MAX_AGE from environment:", err)
 		return
 	}
-	flag.Var(uploadMaxAge, "upload-max-age", "maximum age of uploaded files before the get deleted (environment: RHIMPORTD_UPLOAD_MAX_AGE)")
+	flag.Var(uploadMaxAge, "upload-max-age", "maximum age of uploaded files before they get deleted (environment: RHIMPORTD_UPLOAD_MAX_AGE)")
 
 	help := flag.Bool("help", false, "show usage")
 
diff --git a/web-static/socket.html b/web-static/socket.html
index 3737c5f..af73763 100644
--- a/web-static/socket.html
+++ b/web-static/socket.html
@@ -105,7 +105,7 @@
       }
 
       function sendbinmsg() {
-        var byteArray = new Uint8Array(100);
+        var byteArray = new Uint8Array(40*1024);
         for (var x = 0; x < byteArray.length; x++){
           byteArray[x] = x
         }
-- 
cgit v0.10.2