Hi,
Did you mean http status need set to be 408 at access log when send timeout happens?
If it is YES please try the below method changeReponseHttpStatus when send timeout happends
public void changeReponseHttpStatus(NginxRequest request, int code) {
long statusAddr = request.nativeRequest()
+ MiniConstants.NGX_HTTP_CLOJURE_REQ_HEADERS_OUT_OFFSET
+ MiniConstants.NGX_HTTP_CLOJURE_HEADERSO_STATUS_OFFSET;
NginxClojureRT.pushNGXInt(statusAddr, code);
}
e.g.
changeReponseHttpStatus(request, 200); //initialize http status to 200
ch.addListener(ch, new ChannelCloseAdapter<NginxHttpServerChannel>() {
@Override
public void onClose(NginxHttpServerChannel data) throws IOException {
log.info("StreamingWriteHandler closed now!");
}
@Override
public void onWrite(long status, NginxHttpServerChannel ch) throws IOException {
if (status < 0) {
log.error("onWrite error %s", NginxClojureAsynSocket.errorCodeToString(status));
if (status == NginxClojureAsynSocket.NGX_HTTP_CLOJURE_SOCKET_ERR_WRITE_TIMEOUT)
//make access log use 408 as the http status for this request
changeReponseHttpStatus(ch.request(), 408);}
ch.close();
}else {
doWrite(ch);
}
}
});