------------------------------------------------------------ revno: 13236 revision-id: squid3@treenet.co.nz-20140116002434-w3z7e2ayriied182 parent: squid3@treenet.co.nz-20140115235754-j23bdu0yhulzzb6v committer: Amos Jeffries branch nick: trunk timestamp: Thu 2014-01-16 13:24:34 +1300 message: Revert and replace rev.13234 Clang dentifies the StoreIOBuffer parameter as unsigned, error: comparison of unsigned expression < 0 is always false ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20140116002434-w3z7e2ayriied182 # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 997bc276e54ad39e0e54875dcebc6a9409db91f5 # timestamp: 2014-01-16 00:57:05 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20140115235754-\ # j23bdu0yhulzzb6v # # Begin patch === modified file 'src/StoreIOBuffer.h' --- src/StoreIOBuffer.h 2014-01-15 02:11:05 +0000 +++ src/StoreIOBuffer.h 2014-01-16 00:24:34 +0000 @@ -45,12 +45,7 @@ StoreIOBuffer(size_t aLength, int64_t anOffset, char *someData) : length (aLength), offset (anOffset), data (someData) { - if (aLength < 0) { - flags.error = 1; - length = 0; - } else { - flags.error = 0; - } + flags.error = 0; } /* Create a StoreIOBuffer from a MemBuf and offset */ === modified file 'src/store_client.cc' --- src/store_client.cc 2014-01-15 02:11:05 +0000 +++ src/store_client.cc 2014-01-16 00:24:34 +0000 @@ -132,14 +132,19 @@ void store_client::callback(ssize_t sz, bool error) { - StoreIOBuffer result(sz, 0 ,copyInto.data); - - if (error) + size_t bSz = 0; + + if (sz >= 0 && !error) + bSz = sz; + + StoreIOBuffer result(bSz, 0 ,copyInto.data); + + if (sz < 0 || error) result.flags.error = 1; result.offset = cmp_offset; assert(_callback.pending()); - cmp_offset = copyInto.offset + sz; + cmp_offset = copyInto.offset + bSz; STCB *temphandler = _callback.callback_handler; void *cbdata = _callback.callback_data; _callback = Callback(NULL, NULL);