--- parser3/src/classes/op.C 2017/01/17 23:53:27 1.250 +++ parser3/src/classes/op.C 2020/06/27 09:45:49 1.255 @@ -1,7 +1,7 @@ /** @file Parser: parser @b operators. - Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ @@ -18,7 +18,7 @@ #include "pa_vclass.h" #include "pa_charset.h" -volatile const char * IDENT_OP_C="$Id: op.C,v 1.250 2017/01/17 23:53:27 moko Exp $"; +volatile const char * IDENT_OP_C="$Id: op.C,v 1.255 2020/06/27 09:45:49 moko Exp $"; // defines @@ -333,7 +333,7 @@ static void _continue(Request& r, Method static void _return(Request& r, MethodParams& params) { VMethodFrame& caller=*r.get_method_frame()->caller(); if(params.count()) - r.put_element(caller, Symbols::RESULT_SYMBOL, ¶ms[0]); + r.put_element(caller, Symbols::RESULT_SYMBOL, &r.process(params[0])); r.set_skip_return(caller); } @@ -704,20 +704,13 @@ struct Cache_get_result { static Cache_get_result cache_get(Request_charsets& charsets, const String& file_spec, time_t now) { Cache_get_result result={0, false}; - File_read_result file=file_read(charsets, file_spec, - false/*as_text*/, - 0, //no params - false/*fail_on_read_problem*/); - if(file.success && file.length/* ignore reads which are empty due to - non-unary open+lockEX conflict with lockSH */) { - - Data_string_serialized_prolog& prolog= - *reinterpret_cast(file.str); - + File_read_result file=file_read_binary(file_spec, false /*fail_on_read_problem*/); + if(file.success && file.length /*ignore reads which are empty due to non-unary open+lockEX conflict with lockSH*/) { + + Data_string_serialized_prolog& prolog = *reinterpret_cast(file.str); + String* body=new String; - if( - file.length>=sizeof(Data_string_serialized_prolog) - && prolog.version==DATA_STRING_SERIALIZED_VERSION) { + if(file.length>=sizeof(Data_string_serialized_prolog) && prolog.version==DATA_STRING_SERIALIZED_VERSION) { if(body->deserialize(sizeof(Data_string_serialized_prolog), file.str, file.length)) { result.body=body; result.expired=prolog.expires <= now; @@ -727,8 +720,8 @@ static Cache_get_result cache_get(Reques return result; } -static time_t as_expires(Request& r, MethodParams& params, - int index, time_t now) { + +static time_t as_expires(Request& r, MethodParams& params, int index, time_t now) { time_t result; if(Value* vdate=params[index].as(VDATE_TYPE)) result=(time_t)(static_cast(vdate)->get_time()); @@ -899,7 +892,7 @@ static void _sleep_operator(Request& r, pa_sleep((int)trunc(seconds), (int)trunc((seconds-trunc(seconds))*1000000)); } -#if defined(WIN32) && defined(_DEBUG) +#if defined(WIN32) && defined(_DEBUG) && !defined(_WIN64) # define PA_BPT static void _bpt(Request&, MethodParams&) { _asm int 3;