Closed vickyoo7 closed 3 years ago
Thank you for this feedback.
Just added the new alert mapping in AlertType
, it's called SOCKS5_ALERT
.
Please try it with this jlibtorrent.jar (remove the .zip at the end of the filename, had to add it to drag into this comment), or git pull origin master
and run from source.
Thanks, it works now but the possibility of similar crashes in future remains. Can you make the alertsloop thread more robust because if the thread crashes there's no way to handle it apart from catching it in UncaughtExceptionHandler, ignore it and stop the Session. Also I think returning UNKOWN for unmapped alert type is better
public static AlertType fromSwig(int swigValue) {
return swigValue < 0 || swigValue >= TABLE.length ? UNKNOWN : TABLE[swigValue];
}
I believe the possibility of such cras in alertsloop is a feature, not a bug. If I remember @aldenml's coding style, these are things you don't want to fail silently, if an alert is missing we want to know it's missing.
Ok thanks, it makes sense
When connection to proxy server is failed Alert type with 96 value is popped with message "SOCKS5 error. op: connect ec: Connection refused ep: 127.0.0.1:9050". Below code throws null pointer exception because AlertType Table doesn't have a value for index 96, there might be other values as well