[
https://issues.apache.org/jira/browse/HTTPCORE-727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17627619#comment-17627619
]
Isaac Cruz Ballesteros commented on HTTPCORE-727:
-------------------------------------------------
So I think there is also a missing incrementBytesTransferred() call, for
sentBytesCount, on following stack trace (it should be added to
commitMessageHead() method after call to outbuf.flush(ioSession)):
{noformat}
SessionOutputBufferImpl.flush(WritableByteChannel) line: 119
ServerHttp1StreamDuplexer(AbstractHttp1StreamDuplexer<IncomingMessage,OutgoingMessage>).commitMessageHead(OutgoingMessage,
boolean, FlushMode) line: 450
ServerHttp1StreamDuplexer$1.submit(HttpResponse, boolean, FlushMode) line:
132
ServerHttp1StreamDuplexer$1.submit(HttpMessage, boolean, FlushMode) line: 1
ServerHttp1StreamHandler.commitInformation(HttpResponse) line: 205
ServerHttp1StreamHandler.access$2(ServerHttp1StreamHandler, HttpResponse)
line: 197
ServerHttp1StreamHandler$2.sendInformation(HttpResponse, HttpContext) line:
122
DataTransferModule$3(BasicAsyncServerExpectationDecorator).handleRequest(HttpRequest,
EntityDetails, ResponseChannel, HttpContext) line: 96
ServerHttp1StreamHandler.consumeHeader(HttpRequest, EntityDetails) line:
271
ServerHttp1StreamDuplexer.consumeHeader(HttpRequest, EntityDetails) line:
366
ServerHttp1StreamDuplexer.consumeHeader(HttpMessage, EntityDetails) line: 1
ServerHttp1StreamDuplexer(AbstractHttp1StreamDuplexer<IncomingMessage,OutgoingMessage>).onInput(ByteBuffer)
line: 296
ServerHttp1IOEventHandler(AbstractHttp1IOEventHandler).inputReady(IOSession,
ByteBuffer) line: 64
ServerHttp1IOEventHandler.inputReady(IOSession, ByteBuffer) line: 1
InternalDataChannel.onIOEvent(int) line: 133
InternalDataChannel(InternalChannel).handleIOEvent(int) line: 51
SingleCoreIOReactor.processEvents(Set<SelectionKey>) line: 178
SingleCoreIOReactor.doExecute() line: 127
SingleCoreIOReactor(AbstractSingleCoreIOReactor).execute() line: 85
IOReactorWorker.run() line: 44
{noformat}
[~olegk] do you want me to create a separate ticket for that?
> EndpointDetails.getReceivedBytesCount() won't work under TLS
> ------------------------------------------------------------
>
> Key: HTTPCORE-727
> URL: https://issues.apache.org/jira/browse/HTTPCORE-727
> Project: HttpComponents HttpCore
> Issue Type: Bug
> Components: HttpCore NIO
> Affects Versions: 5.1.4
> Reporter: Isaac Cruz Ballesteros
> Priority: Minor
> Fix For: 5.1.5, 5.2-beta3
>
> Attachments: AsyncFileServerExample.java
>
>
> When using TLS, endpointDetails.getReceivedBytesCount(), called on
> disconnection(), always returns 0. I have modified AsyncFileServerExample
> (attached) to enable TLS and get EndpointDetails to get that metric to
> reproduce this issue.
> After executing AsyncFileServerExample, I run
> {noformat}
> wget --no-check-certificate https://localhost:8080/xxx{noformat}
> (it will get a 404), and the output is:
> {noformat}
> Sun, 30 Oct 2022 14:34:07 GMT | Listening on /[0:0:0:0:0:0:0:0]:8080
> Sun, 30 Oct 2022 14:34:11 GMT | handle() EndpointDetails: sent=0, received=0
> Sun, 30 Oct 2022 14:34:11 GMT | File .\xxx not found
> Sun, 30 Oct 2022 14:34:11 GMT | disconnected() EndpointDetails: sent=252,
> received=0 {noformat}
> Notice how sent bytes is updated after handle(), but received is always 0.
> This is the output when switching to HTTP:
> {noformat}
> Mon, 31 Oct 2022 08:09:29 GMT | Listening on /[0:0:0:0:0:0:0:0]:8080
> Mon, 31 Oct 2022 08:09:46 GMT | handle() EndpointDetails: sent=0, received=114
> Mon, 31 Oct 2022 08:09:46 GMT | File .\xxx not found
> Mon, 31 Oct 2022 08:09:46 GMT | disconnected() EndpointDetails: sent=252,
> received=114{noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]