This commit is contained in:
astaxie
2014-12-16 19:11:47 +08:00
parent f2f3591554
commit b91dd359c5

View File

@@ -266,7 +266,7 @@ Some of you may be thinking the following: this server does not do anything mean
func handleClient(conn net.Conn) {
conn.SetReadDeadline(time.Now().Add(2 * time.Minute)) // set 2 minutes timeout
request := make([]byte, 128) // set maxium request length to 128KB to prevent flood based attacks
request := make([]byte, 128) // set maximum request length to 128KB to prevent flood based attacks
defer conn.Close() // close connection before exit
for {
read_len, err := conn.Read(request)