4822l6

Listing 6. Reading the Request

18      while(1){
19        r=BIO_gets(io,buf,BUFSIZZ-1);
20
21        switch(SSL_get_error(ssl,r)){
22          case SSL_ERROR_NONE:
23            len=r;
24            break;
25          default:
26            berr_exit("SSL read problem");
27        }
28
29        /* Look for the blank line that signals
30           the end of the HTTP headers */
31        if(!strcmp(buf,"\r\n") ||
32          !strcmp(buf,"\n"))
33          break;
34      }
