-
Notifications
You must be signed in to change notification settings - Fork 458
Open
Description
-
In your
HttpUtil.parseHttpRequest()method:
the variablebodyEndIndexshould bebodyStartIndex + httpHeaders.contentLength + 1rather thanbodyStartIndex + httpHeaders.contentLength -
In your
Message.writePartialMessageToMessagemethod:
the variablestartIndexOfPartialMessageshould just beendIndex + 1rather thanmessage.offset + endIndex.
the variablelengthOfPartialMessageshould be(message.offset + message.length) - endIndex + 1rather than(message.offset + message.length) - endIndex -
I got a NPE when invoking the
HttpMessageReader.read().The code snippet is shown below:
Message message = this.messageBuffer.getMessage; //the return message might be null
message.metadata = new HttpHeaders(); //the NPE occurs here
To solve the problem,I add some code in your QueueIntFlip.take() method:
if(!flipped){
//add this if
if(readPos == capacity) {
readPos = 0;
}
if(readPos < writePos){
return elements[readPos++];
} else {
return -1;
}
}
Metadata
Metadata
Assignees
Labels
No labels