fix #388
This commit is contained in:
@@ -266,7 +266,7 @@ Some of you may be thinking the following: this server does not do anything mean
|
|||||||
|
|
||||||
func handleClient(conn net.Conn) {
|
func handleClient(conn net.Conn) {
|
||||||
conn.SetReadDeadline(time.Now().Add(2 * time.Minute)) // set 2 minutes timeout
|
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
|
defer conn.Close() // close connection before exit
|
||||||
for {
|
for {
|
||||||
read_len, err := conn.Read(request)
|
read_len, err := conn.Read(request)
|
||||||
|
|||||||
Reference in New Issue
Block a user