1 (edited by Philhippus 2012-05-04 16:34:20)

Topic: read one byte at a time

I am trying to use wolfSSL embedded SSL to implement a chunked encoding handler and my code seems to fail at this this point (after the socket has been set up and already used successfully):

    char tbuff[64];
    memset(tbuff,0,64);
    recvLen = 0;
    while (strstr(tbuff,"\r\n")==nullptr)
    {
        wolfSSL_read(cssl, buff, 1);
         tbuff[recvLen] = buff[0];
        recvLen+=1;
        cout << tbuff << endl;
    }

I realise the extreme inefficiency of this method to find a CRLF but is there any reason why CysSSL would fail here?
Thanks.

Share

Re: read one byte at a time

Actually the wolfSSL read function works fine pulling one byte from the socket. The problem was an infinite loop because strstr() never evaluated to false.

Share