bugfix in recv to read full length

Currently, recv() fails if the line to be received is greater than 65535 bytes, irrespective of the size value. This fix makes sure that recv() reads `size` bytes.