Dear all,
I am using MINA in my project to implement a TCP server.  The server needs
to hold long-lived connections with clients. The server and clients use
HTTP-like protocol to exchange xml messages. Here is a simlified message
example:

POST / HTTP/1.1
Content-Length: 69

<?xml version="1.0" encoding="utf-8"?><Event><Header/><Body/></Event>

"Content-Length" is used to detect the end of a message. 
My problem is: 
1. If "Content-Length" is incorrect, how can I determine the end of the
message? Or, just return "Bad Request"? Using "</Event>" is not allowed
because not all messages end with "</Event>".
2. If the message is too large, will the message buffer(ByteBuffer) be
over-filled? How can I prevent this from crashing my program? 

Thanks 
-- 
View this message in context: 
http://www.nabble.com/Bad-Content-Length-problem-tf4696210s16868.html#a13423904
Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.

Reply via email to