Ignore:
Timestamp:
11/19/10 19:53:42 (10 years ago)
Author:
_network
Message:

WebIf: add error message on plain access to ssl port and fix http header

File:
1 edited

Legend:

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

    r3930 r3937  
    408408
    409409  sprintf(buf, "%s %d %s\r\n", PROTOCOL, status, title);
    410   sprintf(buf, "Server: %s\r\n", SERVER);
     410  sprintf(buf+strlen(buf), "Server: %s\r\n", SERVER);
    411411
    412412  now = time(NULL);
    413413  strftime(timebuf, sizeof(timebuf), RFC1123FMT, gmtime(&now));
    414   sprintf(buf, "Date: %s\r\n", timebuf);
     414  sprintf(buf+strlen(buf), "Date: %s\r\n", timebuf);
    415415
    416416    if (extra)
    417         sprintf(buf, "%s\r\n", extra);
     417        sprintf(buf+strlen(buf), "%s\r\n", extra);
    418418
    419419    if (mime)
    420         sprintf(buf, "Content-Type: %s\r\n", mime);
     420        sprintf(buf+strlen(buf), "Content-Type: %s\r\n", mime);
    421421
    422422    strftime(timebuf, sizeof(timebuf), RFC1123FMT, gmtime(&now));
    423     sprintf(buf, "Cache-Control: no-store, no-cache, must-revalidate\r\n");
    424     sprintf(buf, "Expires: Sat, 26 Jul 1997 05:00:00 GMT\r\n");
    425     sprintf(buf, "Last-Modified: %s\r\n", timebuf);
    426     sprintf(buf, "Connection: close\r\n");
    427     sprintf(buf, "\r\n");
     423    sprintf(buf+strlen(buf), "Cache-Control: no-store, no-cache, must-revalidate\r\n");
     424    sprintf(buf+strlen(buf), "Expires: Sat, 26 Jul 1997 05:00:00 GMT\r\n");
     425    sprintf(buf+strlen(buf), "Last-Modified: %s\r\n", timebuf);
     426    sprintf(buf+strlen(buf), "Connection: close\r\n");
     427    sprintf(buf+strlen(buf), "\r\n");
    428428    webif_write(buf, f);
    429429}
     
    461461    send_headers(f, status, title, extra, "text/html");
    462462    sprintf(buf, "<HTML><HEAD><TITLE>%d %s</TITLE></HEAD>\r\n", status, title);
    463     sprintf(buf, "<BODY><H4>%d %s</H4>\r\n", status, title);
    464     sprintf(buf, "%s\r\n", text);
    465     sprintf(buf, "</BODY></HTML>\r\n");
     463    sprintf(buf+strlen(buf), "<BODY><H4>%d %s</H4>\r\n", status, title);
     464    sprintf(buf+strlen(buf), "%s\r\n", text);
     465    sprintf(buf+strlen(buf), "</BODY></HTML>\r\n");
    466466    webif_write(buf, f);
    467467}
Note: See TracChangeset for help on using the changeset viewer.