kocolosk commented on issue #607: Extra 500 reply added to list function 
response when accessed through rewrite
URL: https://github.com/apache/couchdb/issues/607#issuecomment-310432762
 
 
   @natevw one question for you -- when you invoke `getRow()` the second time, 
is the response `null`? The general pattern that I see for these list functions 
is a `while(getRow())` sort of thing, and it does look like there is some 
special logic that fires on the last invocation that returns null. 
Specifically, this happens when the database sends the `list_end` message, and 
there's definitely logic in that part of the code that transforms a `#lacc{}` 
into a proper mochiweb response.
   
   It does look like we support "short-circuit" evaluation where your list 
function exits before getting to that last null response, but it's a different 
code path and so there could be some mistake there. I do find it interesting 
that this only crops up when you come in via a rewrite; I'm going to try to 
track that down now.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to