anchor.diff:  send_doc_efficiently(Req, #doc{atts=Atts}=Doc, Headers, Options) ->
       case lists:member(attachments, Options) of
       true ->
  +        Refs = monitor_attachments(Atts),
  +        try
           AcceptedTypes = case couch_httpd:header_value(Req, "Accept") of
               undefined       -> [];
               AcceptHeader    -> string:tokens(AcceptHeader, ", ")
  
positive.code:         _ ->
              false
      end.
  
negative.code:             couch_doc:doc_to_multi_part_stream(InnerBoundary, JsonBytes, Atts,
                      fun(Data) -> couch_httpd:send_chunk(Resp, Data)
                      end, true),
               couch_httpd:send_chunk(Resp, <<"\r\n--", OuterBoundary/binary>>)
              after
                  demonitor_refs(Refs)
              end;
          ({{not_found, missing}, RevId}) ->
               RevStr = couch_doc:rev_to_str(RevId),
               Json = ?JSON_ENCODE({[{"missing", RevStr}]}),
  