Always return a response avoiding iOS crashes on no-changes

pull/17/head
Ludovic Marcotte 2014-02-17 11:28:06 -05:00
parent 401320e08b
commit d560d0e470
1 changed files with 5 additions and 1 deletions

View File

@ -998,7 +998,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if (changeDetected)
{
NSLog(@"Change detected, we push the content.");
[output appendString: s];
break;
}
else
@ -1008,6 +1007,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
}
// We always return the last generated response.
// If we only return <Sync><Collections/></Sync>,
// iOS powered devices will simply crash.
[output appendString: s];
[output appendString: @"</Collections></Sync>"];
d = [[output dataUsingEncoding: NSUTF8StringEncoding] xml2wbxml];