[Mono-list] Re: SslClientStream: nonblocking read?

Francisco Figueiredo Jr. fxjrlists@yahoo.com.br
Sat, 04 Dec 2004 00:36:22 -0200


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Carlos Guzmán Álvarez wrote:
| Hello:
|

Hello Carlos Guzman.

|>
| Can you do a little test ?? Just modify the RecordProtocol.ReceiveRecord
| method as:
|
|       public byte[] ReceiveRecord()
|       {
|           if (this.context.ConnectionEnd)
|           {
|               throw new TlsException(
|                   AlertDescription.InternalError,
|                   "The session is finished and it's no longer valid.");
|           }
|
|           // If the inner stream is a NetworkStream and there are no data
|           // return null
|           if (this.context.IsActual && this.innerStream is NetworkStream)
|           {
|               if (!((NetworkStream)this.innerStream).DataAvailable)
|               {
|                   return null;
|               }
|           }
|


I added this check, and now it breaks with the message, in my case of
Npgsql usage:

[Invalid UTF-8]
Unhandled Exception: System.NotSupportedException: Backend sent
unrecognized response type: \xef\xbf\xbf

I think the buffer is being incorrectly read when I can Read().

I hope it helps.



- --
Regards,

Francisco Figueiredo Jr.
Membro Fundador do Projeto MonoBrasil - MonoBrasil Project Founder Member
http://monobrasil.softwarelivre.org



- -------------
"Science without religion is lame;
religion without science is blind."

~                  ~ Albert Einstein
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQEVAwUBQbEipv7iFmsNzeXfAQJFFgf9EvNi7ctVgRGg9Jhgd7vpdC99ZDo8XGjw
bWYCEiPZ+IGXKEmwOymN8OnGmO0ZKeuv1kqElesxyELvi5U1gfD+JogXMgnmZVH9
psgiyYx5KdtbnAq7UbYlZA+gsgdrFVHjsCy3VW0DyoBY2+DOz8ZVjKZ1uM2Drj59
XJ+vRoCFpuMlPX8bste408f6/is36peR3UgmhMyvBOH2Jf16AUCTVCfSEdmZdEgl
TNzGsCDwEgVeH0yxIudD0VP/UawLYHKfmXSqNWGg1wdhZl+v8/9V7RX55ykZzmS0
YkjO8fKKK0yuxYkI1OQt4Z3ii3dlsXRsW+AeSdXsmxVRtAUTbn4RrQ==
=uDma
-----END PGP SIGNATURE-----