# HG changeset patch # User Yaroslav Zhuravlev # Date 1614862562 0 # Node ID a33d8f0f48b233f115f507bb2fd9824b02514e40 # Parent e4d370d43176013f01bc66ec3e47f9599201e255 Documented r.done and r.sendBuffer in njs Reference. diff --git a/xml/en/docs/njs/reference.xml b/xml/en/docs/njs/reference.xml --- a/xml/en/docs/njs/reference.xml +++ b/xml/en/docs/njs/reference.xml @@ -9,7 +9,7 @@
+ rev="62">
@@ -50,6 +50,16 @@ All string properties of the object are request arguments object, read-only +r.done() + +after calling this function, +next data chunks will be passed to client without calling + +(0.5.2). +May be called only from the + function + + r.error(string) writes a string to the error log @@ -304,6 +314,37 @@ The data sent can be a string or Buffer (0.5.0) +r.sendBuffer(data[, +options]) + +adds data to the chain of data chunks to be forwarded to the next body filter +(0.5.2). +The actual forwarding happens later, +when the all the data chunks of the current chain are processed. + +The data can be a string or Buffer. +The options is an object used +to override nginx buffer flags derived from an incoming data chunk buffer. +The flags can be overridden with the following flags: + + +last + +boolean, +true if the buffer is the last buffer + + +flush + +boolean, +true if the buffer should have the flush flag + + + +The method may be called only from the + function. + + r.sendHeader() sends the HTTP headers to the client