--- parser3/src/main/pa_request.C 2025/05/26 01:56:54 1.435 +++ parser3/src/main/pa_request.C 2026/05/24 14:16:27 1.440 @@ -1,7 +1,7 @@ /** @file Parser: request class main part. @see compile.C and execute.C. - Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com) Authors: Konstantin Morshnev , Alexandr Petrosian */ @@ -35,7 +35,7 @@ #include "pa_vdate.h" #include "pa_varray.h" -volatile const char * IDENT_PA_REQUEST_C="$Id: pa_request.C,v 1.435 2025/05/26 01:56:54 moko Exp $" IDENT_PA_REQUEST_H IDENT_PA_REQUEST_CHARSETS_H IDENT_PA_REQUEST_INFO_H IDENT_PA_VCONSOLE_H; +volatile const char * IDENT_PA_REQUEST_C="$Id: pa_request.C,v 1.440 2026/05/24 14:16:27 moko Exp $" IDENT_PA_REQUEST_H IDENT_PA_REQUEST_CHARSETS_H IDENT_PA_REQUEST_INFO_H IDENT_PA_VCONSOLE_H; // consts @@ -250,12 +250,11 @@ VStateless_class& Request::get_class_ref } bool Request::add_class(const char* atype, VStateless_class *aclass){ - if(!allow_class_replace){ - if(!classes().put_dont_replace(String::Body(atype), aclass)) - return true; - if(strcmp(atype, VARRAY_TYPE)) - return false; - } + if(!classes().put_dont_replace(String::Body(atype), aclass)) + return true; + if(!allow_class_replace && strcmp(atype, VARRAY_TYPE)) + return false; + classes().remove(String::Body(atype)); classes().put(atype, aclass); return true; } @@ -463,9 +462,6 @@ void Request::configure() { if(!configure_admin_done) configure_admin(main_class); - // configure not-admin=user options - methoded_array().configure_user(*this); - // $MAIN:MIME-TYPES if(Value* element=main_class.get_element(mime_types_name)) if(Table *table=element->get_table()) @@ -807,7 +803,7 @@ static void parse_range(const String* s, if(*p >= '0' && *p <= '9'){ const char *n=p; while(*p>='0' && *p<='9') p++; - r.start = pa_atoul(pa_strdup(n, p-n)); + r.start = pa_atoul(pa_strdup(n, p-n)); // ((uint64_t)-1) is treated as UNSET } while(*p==' ' || *p=='\t') p++; @@ -819,7 +815,7 @@ static void parse_range(const String* s, if(*p >= '0' && *p <= '9'){ const char *n=p; while(*p>='0' && *p<='9') p++; - r.end = pa_atoul(pa_strdup(n, p-n)); + r.end = pa_atoul(pa_strdup(n, p-n)); // ((uint64_t)-1) is treated as UNSET } while(*p==' ' || *p=='\t') p++; @@ -877,6 +873,8 @@ static void output_pieces(Request& r, bo return SAPI::send_error(r.sapi_info, "", "416"); if(rg.start == UNSET && rg.end != UNSET){ + if(rg.end == 0) + return SAPI::send_error(r.sapi_info, "", "416"); if(rg.end > content_length) rg.end = content_length; rg.start = content_length - rg.end;