i noticed refactor of socket_send (in libimobile_glue) to accomodate wsaerror on windows, but change in usbmuxd_send function is necessesary.
because socket_send now returns negative value, usbmuxd_send must also return negative value.
previously to num_sent value of errno (which is positive) was assigned, and changed to negative with substraction operation, but now this operation makes returned value to be positive, so any function that checks on usbmuxd_send >= 0 will always think data was sent, even if there is error.
i noticed refactor of socket_send (in libimobile_glue) to accomodate wsaerror on windows, but change in usbmuxd_send function is necessesary.
because socket_send now returns negative value, usbmuxd_send must also return negative value.
previously to num_sent value of errno (which is positive) was assigned, and changed to negative with substraction operation, but now this operation makes returned value to be positive, so any function that checks on usbmuxd_send >= 0 will always think data was sent, even if there is error.
https://github.com/libimobiledevice/libusbmuxd/blob/2387d8e5820ee4621494e20434c0017aba6bea71/src/libusbmuxd.c#L1596 must be changed to
return num_sent;