Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
zys #1
Member since Apr 2009 · 6 posts
Group memberships: Members
Show profile · Link to this post
Subject: Problems when sending Latin characters using BOSH
I testing AGS BOSH feature and I have noticed the following:
if I send a message containing for example ààààààààà
an internal exception is thrown in method OnGetRequestStream
{"bytes to write in the stream exceed the size specified in Content-Length."}    System.Exception {System.Net.ProtocolViolationException}

Actually the Content-Length is set as req.ContentLength   = state.Output.Length;
while byte[] bytes = Encoding.UTF8.GetBytes(state.Output); returns array of bytes that is longer than the state.Output.Length !!!

Apparently this is due the character à which is encoded over 2 bytes
An immediate workaround is to add this in StartWebRequest()
            byte[] bytes = Encoding.UTF8.GetBytes(state.Output);
            req.ContentLength = bytes.Length;
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
thanks for this bug report. Its fixed in the latest SVN version.

Alex
Avatar
zys #3
Member since Apr 2009 · 6 posts
Group memberships: Members
Show profile · Link to this post
Ok it is fine now, thx
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS