Comment 10 for bug 681934

Revision history for this message
Nizamov Shawkat (nizamov-shawkat) wrote :

Hi!

Unfortunately, making priority uint32_t breaks things somehow. There is a part of logic where comparison is made against -1. Compiler gives the warning about comparing signed and unsigned variables, but that is not a problem. Somehow this part leads to a crash, if priority is unsigned. However, the actual functions in transfer.cc and request.cc, that this priority variable depends on, are made uint32_t. So, its actual value is always non-negative. But can not be unsigned, I am not competent enough in C to understand this case.

I also corrected the style of the patch and added also Andreas patch. Attached is the resulting patch, I have tested it a little bit, things work as expected. And you are right, wares for warehouse go without request, so they default to priority 0. It maybe a little bit too small, but this makes sense only in marginal cases.

I'll try to push it to launchpad and request the merge, when figure out how it should be performed.