void serverResponseEnd(JsVar *httpServerResponseVar) { serverResponseWrite(httpServerResponseVar, 0); // force connection->sendData to be created even if data not called // TODO: This should only close the connection once the received data length == contentLength header jsvObjectSetChildAndUnLock(httpServerResponseVar, HTTP_NAME_CLOSE, jsvNewFromBool(true)); }
/*JSON{ "type" : "method", "class" : "httpSRs", "name" : "write", "generate" : "jswrap_httpSRs_write", "params" : [ ["data","JsVar","A string containing data to send"] ], "return" : ["bool","For note compatibility, the boolean false. When the send buffer is empty, a `drain` event will be sent"] }*/ bool jswrap_httpSRs_write(JsVar *parent, JsVar *data) { serverResponseWrite(parent, data); return false; }
void serverResponseEnd(JsVar *httpServerResponseVar) { serverResponseWrite(httpServerResponseVar, 0); // force connection->sendData to be created even if data not called jsvUnLock(jsvObjectSetChild(httpServerResponseVar, HTTP_NAME_CLOSE, jsvNewFromBool(true))); }