• D
    net_linux.go: decode port as 16-bit uint · 5c1a9e70
    Disconnect3d 提交于
    Changes the port parsing from `/proc/net/*` files records from parsing them as 64-bit integers to parse them as 16-bit unsigned integers.
    
    While this is mostly a cosmetic change, it will also make so that the code fails faster in case the entry is malformed (for whatever reason).
    
    Note that the returned value is still casted to uint32 when an  `Addr` object is created.
    It seems to me that the `Addr.port` field should be changed to `uint16` but maybe some other APIs/systems wants it to be `uint32` and also changing it there may require changes in users code if they update. This being said I am not changing that field's type.
    5c1a9e70
net_linux.go 21.9 KB