GUIRY Aroun wrote:
Thanks Darryl for your help.

I wrote that "when I send a new packet from the client I can read the missing packets, but not the new one" But in fact I can read the missing packets and a part of the second packets.

Here is the trace. I send a trame of 10 bytes from the client, and the server read 5 bytes.


write(1, "Connection realized\r\n", 21) = 21
select(5, [4], NULL, NULL, NULL
-------------------------------------------------------------------------
I send a trame of 10 bytes
-------------------------------------------------------------------------
read(4, "\27\3\0\0 ", 5)                = 5
read(4, "\260\347\362\263\264Q\267\2\17\303&\1\222\37A\367~d\203"..., 32) = 32
read(4, "\27\3\0\0 ", 5)                = 5
read(4, "\177\376[\'\35\325[\242P\275F\313+b\233\261w\341Iu\336"..., 32) = 32
select(5, [4], NULL, NULL, NULL
-------------------------------------------------------------------------
I send a trame of 10 bytes
-------------------------------------------------------------------------
select(5, [4], NULL, NULL, NULL)        = 1 (in [4])
read(4, "\27\3\0\0 ", 5)                = 5
read(4, "\357YO\305\4NU\316\264\270\213S\347\306\346\222_\351a\t"..., 32) = 32
read(4, "\27\3\0\0 ", 5)                = 5
read(4, "q\361\322\'*\2764\223>\302g\375\260\0\211\376\265\266F"..., 32) = 32
select(5, [4], NULL, NULL, NULL

This doesn't tell me much and does not relate to your original 1024/512 bytes query.


But I understood your original problem to be that you issued a single SSL_write() at the client end for a 1024 application data payload.

But you were not seeing enough data at the server end after you waited for select to return readability, called SSL_read(), did not get the full chunk of application data you commited in the SSL_write() at the client end. So you waited for select some more. And this is the point you have a problem because you keep waiting and it never return there is new data to process and therefore you never call SSL_read() again to see all the data you expected come through.

The trace above looks correct for a 10 byte payload. The 5 bytes is SSL header and the 32 a packet of data.

You may want to turn on SSL_set_readahead() but that should not be the cause of your problems it will just make the SSL library <> kernel syscall interaction a little more efficient.

By highlighting SSL_pending() Marek as indicating that you may not have called SSL_read() enough time. Can I confirm after a select() readability hit you call SSL_read() as many times as you can, until it returns -1/WANT_READ.

I would guess that the first call to SSL_read() maybe processing a control packet, probably the end part of the initial handshake. What error return are you getting to SSL_read() and has SSL_connect() returned 1 yet ?

Darryl
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to