Hi all, As part of porting a feature to naviserver, I'm trying to understand all the code paths that outgoing data can take. I think I found a bug in the range handling code, but I can't figure out how to tickle it, which makes me wonder if there's something less-obvious going on.
This code from return.c:ReturnRange (~lines 889-893) looks wrong to me: for (i = 0; i < rangeCount; i++) { vbuf[0].iov_base = (void *)(intptr_t)bufs[0].offset; vbuf[0].iov_len = bufs[0].length; len += bufs[0].length; } If I understand correctly, this codepath if used for a non-file based return, so e.g., "ns_return -binary" should get here. It's looks to be looping over the ranges set from Ns_ConnParseRange, but using index 0 instead of index i. I would expect the result to be that the first requested range is returned multiple times, but it seems to return multiple ranges just fine. I was able to construct a failing byterange test with an incorrect length (if the multiple ranges are different sizes rather than all the same size), but the content is still correct, which is puzzling. Also, it looks like ranges aren't supported at all for character data (e.g., adp responses or non-binary ns_return). Is this intentional and desirable? It seems reasonable at first glance, since the most useful use case for ranges is large binaries, but it seems a bit inconsistent. Cheers, -J ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft _______________________________________________ naviserver-devel mailing list naviserver-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/naviserver-devel