From b2f9ff501674c38621092ab3d9efeefbec6f9c8f Mon Sep 17 00:00:00 2001 From: raul Date: Tue, 14 May 2024 15:59:23 +0200 Subject: [PATCH] Small tweaks --- README.md | 4 ++-- cmd/clientFunc.go | 2 +- cmd/server.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 028c3e6..a4086da 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Flags: ### Server ``` Example: - ./mini-chat server --port 1337 + ./mini-chat server --port 1337 --history chat.log --password coolh4x0r1337 Usage: mini-chat server [flags] @@ -35,5 +35,5 @@ Flags: -r, --history string File to store and recover chat history from --insecure [UNSAFE] Do not use TLS encryption --password string Password for accessing the chat server - -p, --port string port to use for listening (default "1302") + -p, --port string Port to use for listening (default "1302") ``` diff --git a/cmd/clientFunc.go b/cmd/clientFunc.go index 1e3c6de..b1b6518 100644 --- a/cmd/clientFunc.go +++ b/cmd/clientFunc.go @@ -131,7 +131,7 @@ func listenMessages(g *gocui.Gui) { } func receiveMessage(conn net.Conn) (s string, b int, err error) { - serverMessage := make([]byte, 2048) + serverMessage := make([]byte, 1536) n, err := conn.Read(serverMessage) if err != nil { return "", 0, err diff --git a/cmd/server.go b/cmd/server.go index a2a4ffb..c7b0142 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -16,7 +16,7 @@ var serverCmd = &cobra.Command{ using a proper interface this time, not using netcat. Example: - ./mini-chat server --port 1337`, + ./mini-chat server --port 1337 --history chat.log --password coolh4x0r1337`, Run: func(cmd *cobra.Command, args []string) { if err := setServerParameters(cmd); err != nil { @@ -29,7 +29,7 @@ Example: func init() { rootCmd.AddCommand(serverCmd) - serverCmd.PersistentFlags().StringP("port", "p", "1302", "port to use for listening") + serverCmd.PersistentFlags().StringP("port", "p", "1302", "Port to use for listening") serverCmd.PersistentFlags().StringP("history", "r", "", "File to store and recover chat history from") serverCmd.PersistentFlags().String("password", "", "Password for accessing the chat server") serverCmd.Flags().Bool("insecure", false, "[UNSAFE] Do not use TLS encryption")