Ignore:
Timestamp:
01/09/11 16:27:26 (10 years ago)
Author:
Admin
Message:

WebIf: Sending errors wasn't previously completely possible as the headers were already sent before. Fix bug in cccam entitlements display. Do some cleanup.

File:
1 edited

Legend:

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

    r4382 r4388  
    415415}
    416416
    417 
    418 
    419417/*
    420418 * function for sending files.
     
    452450
    453451void send_error(FILE *f, int status, char *title, char *extra, char *text){
    454     char buf[1024];
     452    char buf[(2* strlen(title)) + strlen(text) + 128];
     453    char *pos = buf;
    455454    send_headers(f, status, title, extra, "text/html");
    456     sprintf(buf, "<HTML><HEAD><TITLE>%d %s</TITLE></HEAD>\r\n", status, title);
    457     sprintf(buf+strlen(buf), "<BODY><H4>%d %s</H4>\r\n", status, title);
    458     sprintf(buf+strlen(buf), "%s\r\n", text);
    459     sprintf(buf+strlen(buf), "</BODY></HTML>\r\n");
     455    pos += sprintf(pos, "<HTML><HEAD><TITLE>%d %s</TITLE></HEAD>\r\n", status, title);
     456    pos += sprintf(pos, "<BODY><H4>%d %s</H4>\r\n", status, title);
     457    pos += sprintf(pos, "%s\r\n", text);
     458    pos += sprintf(pos, "</BODY></HTML>\r\n");
    460459    webif_write(buf, f);
    461460}
    462461
    463462void send_error500(FILE *f){
    464     send_error(f, 500, "Internal Server Error", NULL, "An internal error has occured.");
     463    send_error(f, 500, "Internal Server Error", NULL, "The server encountered an internal error that prevented it from fulfilling this request.");
    465464}
    466465
Note: See TracChangeset for help on using the changeset viewer.