Changeset 5154 for trunk/oscam-http.c
- Timestamp:
- 05/01/11 18:07:52 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oscam-http.c
r5152 r5154 2643 2643 tpl_addVar(vars, TPLADD, "REFRESH", tpl_getTpl(vars, "REFRESH")); 2644 2644 tpl_printf(vars, TPLADD, "SECONDS", "%d", SHUTDOWNREFRESH); 2645 send_headers(f, 200, "OK", NULL, "text/html", 0, 0); 2646 webif_write(tpl_getTpl(vars, "SHUTDOWN"), f); 2645 char *result = tpl_getTpl(vars, "SHUTDOWN"); 2646 send_headers(f, 200, "OK", NULL, "text/html", 0, strlen(result), 0); 2647 webif_write(result, f); 2647 2648 cs_log("Shutdown requested by WebIF from %s", inet_ntoa(in)); 2648 2649 } else { … … 2666 2667 tpl_addVar(vars, TPLADD, "REFRESH", tpl_getTpl(vars, "REFRESH")); 2667 2668 tpl_printf(vars, TPLADD, "SECONDS", "%d", 2); 2668 send_headers(f, 200, "OK", NULL, "text/html", 0, 0); 2669 webif_write(tpl_getTpl(vars, "SHUTDOWN"), f); 2669 char *result = tpl_getTpl(vars, "SHUTDOWN"); 2670 send_headers(f, 200, "OK", NULL, "text/html", 0,strlen(result), 0); 2671 webif_write(result, f); 2670 2672 cs_log("Restart requested by WebIF from %s", inet_ntoa(in)); 2671 2673 } else { … … 3070 3072 int32_t len = b64decode((uchar *)ptr + 7); 3071 3073 if(len > 0){ 3072 send_headers(f, 200, "OK", NULL, header + 5, 1, 0);3074 send_headers(f, 200, "OK", NULL, header + 5, 1, len, 0); 3073 3075 webif_write_raw(ptr + 7, f, len); 3074 3076 return "1"; … … 3295 3297 snprintf(temp, sizeof(temp), "WWW-Authenticate: Digest algorithm=\"MD5\", realm=\"%s\", qop=\"auth\", opaque=\"\", nonce=\"%s\"", AUTHREALM, expectednonce); 3296 3298 if(authok == 2) strncat(temp, ", stale=true", sizeof(temp)); 3297 send_headers(f, 401, "Unauthorized", temp, "text/html", 0, 0 );3299 send_headers(f, 401, "Unauthorized", temp, "text/html", 0, 0, 0); 3298 3300 free(filebuf); 3299 3301 return 0; … … 3302 3304 /*build page*/ 3303 3305 if(pgidx == 8) { 3304 send_headers(f, 200, "OK", NULL, "text/css", 1, 0);3305 3306 send_file(f, "CSS"); 3306 3307 } else if (pgidx == 17) { 3307 send_headers(f, 200, "OK", NULL, "text/javascript", 1, 0);3308 3308 send_file(f, "JS"); 3309 3309 } else { … … 3389 3389 else if (strcmp(result, "1")) { 3390 3390 if (pgidx == 18) 3391 send_headers(f, 200, "OK", NULL, "text/xml", 0, 0);3391 send_headers(f, 200, "OK", NULL, "text/xml", 0, strlen(result), 0); 3392 3392 else 3393 send_headers(f, 200, "OK", NULL, "text/html", 0, 0);3393 send_headers(f, 200, "OK", NULL, "text/html", 0, strlen(result), 0); 3394 3394 webif_write(result, f); 3395 3395 }
Note:
See TracChangeset
for help on using the changeset viewer.