MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / sendStatusOnly

Method sendStatusOnly

src/tsd/AbstractHttpQuery.java:405–427  ·  view source on GitHub ↗

Send just the status code without a body, used for 204 or 304 @param status The response code to reply with

(final HttpResponseStatus status)

Source from the content-addressed store, hash-verified

403 * @param status The response code to reply with
404 */
405 public void sendStatusOnly(final HttpResponseStatus status) {
406 if (!chan.isConnected()) {
407 if(stats != null) {
408 stats.markSendFailed();
409 }
410 done();
411 return;
412 }
413
414 response.setStatus(status);
415 final boolean keepalive = HttpHeaders.isKeepAlive(request);
416 if (keepalive) {
417 HttpHeaders.setContentLength(response, 0);
418 }
419 final ChannelFuture future = chan.write(response);
420 if (stats != null) {
421 future.addListener(new SendSuccess());
422 }
423 if (!keepalive) {
424 future.addListener(ChannelFutureListener.CLOSE);
425 }
426 done();
427 }
428
429 /**
430 * Sends an HTTP reply to the client.

Callers 8

notFoundMethod · 0.95
handleUIDMetaMethod · 0.45
handleTSMetaMethod · 0.45
executeMethod · 0.45
applyCorsConfigMethod · 0.45
handleTreeMethod · 0.45
handleRuleMethod · 0.45
handleRulesMethod · 0.45

Calls 3

doneMethod · 0.95
markSendFailedMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected