Ignore:
Timestamp:
11/19/10 17:04:10 (10 years ago)
Author:
_network
Message:

activate webif ssl support WITH_SSL (experimental)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/oscam-http-helpers.c

    r3929 r3930  
    377377int webif_write(char *buf, FILE* f) {
    378378#ifdef WITH_SSL
    379     return SSL_write((SSL*)f, buf, strlen(buf));
    380 #else
    381     return fwrite(buf, 1, strlen(buf), f);
     379    if (cfg->http_use_ssl) {
     380        return SSL_write((SSL*)f, buf, strlen(buf));
     381    } else
    382382#endif
     383        return fwrite(buf, 1, strlen(buf), f);
    383384}
    384385
    385386int webif_read(char *buf, int num, FILE *f) {
    386387#ifdef WITH_SSL
    387     return SSL_read((SSL*)f, buf, num);
    388 #else
    389     buf[0]='\0';
    390     int len=0;
    391     while (fgets(buf+len, num-len-1, f)) {
    392         if (buf[0+len] == '\r' && buf[1+len] == '\n') break;
    393         len=strlen(buf);
    394     }
    395     return len;
     388    if (cfg->http_use_ssl) {
     389        return SSL_read((SSL*)f, buf, num);
     390    } else
    396391#endif
     392    {
     393        buf[0]='\0';
     394        int len=0;
     395        while (fgets(buf+len, num-len-1, f)) {
     396            if (buf[0+len] == '\r' && buf[1+len] == '\n') break;
     397            len=strlen(buf);
     398        }
     399        return len;
     400    }
    397401}
    398402
Note: See TracChangeset for help on using the changeset viewer.