- Timestamp:
- 08/11/11 00:28:22 (13 years ago)
- Location:
- tags/1.10
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/1.10/oscam-http.c
r5775 r5813 30 30 cs_accounts_chk(); 31 31 break; 32 32 33 33 case REFR_CLIENTS: 34 34 cs_log("Refresh Clients requested by WebIF from %s", cs_inet_ntoa(GET_IP())); … … 58 58 if (cl->typ=='c' && (account = cl->account)) { 59 59 cl->ac_limit = (account->ac_users * 100 + 80) * cfg.ac_stime; 60 } else if (cl->typ=='a'){ 60 } else if (cl->typ=='a'){ 61 61 if(!cfg.ac_enabled) 62 62 kill_thread(cl); … … 294 294 #endif 295 295 296 #ifdef MODULE_CAMD33 296 297 static char *send_oscam_config_camd33(struct templatevars *vars, struct uriparams *params) { 297 298 int32_t i; … … 323 324 return tpl_getTpl(vars, "CONFIGCAMD33"); 324 325 } 325 326 #endif 327 328 #ifdef MODULE_CAMD35 326 329 static char *send_oscam_config_camd35(struct templatevars *vars, struct uriparams *params) { 327 330 int32_t i; … … 350 353 return tpl_getTpl(vars, "CONFIGCAMD35"); 351 354 } 352 355 #endif 356 357 #ifdef MODULE_CAMD35_TCP 353 358 static char *send_oscam_config_camd35tcp(struct templatevars *vars, struct uriparams *params) { 354 359 int32_t i; … … 380 385 return tpl_getTpl(vars, "CONFIGCAMD35TCP"); 381 386 } 382 387 #endif 388 389 #ifdef MODULE_NEWCAMD 383 390 static char *send_oscam_config_newcamd(struct templatevars *vars, struct uriparams *params) { 384 391 int32_t i; … … 418 425 return tpl_getTpl(vars, "CONFIGNEWCAMD"); 419 426 } 420 427 #endif 428 429 #ifdef MODULE_RADEGAST 421 430 static char *send_oscam_config_radegast(struct templatevars *vars, struct uriparams *params) { 422 431 int32_t i; … … 444 453 return tpl_getTpl(vars, "CONFIGRADEGAST"); 445 454 } 455 #endif 446 456 447 457 #ifdef MODULE_CCCAM … … 473 483 tpl_addVar(vars, TPLAPPEND, "PORT", value); 474 484 free_mk_t(value); 475 485 476 486 tpl_printf(vars, TPLADD, "RESHARE", "%d", cfg.cc_reshare); 477 487 … … 495 505 if (cfg.cc_stealth) 496 506 tpl_printf(vars, TPLADD, "STEALTH", "selected"); 497 507 498 508 tpl_printf(vars, TPLADD, "NODEID", "%02X%02X%02X%02X%02X%02X%02X%02X", 499 509 cfg.cc_fixed_nodeid[0], cfg.cc_fixed_nodeid[1], cfg.cc_fixed_nodeid[2], cfg.cc_fixed_nodeid[3], … … 602 612 tpl_addVar(vars, TPLADD, "NOCRYPT", value); 603 613 free_mk_t(value); 604 614 605 615 value = mk_t_iprange(cfg.http_allowed); 606 616 tpl_addVar(vars, TPLADD, "HTTPALLOW", value); … … 627 637 } 628 638 639 #ifdef MODULE_SERIAL 629 640 static char *send_oscam_config_serial(struct templatevars *vars, struct uriparams *params) { 630 641 int32_t i; … … 659 670 return tpl_getTpl(vars, "CONFIGSERIAL"); 660 671 } 672 #endif 661 673 662 674 #ifdef HAVE_DVBAPI … … 735 747 static char *send_oscam_config(struct templatevars *vars, struct uriparams *params) { 736 748 char *part = getParam(params, "part"); 737 if (!strcmp(part,"camd33")) return send_oscam_config_camd33(vars, params); 749 750 if (!strcmp(part,"monitor")) return send_oscam_config_monitor(vars, params); 751 #ifdef MODULE_CAMD33 752 else if (!strcmp(part,"camd33")) return send_oscam_config_camd33(vars, params); 753 #endif 754 #ifdef MODULE_CAMD35 738 755 else if (!strcmp(part,"camd35")) return send_oscam_config_camd35(vars, params); 756 #endif 757 #ifdef MODULE_CAMD35_TCP 739 758 else if (!strcmp(part,"camd35tcp")) return send_oscam_config_camd35tcp(vars, params); 759 #endif 760 #ifdef MODULE_NEWCAMD 740 761 else if (!strcmp(part,"newcamd")) return send_oscam_config_newcamd(vars, params); 762 #endif 763 #ifdef MODULE_RADEGAST 741 764 else if (!strcmp(part,"radegast")) return send_oscam_config_radegast(vars, params); 765 #endif 742 766 #ifdef MODULE_CCCAM 743 767 else if (!strcmp(part,"cccam")) return send_oscam_config_cccam(vars, params); … … 749 773 else if (!strcmp(part,"anticasc")) return send_oscam_config_anticasc(vars, params); 750 774 #endif 751 else if (!strcmp(part,"monitor")) return send_oscam_config_monitor(vars, params); 775 #ifdef MODULE_SERIAL 752 776 else if (!strcmp(part,"serial")) return send_oscam_config_serial(vars, params); 777 #endif 753 778 #ifdef WITH_LB 754 779 else if (!strcmp(part,"loadbalancer")) return send_oscam_config_loadbalancer(vars, params); … … 800 825 inactivate_reader(rdr); 801 826 ll_remove(configured_readers, rdr); 802 827 803 828 free_reader(rdr); 804 829 … … 897 922 tpl_addVar(vars, TPLAPPEND, "ADDPROTOCOL", "<option>pcsc</option>\n"); 898 923 #endif 924 #ifdef MODULE_CAMD33 925 tpl_addVar(vars, TPLAPPEND, "ADDPROTOCOL", "<option>camd33</option>\n"); 926 #endif 927 #ifdef MODULE_CAMD35 928 tpl_addVar(vars, TPLAPPEND, "ADDPROTOCOL", "<option>camd35</option>\n"); 929 #endif 930 #ifdef MODULE_CAMD35_TCP 931 tpl_addVar(vars, TPLAPPEND, "ADDPROTOCOL", "<option>cs378x</option>\n"); 932 #endif 933 #ifdef MODULE_NEWCAMD 934 tpl_addVar(vars, TPLAPPEND, "ADDPROTOCOL", "<option>newcamd</option>\n"); 935 tpl_addVar(vars, TPLAPPEND, "ADDPROTOCOL", "<option>newcamd524</option>\n"); 936 #endif 937 #ifdef MODULE_CCCAM 938 tpl_addVar(vars, TPLAPPEND, "ADDPROTOCOL", "<option>cccam</option>\n"); 939 #endif 940 #ifdef MODULE_GBOX 941 tpl_addVar(vars, TPLAPPEND, "ADDPROTOCOL", "<option>gbox</option>\n"); 942 #endif 943 #ifdef MODULE_RADEGAST 944 tpl_addVar(vars, TPLAPPEND, "ADDPROTOCOL", "<option>radegast</option>\n"); 945 #endif 946 #ifdef MODULE_SERIAL 947 tpl_addVar(vars, TPLAPPEND, "ADDPROTOCOL", "<option>serial</option>\n"); 948 #endif 949 #ifdef MODULE_CONSTCW 950 tpl_addVar(vars, TPLAPPEND, "ADDPROTOCOL", "<option>constcw</option>\n"); 951 #endif 899 952 900 953 for (i=0; i<CS_MAX_MOD; i++) { … … 1085 1138 else 1086 1139 tpl_addVar(vars, TPLADD, "DETECT", RDR_CD_TXT[rdr->detect&0x7f]); 1087 1140 1088 1141 // Ratelimit 1089 1142 if(rdr->ratelimitecm){ … … 1423 1476 1424 1477 if (rdr->lb_stat) { 1425 1478 1426 1479 // @todo alno: sort by click, 0=ascending, 1=descending (maybe two buttons or reverse on second click) 1427 1480 sort_stat(rdr, 0); 1428 1481 1429 1482 LL_ITER it = ll_iter_create(rdr->lb_stat); 1430 1483 READER_STAT *stat = ll_iter_next(&it); … … 1580 1633 chk_account("services", servicelabels, account); 1581 1634 tpl_addVar(vars, TPLAPPEND, "MESSAGE", "<B>Account updated</B><BR><BR>"); 1582 1635 1583 1636 refresh_oscam(REFR_CLIENTS); 1584 1637 … … 1689 1742 tpl_addVar(vars, TPLADD, "CHIDS", value); 1690 1743 free_mk_t(value); 1691 1744 1692 1745 //class 1693 1746 value = mk_t_cltab(&account->cltab); … … 1769 1822 } else { 1770 1823 struct s_auth *account_prev = NULL; 1771 1824 1772 1825 for(account = cfg.account; (account); account = account->next){ 1773 1826 if(strcmp(account->usr, user) == 0) { … … 2016 2069 /* build entitlements from reader init history */ 2017 2070 char *reader_ = getParam(params, "label"); 2018 #ifdef MODULE_CCCAM 2071 #ifdef MODULE_CCCAM 2019 2072 char *sharelist_ = getParam(params, "globallist"); 2020 2073 int32_t show_global_list = sharelist_ && sharelist_[0]=='1'; 2021 2074 2022 2075 int32_t offset = atoi(getParam(params, "offset")); //should be 0 if parameter is missed on very first call 2023 2076 2024 2077 struct s_reader *rdr = get_reader_by_label(getParam(params, "label")); 2025 2078 if (show_global_list || (cfg.saveinithistory && strlen(reader_) > 0) || rdr->typ == R_CCCAM) { … … 2068 2121 // @todo alno: sort by click, 0=ascending, 1=descending (maybe two buttons or reverse on second click) 2069 2122 sort_cards_by_hop(cards, 0); 2070 2123 2071 2124 LL_ITER it = ll_iter_create(cards); 2072 2125 int32_t offset2 = offset+1; … … 2077 2130 break; 2078 2131 count++; 2079 2132 2080 2133 if (!apicall) { 2081 2134 if (show_global_list) … … 2189 2242 cardcount++; 2190 2243 } 2191 2244 2192 2245 // set previous Link if needed 2193 2246 if (offset >= ENTITLEMENT_PAGE_SIZE) { … … 2357 2410 user_count_active++; 2358 2411 tpl_addVar(vars, TPLADD, "CLIENTTYPE", "a"); 2359 } else tpl_addVar(vars, TPLADD, "CLIENTTYPE", "c"); 2412 } else tpl_addVar(vars, TPLADD, "CLIENTTYPE", "c"); 2360 2413 } else { 2361 2414 if (cl->typ=='r' && cl->reader->card_status==CARD_INSERTED) … … 2363 2416 else if (cl->typ=='p' && (cl->reader->card_status==CARD_INSERTED ||cl->reader->tcp_connected)) 2364 2417 proxy_count_conn++; 2365 tpl_printf(vars, TPLADD, "CLIENTTYPE", "%c", cl->typ); 2418 tpl_printf(vars, TPLADD, "CLIENTTYPE", "%c", cl->typ); 2366 2419 } 2367 2420 if(cl->typ == 'c' || cl->typ == 'r' || cl->typ == 'p'){ … … 2431 2484 tpl_printf(vars, TPLADD, "CLIENTCNR", "%d", get_threadnum(cl)); 2432 2485 tpl_addVar(vars, TPLADD, "CLIENTUSER", xml_encode(vars, usr)); 2433 2486 2434 2487 if(cl->typ == 'c') { 2435 2488 tpl_addVar(vars, TPLADD, "CLIENTDESCRIPTION", xml_encode(vars, cl->account?cl->account->description:"")); … … 2438 2491 tpl_addVar(vars, TPLADD, "CLIENTDESCRIPTION", xml_encode(vars, cl->reader->description)); 2439 2492 } 2440 2493 2441 2494 tpl_printf(vars, TPLADD, "CLIENTCAU", "%d", cau); 2442 2495 if(!apicall){ … … 2570 2623 2571 2624 if ((cl->typ == 'r') && (!apicall))//reader 2572 { 2625 { 2573 2626 struct s_reader *rdr = cl->reader; 2574 2627 if (rdr->ll_entitlements) … … 2580 2633 time_t now = (time((time_t)0)/84600)*84600; 2581 2634 struct tm end_t; 2582 2635 2583 2636 tpl_printf(vars, TPLADD, "TMPSPAN", "<SPAN>"); 2584 2637 2585 2638 while((ent = ll_iter_next(&itr))) 2586 2639 { 2587 2640 total_ent++; 2588 2641 if (ent->end > now) 2589 { 2642 { 2590 2643 if (active_ent) tpl_printf(vars, TPLAPPEND, "TMPSPAN", "<BR><BR>"); 2591 2644 active_ent++; 2592 2645 localtime_r(&ent->end, &end_t); 2593 2646 tpl_printf(vars, TPLAPPEND, "TMPSPAN", "%04X:%06X<BR>exp:%04d/%02d/%02d", 2594 ent->caid, ent->provid, 2647 ent->caid, ent->provid, 2595 2648 end_t.tm_year + 1900, end_t.tm_mon + 1, end_t.tm_mday); 2596 2649 } 2597 2650 } 2598 2651 2599 2652 if (((total_ent) && (active_ent == 0)) || (total_ent == 0)) 2600 2653 { 2601 2654 tpl_printf(vars, TPLAPPEND, "TMPSPAN", "No active entitlements found"); 2602 2655 } 2603 2656 2604 2657 tpl_printf(vars, TPLAPPEND, "TMPSPAN", "</SPAN>"); 2605 2658 2606 2659 if (active_ent) 2607 2660 { … … 2611 2664 { 2612 2665 tpl_printf(vars, TPLADD, "TMP", "(no entitlements)"); 2613 2666 2614 2667 } 2615 2668 2616 2669 tpl_printf(vars, TPLAPPEND, "CLIENTCON", " <A HREF=\"entitlements.html?label=%s\" class=\"tooltip%s\">%s%s</A>", 2617 2670 urlencode(vars, cl->reader->label), … … 2704 2757 d++; 2705 2758 } 2706 2759 2707 2760 if (d && ((ptr1 >= t_loghistptr) || (l1 < 2))) 2708 2761 break; … … 2787 2840 tpl_addVar(vars, TPLAPPEND, "MESSAGE", "<b>New service has been added</b><BR>"); 2788 2841 // Adding is uncritical as the new service is appended to sidtabok/sidtabno and accounts/clients/readers have zeros there 2789 if (write_services()!=0) 2842 if (write_services()!=0) 2790 2843 tpl_addVar(vars, TPLAPPEND, "MESSAGE", "<b>Writing services to disk failed!</b><BR>"); 2791 2844 } … … 2853 2906 int32_t sidtablength = -1; 2854 2907 sidtab=cfg.sidtab; 2855 2908 2856 2909 // Calculate sidtablength before deletion so that updating sidtabs is faster 2857 2910 for (sidtab=cfg.sidtab; sidtab; sidtab = sidtab->next) 2858 2911 ++sidtablength; 2859 2912 2860 2913 for (sidtab=cfg.sidtab; sidtab; sidtab = sidtab->next){ 2861 2914 if(strcmp(sidtab->label, service) == 0) { 2862 2915 struct s_auth *account; 2863 2916 struct s_client *cl; 2864 struct s_reader *rdr; 2865 2917 struct s_reader *rdr; 2918 2866 2919 if(sidtab_prev == NULL) 2867 2920 cfg.sidtab = sidtab->next; 2868 2921 else 2869 sidtab_prev->next = sidtab->next; 2922 sidtab_prev->next = sidtab->next; 2870 2923 free_sidtab(sidtab); 2871 2924 2872 2925 for (account = cfg.account; (account); account = account->next) { 2873 2926 delete_from_SIDTABBITS(&account->sidtabok, counter, sidtablength); 2874 2927 delete_from_SIDTABBITS(&account->sidtabno, counter, sidtablength); 2875 2928 } 2876 2929 2877 2930 for (cl=first_client->next; cl ; cl=cl->next){ 2878 2931 if(account == cl->account){ … … 2881 2934 } 2882 2935 } 2883 2936 2884 2937 LL_ITER itr = ll_iter_create(configured_readers); 2885 2938 while((rdr = ll_iter_next(&itr))){ … … 2894 2947 if (counter > 0) { 2895 2948 tpl_addVar(vars, TPLAPPEND, "MESSAGE", "<b>Service has been deleted!</b><BR>"); 2896 if (write_services() != 0) 2949 if (write_services() != 0) 2897 2950 tpl_addVar(vars, TPLAPPEND, "MESSAGE", "<b>Writing services to disk failed!</b><BR>"); 2898 2951 } else tpl_addVar(vars, TPLAPPEND, "MESSAGE", "<b>Sorry but the specified service doesn't exist. No deletion will be made!</b><BR>"); … … 3358 3411 int32_t isec; 3359 3412 int32_t shown; 3360 time_t now = time((time_t)0); 3413 time_t now = time((time_t)0); 3361 3414 char *usr; 3362 3415 struct s_client *cl; … … 3364 3417 if (cl->wihidden != 1) { 3365 3418 isec = now - cl->lastecm; 3366 usr=username(cl); 3419 usr=username(cl); 3367 3420 shown = 0; 3368 3421 if (strcmp(getParam(params, "label"),"") == 0) { … … 3388 3441 tpl_printf(vars, TPLADD, "CLIENTLASTRESPONSETIME", "%d", cl->cwlastresptime?cl->cwlastresptime:-1); 3389 3442 tpl_printf(vars, TPLADD, "CLIENTIDLESECS", "%d", isec); 3390 3443 3391 3444 //load historical values from ringbuffer 3392 3445 char *value = get_ecm_fullhistorystring(cl); 3393 3446 tpl_printf(vars, TPLADD, "CLIENTLASTRESPONSETIMEHIST", "%s", value); 3394 3447 free_mk_t(value); 3395 3448 3396 3449 tpl_addVar(vars, TPLAPPEND, "APISTATUSBITS", tpl_getTpl(vars, "APISTATUSBIT")); 3397 3450 } 3398 3451 } 3399 3452 } 3400 return tpl_getTpl(vars, "APISTATUS"); 3453 return tpl_getTpl(vars, "APISTATUS"); 3401 3454 #ifdef WITH_LB 3402 3455 } else if (strcmp(getParam(params, "part"), "readerstats") == 0) { … … 3448 3501 if(strlen(tpl_getTplPath(wanted, cfg.http_tpl, path, 255)) > 0 && file_exists(path)){ 3449 3502 struct stat st; 3450 disktpl = 1; 3503 disktpl = 1; 3451 3504 stat(path, &st); 3452 3505 if(st.st_mtime < modifiedheader){ … … 3587 3640 } 3588 3641 3589 static int32_t process_request(FILE *f, struct in_addr in) { 3642 static int32_t process_request(FILE *f, struct in_addr in) { 3590 3643 int32_t ok=0,v=cv(); 3591 3644 int8_t *keepalive = (int8_t *)pthread_getspecific(getkeepalive); 3592 3645 in_addr_t addr = GET_IP(); 3593 3646 3594 3647 do { 3595 3648 #ifdef WITH_SSL … … 3599 3652 #endif 3600 3653 ok = check_ip(cfg.http_allowed, addr) ? v : 0; 3601 3654 3602 3655 if (!ok && cfg.http_dyndns[0]) { 3603 3656 cs_debug_mask(D_TRACE, "WebIf: IP not found in allowed range - test dyndns"); 3604 3657 3605 3658 if(cfg.http_dynip && cfg.http_dynip == addr) { 3606 3659 ok = v; 3607 cs_debug_mask(D_TRACE, "WebIf: dyndns address previously resolved and ok"); 3660 cs_debug_mask(D_TRACE, "WebIf: dyndns address previously resolved and ok"); 3608 3661 } else { 3609 3662 cfg.http_dynip = cs_getIPfromHost((char*)cfg.http_dyndns); … … 3616 3669 cs_debug_mask(D_TRACE, "WebIf: IP found in allowed range - bypass dyndns"); 3617 3670 } 3618 3671 3619 3672 if (!ok) { 3620 3673 send_error(f, 403, "Forbidden", NULL, "Access denied.", 0); … … 3622 3675 return 0; 3623 3676 } 3624 3677 3625 3678 int32_t authok = 0; 3626 3679 char expectednonce[(MD5_DIGEST_LENGTH * 2) + 1]; 3627 3680 3628 3681 char *method, *path, *protocol, *str1, *saveptr1=NULL, *authheader = NULL, *filebuf = NULL; 3629 3682 char *pch, *tmp, *buf; … … 3653 3706 "/graph.svg", 3654 3707 "/oscamapi.xml"}; 3655 3708 3656 3709 int32_t pagescnt = sizeof(pages)/sizeof(char *); // Calculate the amount of items in array 3657 3710 int32_t i, bufsize, len, pgidx = -1; … … 3660 3713 params.paramcount = 0; 3661 3714 time_t modifiedheader = 0; 3662 3715 3663 3716 bufsize = readRequest(f, in, &filebuf, 0); 3664 3717 3665 3718 if (!filebuf || bufsize < 1) { 3666 3719 if(!*keepalive) cs_debug_mask(D_CLIENT, "WebIf: No data received from client %s. Closing connection.", cs_inet_ntoa(addr)); 3667 3720 return -1; 3668 3721 } 3669 3722 3670 3723 buf=filebuf; 3671 3724 3672 3725 if((method = strtok_r(buf, " ", &saveptr1)) != NULL){ 3673 3726 if((path = strtok_r(NULL, " ", &saveptr1)) != NULL){ … … 3685 3738 } 3686 3739 tmp=protocol+strlen(protocol)+2; 3687 3740 3688 3741 pch=path; 3689 3742 /* advance pointer to beginning of query string */ … … 3693 3746 ++pch; 3694 3747 } 3695 3748 3696 3749 /* Map page to our static page definitions */ 3697 3750 for (i=0; i<pagescnt; i++) { 3698 3751 if (!strcmp(path, pages[i])) pgidx = i; 3699 3752 } 3700 3753 3701 3754 parseParams(¶ms, pch); 3702 3755 3703 3756 if(strlen(cfg.http_user) == 0 || strlen(cfg.http_pwd) == 0) authok = 1; 3704 3757 else calculate_nonce(expectednonce); 3705 3758 3706 3759 for (str1=strtok_r(tmp, "\n", &saveptr1); str1; str1=strtok_r(NULL, "\n", &saveptr1)) { 3707 3760 len = strlen(str1); … … 3731 3784 } 3732 3785 } 3733 3786 3734 3787 if(authok != 1) { 3735 3788 if(authok == 2) … … 3749 3802 else return 0; 3750 3803 } else NULLFREE(authheader); 3751 3804 3752 3805 /*build page*/ 3753 3806 if(pgidx == 8) { … … 3765 3818 struct tm lt, st; 3766 3819 time(&t); 3767 3820 3768 3821 localtime_r(&t, <); 3769 3822 3770 3823 tpl_addVar(vars, TPLADD, "CS_VERSION", CS_VERSION); 3771 3824 tpl_addVar(vars, TPLADD, "CS_SVN_VERSION", CS_SVN_VERSION); … … 3775 3828 tpl_addVar(vars, TPLADD, "REFRESH", tpl_getTpl(vars, "REFRESH")); 3776 3829 } 3777 3830 3778 3831 tpl_printf(vars, TPLADD, "CURDATE", "%02d.%02d.%02d", lt.tm_mday, lt.tm_mon+1, lt.tm_year%100); 3779 3832 tpl_printf(vars, TPLADD, "CURTIME", "%02d:%02d:%02d", lt.tm_hour, lt.tm_min, lt.tm_sec); … … 3782 3835 tpl_printf(vars, TPLADD, "STARTTIME", "%02d:%02d:%02d", st.tm_hour, st.tm_min, st.tm_sec); 3783 3836 tpl_printf(vars, TPLADD, "PROCESSID", "%d", server_pid); 3784 3837 3785 3838 time_t now = time((time_t)0); 3786 3839 // XMLAPI … … 3792 3845 tpl_printf(vars, TPLADD, "APIREADONLY", "%d", cfg.http_readonly); 3793 3846 } 3794 3847 3795 3848 // language code in helplink 3796 3849 if (cfg.http_help_lang[0]) … … 3798 3851 else 3799 3852 tpl_addVar(vars, TPLADD, "LANGUAGE", "en"); 3800 3853 3801 3854 tpl_addVar(vars, TPLADD, "UPTIME", sec2timeformat(vars, (now - first_client->login))); 3802 3855 tpl_addVar(vars, TPLADD, "CURIP", cs_inet_ntoa(addr)); 3803 3856 if(cfg.http_readonly) 3804 3857 tpl_addVar(vars, TPLAPPEND, "BTNDISABLED", "DISABLED"); 3805 3858 3806 3859 char *result = NULL; 3807 3808 // WebIf allows modifying many things. Thus, all pages except images/css are excpected to be non-threadsafe! 3860 3861 // WebIf allows modifying many things. Thus, all pages except images/css are excpected to be non-threadsafe! 3809 3862 if(pgidx != 19 && pgidx != 20) cs_writelock(&http_lock); 3810 3863 switch(pgidx) { … … 3837 3890 } 3838 3891 if(pgidx != 19 && pgidx != 20) cs_writeunlock(&http_lock); 3839 3892 3840 3893 if(result == NULL || !strcmp(result, "0") || strlen(result) == 0) send_error500(f); 3841 3894 else if (strcmp(result, "1")) { … … 3904 3957 f = fdopen(s, "r+"); 3905 3958 if(f != NULL) { 3906 char *ptr, *filebuf = NULL, *host = NULL; 3959 char *ptr, *filebuf = NULL, *host = NULL; 3907 3960 int32_t bufsize = readRequest(f, in, &filebuf, 1); 3908 3909 if (filebuf) { 3961 3962 if (filebuf) { 3910 3963 filebuf[bufsize]='\0'; 3911 3964 host = strstr(filebuf, "Host: "); … … 3963 4016 /* Create random string for nonce value generation */ 3964 4017 create_rand_str(noncekey,32); 3965 4018 3966 4019 cs_lock_create(&http_lock, 10, "http_lock"); 3967 4020 … … 4047 4100 } 4048 4101 else 4049 pthread_detach(workthread); 4102 pthread_detach(workthread); 4050 4103 pthread_attr_destroy(&attr); 4051 4104 } -
tags/1.10/oscam-http.h
r5775 r5813 874 874 services(##SRVIDNUM##)=##SRVIDS##<BR><BR>\n" 875 875 876 //#ifdef MODULE_SERIAL 877 876 878 #define TPLREADERS "\ 877 879 ##TPLHEADER##\ … … 902 904 <option>internal</option>\n\ 903 905 <option>sc8in1</option>\n\ 904 <option>serial</option>\n\905 <option>camd35</option>\n\906 <option>cs378x</option>\n\907 <option>radegast</option>\n\908 <option>newcamd</option>\n\909 <option>newcamd524</option>\n\910 <option>cccam</option>\n\911 <option>constcw</option>\n\912 906 ##ADDPROTOCOL##\n\ 913 907 </select>\n\ … … 918 912 </form>\n\ 919 913 ##TPLFOOTER##" 914 915 916 917 920 918 921 919 #define TPLREADERSBIT "\
Note:
See TracChangeset
for help on using the changeset viewer.