On Mon, 2005-03-14 at 11:01, [EMAIL PROTECTED] wrote: > > Hi, > > > > Once again I try to explain my problem. I am having a client sending > > "unknown size of data" to server. Server doesn't know how much to > > receive, but the length of the data is embedded inside the data itself ( > > initial 32 bytes contains this info ). So server has to read the initial > > bytes of data, determine the length of complete payload and then read > > the complete data. So the question is how do I do it ? For implementing > > this I need a recursive call to ssl_read which I am not able to .. The > > code snippet I attached was trying to read 32 bytes recursively and > > print it on console. It indeed reads 32 bytes but only once and wait > > infinitely after that .. > > 1: > read the 32 byte "packet header" > 2: > read the dynamic size part > 3: > goto 1 > > The reason it would wait for ever is that you don't feed it with new 32 > bytes from the other side. You try to read 32 and 32 bytes forever over > and over again. > Hi,
My apologies, but I didn't understand it fully. The client sends the complete data to server in one shot ( by allocating the buffer of required size ), but server needs to read it in ssl_read loop, because it needs to know the data size from data itself. I have tried it by splitting the transaction into 2 parts as client -> server ( actual data size in next call ) server -> client ( OK ) client -> server ( actual data ) server -> client ( received ). This works but because of extra overhead I want to eliminate it. and make it as client -> server ( data length embedded in data ) server reads the data in ssl_read loop. server -> client ( received ) Regards, /Mahesh > > > Stian > ______________________________________________________________________ > OpenSSL Project http://www.openssl.org > Development Mailing List openssl-dev@openssl.org > Automated List Manager [EMAIL PROTECTED] ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List openssl-dev@openssl.org Automated List Manager [EMAIL PROTECTED]