diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcommon/llkeythrottle.h | 2 | ||||
-rw-r--r-- | indra/llcommon/llversionserver.h | 4 | ||||
-rw-r--r-- | indra/llmessage/lliosocket.cpp | 3 | ||||
-rw-r--r-- | indra/lscript/lscript_execute.h | 45 | ||||
-rw-r--r-- | indra/lscript/lscript_execute/lscript_execute.cpp | 73 |
5 files changed, 74 insertions, 53 deletions
diff --git a/indra/llcommon/llkeythrottle.h b/indra/llcommon/llkeythrottle.h index ac2f4254f2..7bbf2ad616 100644 --- a/indra/llcommon/llkeythrottle.h +++ b/indra/llcommon/llkeythrottle.h @@ -243,7 +243,7 @@ public: } // Set the throttling behavior - void setParameters( U32 limit, F32 interval, BOOL realtime ) + void setParameters( U32 limit, F32 interval, BOOL realtime = TRUE ) { // limit is the maximum number of keys // allowed per interval (in seconds or frames) diff --git a/indra/llcommon/llversionserver.h b/indra/llcommon/llversionserver.h index fd5f6497c2..efd611090c 100644 --- a/indra/llcommon/llversionserver.h +++ b/indra/llcommon/llversionserver.h @@ -34,8 +34,8 @@ const S32 LL_VERSION_MAJOR = 1; const S32 LL_VERSION_MINOR = 24; -const S32 LL_VERSION_PATCH = 0; -const S32 LL_VERSION_BUILD = 93453; +const S32 LL_VERSION_PATCH = 6; +const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Server"; diff --git a/indra/llmessage/lliosocket.cpp b/indra/llmessage/lliosocket.cpp index ad309434ac..5f756e9cc2 100644 --- a/indra/llmessage/lliosocket.cpp +++ b/indra/llmessage/lliosocket.cpp @@ -355,8 +355,11 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl( } else if(APR_STATUS_IS_EAGAIN(status)) { +/*Commented out by Aura 9-9-8 for DEV-19961. // everything is fine, but we can terminate this process pump. + rv = STATUS_BREAK; +*/ } else { diff --git a/indra/lscript/lscript_execute.h b/indra/lscript/lscript_execute.h index 271b53aae1..2f67e77c93 100644 --- a/indra/lscript/lscript_execute.h +++ b/indra/lscript/lscript_execute.h @@ -370,7 +370,7 @@ public: LLScriptExecute(); virtual ~LLScriptExecute() {;} - virtual S32 getVersion() = 0; + virtual S32 getVersion() const = 0; virtual void deleteAllEvents() = 0; virtual void addEvent(LLScriptDataCollection* event) = 0; virtual U32 getEventCount() = 0; @@ -384,12 +384,12 @@ public: virtual void setSleep(F32 value) = 0; virtual F32 getEnergy() const = 0; virtual void setEnergy(F32 value) = 0; - virtual U64 getCurrentEvents(S32 version) = 0; - virtual void setCurrentEvents(U64 value, S32 version) = 0; - virtual U64 getEventHandlers(S32 version) = 0; - virtual void setEventHandlers(U64 value, S32 version) = 0; - virtual U64 getCurrentHandler(S32 version) = 0; - virtual void setCurrentHandler(U64 value, S32 version) = 0; + virtual U64 getCurrentEvents() = 0; + virtual void setCurrentEvents(U64 value) = 0; + virtual U64 getEventHandlers() = 0; + virtual void setEventHandlers(U64 value) = 0; + virtual U64 getCurrentHandler() = 0; + virtual void setCurrentHandler(U64 value) = 0; virtual BOOL isFinished() const = 0; virtual BOOL isStateChangePending() const = 0; virtual S32 writeState(U8 **dest, U32 header_size, U32 footer_size) = 0; // Allocate memory for header, state and footer return size of state. @@ -409,17 +409,17 @@ public: // Run handler for event for a maximum of time_slice seconds. // Updates current handler and current events registers. - virtual void callEventHandler(LSCRIPTStateEventType event, S32 major_version, const LLUUID &id, F32 time_slice) = 0;; + virtual void callEventHandler(LSCRIPTStateEventType event, const LLUUID &id, F32 time_slice) = 0;; // Run handler for next queued event for maximum of time_slice seconds. // Updates current handler and current events registers. // Removes processed event from queue. - virtual void callNextQueuedEventHandler(U64 event_register, S32 major_version, const LLUUID &id, F32 time_slice) = 0; + virtual void callNextQueuedEventHandler(U64 event_register, const LLUUID &id, F32 time_slice) = 0; // Run handler for event for a maximum of time_slice seconds. // Updates current handler and current events registers. // Removes processed event from queue. - virtual void callQueuedEventHandler(LSCRIPTStateEventType event, S32 major_version, const LLUUID &id, F32 time_slice) = 0; + virtual void callQueuedEventHandler(LSCRIPTStateEventType event, const LLUUID &id, F32 time_slice) = 0; // Switch to next state. // Returns new set of handled events. @@ -428,14 +428,14 @@ public: // Returns time taken. virtual F32 runQuanta(BOOL b_print, const LLUUID &id, const char **errorstr, - BOOL &state_transition, F32 quanta, + F32 quanta, U32& events_processed, LLTimer& timer); // Run smallest possible amount of code: an instruction for LSL2, a segment // between save tests for Mono void runInstructions(BOOL b_print, const LLUUID &id, const char **errorstr, - BOOL &state_transition, U32& events_processed, + U32& events_processed, F32 quanta); bool isYieldDue() const; @@ -461,7 +461,7 @@ public: LLScriptExecuteLSL2(const U8* bytecode, U32 bytecode_size); virtual ~LLScriptExecuteLSL2(); - virtual S32 getVersion() {return get_register(mBuffer, LREG_VN);} + virtual S32 getVersion() const {return get_register(mBuffer, LREG_VN);} virtual void deleteAllEvents() {mEventData.mEventDataList.deleteAllData();} virtual void addEvent(LLScriptDataCollection* event); virtual U32 getEventCount() {return mEventData.mEventDataList.getLength();} @@ -475,12 +475,12 @@ public: virtual void setSleep(F32 value); virtual F32 getEnergy() const; virtual void setEnergy(F32 value); - virtual U64 getCurrentEvents(S32 version) {return get_event_register(mBuffer, LREG_CE, version);} - virtual void setCurrentEvents(U64 value, S32 version) {return set_event_register(mBuffer, LREG_CE, value, version);} - virtual U64 getEventHandlers(S32 version) {return get_event_register(mBuffer, LREG_ER, version);} - virtual void setEventHandlers(U64 value, S32 version) {set_event_register(mBuffer, LREG_ER, value, version);} - virtual U64 getCurrentHandler(S32 version); - virtual void setCurrentHandler(U64 value, S32 version) {return set_event_register(mBuffer, LREG_IE, value, version);} + virtual U64 getCurrentEvents() {return get_event_register(mBuffer, LREG_CE, getMajorVersion());} + virtual void setCurrentEvents(U64 value) {return set_event_register(mBuffer, LREG_CE, value, getMajorVersion());} + virtual U64 getEventHandlers() {return get_event_register(mBuffer, LREG_ER, getMajorVersion());} + virtual void setEventHandlers(U64 value) {set_event_register(mBuffer, LREG_ER, value, getMajorVersion());} + virtual U64 getCurrentHandler(); + virtual void setCurrentHandler(U64 value) {return set_event_register(mBuffer, LREG_IE, value, getMajorVersion());} virtual BOOL isFinished() const {return get_register(mBuffer, LREG_IP) == 0;} virtual BOOL isStateChangePending() const {return get_register(mBuffer, LREG_CS) != get_register(mBuffer, LREG_NS);} virtual S32 writeState(U8 **dest, U32 header_size, U32 footer_size); // Not including Events. @@ -500,17 +500,17 @@ public: // Run handler for event for a maximum of time_slice seconds. // Updates current handler and current events registers. - virtual void callEventHandler(LSCRIPTStateEventType event, S32 major_version, const LLUUID &id, F32 time_slice); + virtual void callEventHandler(LSCRIPTStateEventType event, const LLUUID &id, F32 time_slice); // Run handler for next queued event for maximum of time_slice seconds. // Updates current handler and current events registers. // Removes processed event from queue. - virtual void callNextQueuedEventHandler(U64 event_register, S32 major_version, const LLUUID &id, F32 time_slice); + virtual void callNextQueuedEventHandler(U64 event_register, const LLUUID &id, F32 time_slice); // Run handler for event for a maximum of time_slice seconds. // Updates current handler and current events registers. // Removes processed event from queue. - virtual void callQueuedEventHandler(LSCRIPTStateEventType event, S32 major_version, const LLUUID &id, F32 time_slice); + virtual void callQueuedEventHandler(LSCRIPTStateEventType event, const LLUUID &id, F32 time_slice); // Switch to next state. // Returns new set of handled events. @@ -527,6 +527,7 @@ public: U32 mBytecodeSize; private: + S32 getMajorVersion() const; void recordBoundaryError( const LLUUID &id ); void setStateEventOpcoodeStartSafely( S32 state, LSCRIPTStateEventType event, const LLUUID &id ); diff --git a/indra/lscript/lscript_execute/lscript_execute.cpp b/indra/lscript/lscript_execute/lscript_execute.cpp index 6f1c2158d5..52e3af320c 100644 --- a/indra/lscript/lscript_execute/lscript_execute.cpp +++ b/indra/lscript/lscript_execute/lscript_execute.cpp @@ -330,8 +330,9 @@ void LLScriptExecuteLSL2::resumeEventHandler(BOOL b_print, const LLUUID &id, F32 // NOTE: Babbage: all mExecuteFuncs return false. } -void LLScriptExecuteLSL2::callEventHandler(LSCRIPTStateEventType event, S32 major_version, const LLUUID &id, F32 time_slice) +void LLScriptExecuteLSL2::callEventHandler(LSCRIPTStateEventType event, const LLUUID &id, F32 time_slice) { + S32 major_version = getMajorVersion(); // push a zero to be popped lscript_push(mBuffer, 0); // push sp as current bp @@ -406,8 +407,9 @@ void LLScriptExecuteLSL2::callEventHandler(LSCRIPTStateEventType event, S32 majo // set_ip(mBuffer, opcode_start); //} -void LLScriptExecuteLSL2::callQueuedEventHandler(LSCRIPTStateEventType event, S32 major_version, const LLUUID &id, F32 time_slice) +void LLScriptExecuteLSL2::callQueuedEventHandler(LSCRIPTStateEventType event, const LLUUID &id, F32 time_slice) { + S32 major_version = getMajorVersion(); LLScriptDataCollection* eventdata; for (eventdata = mEventData.mEventDataList.getFirstData(); eventdata; eventdata = mEventData.mEventDataList.getNextData()) @@ -455,8 +457,9 @@ void LLScriptExecuteLSL2::callQueuedEventHandler(LSCRIPTStateEventType event, S3 } } -void LLScriptExecuteLSL2::callNextQueuedEventHandler(U64 event_register, S32 major_version, const LLUUID &id, F32 time_slice) +void LLScriptExecuteLSL2::callNextQueuedEventHandler(U64 event_register, const LLUUID &id, F32 time_slice) { + S32 major_version = getMajorVersion(); LLScriptDataCollection* eventdata = mEventData.getNextEvent(); if (eventdata) { @@ -544,9 +547,9 @@ void LLScriptExecuteLSL2::setSleep(F32 value) } //virtual -U64 LLScriptExecuteLSL2::getCurrentHandler(S32 version) +U64 LLScriptExecuteLSL2::getCurrentHandler() { - return get_event_register(mBuffer, LREG_IE, version); + return get_event_register(mBuffer, LREG_IE, getMajorVersion()); } //virtual @@ -727,6 +730,20 @@ void LLScriptExecuteLSL2::reset() bytestream2bytestream(mBuffer, dest_offset, src, src_offset, size); } +S32 LLScriptExecuteLSL2::getMajorVersion() const +{ + S32 version = getVersion(); + S32 major_version = 0; + if (version == LSL2_VERSION1_END_NUMBER){ + major_version = 1; + } + else if (version == LSL2_VERSION_NUMBER) + { + major_version = 2; + } + return major_version; +} + LLScriptExecute::LLScriptExecute() : mReset(FALSE) { @@ -754,6 +771,10 @@ bool LLScriptExecute::isYieldDue() const return true; } + // State changes can occur within a single time slice, + // but LLScriptData's clean up is required. Yield here + // to allow LLScriptData to perform cleanup and then call + // runQuanta again. if(isStateChangePending()) { return true; @@ -766,7 +787,6 @@ bool LLScriptExecute::isYieldDue() const // a single instruction for LSL2, a segment between save tests for Mono void LLScriptExecute::runInstructions(BOOL b_print, const LLUUID &id, const char **errorstr, - BOOL &state_transition, U32& events_processed, F32 quanta) { @@ -809,17 +829,15 @@ void LLScriptExecute::runInstructions(BOOL b_print, const LLUUID &id, else { // make sure that IE is zero - setCurrentHandler(0, major_version); + setCurrentHandler(0); // if no, we're in a state and waiting for an event - U64 current_events = getCurrentEvents(major_version); - U64 event_register = getEventHandlers(major_version); + U64 current_events = getCurrentEvents(); + U64 event_register = getEventHandlers(); // check NS to see if need to switch states (NS != CS) if (isStateChangePending()) { - state_transition = TRUE; - // ok, blow away any pending events deleteAllEvents(); @@ -827,16 +845,16 @@ void LLScriptExecute::runInstructions(BOOL b_print, const LLUUID &id, if (current_events & LSCRIPTStateBitField[LSTT_STATE_EXIT]) { // if yes, clear state exit flag - setCurrentHandler(LSCRIPTStateBitField[LSTT_STATE_EXIT], major_version); + setCurrentHandler(LSCRIPTStateBitField[LSTT_STATE_EXIT]); current_events &= ~LSCRIPTStateBitField[LSTT_STATE_EXIT]; - setCurrentEvents(current_events, major_version); + setCurrentEvents(current_events); // check state exit event handler // if there is a handler, call it if (event_register & LSCRIPTStateBitField[LSTT_STATE_EXIT]) { ++events_processed; - callEventHandler(LSTT_STATE_EXIT, major_version, id, quanta); + callEventHandler(LSTT_STATE_EXIT, id, quanta); return; } } @@ -844,32 +862,32 @@ void LLScriptExecute::runInstructions(BOOL b_print, const LLUUID &id, // if no handler or no state exit flag switch to new state // set state entry flag and clear other CE flags current_events = LSCRIPTStateBitField[LSTT_STATE_ENTRY]; - setCurrentEvents(current_events, major_version); + setCurrentEvents(current_events); U64 handled_events = nextState(); - setEventHandlers(handled_events, major_version); + setEventHandlers(handled_events); } // try to get next event from stack BOOL b_done = FALSE; LSCRIPTStateEventType event = LSTT_NULL; - current_events = getCurrentEvents(major_version); - event_register = getEventHandlers(major_version); + current_events = getCurrentEvents(); + event_register = getEventHandlers(); // first, check to see if state_entry or onrez are raised and handled if ((current_events & LSCRIPTStateBitField[LSTT_STATE_ENTRY]) &&(current_events & event_register)) { ++events_processed; - callEventHandler(LSTT_STATE_ENTRY, major_version, id, quanta); + callEventHandler(LSTT_STATE_ENTRY, id, quanta); b_done = TRUE; } else if ((current_events & LSCRIPTStateBitField[LSTT_REZ]) &&(current_events & event_register)) { ++events_processed; - callQueuedEventHandler(LSTT_REZ, major_version, id, quanta); + callQueuedEventHandler(LSTT_REZ, id, quanta); b_done = TRUE; } @@ -879,7 +897,7 @@ void LLScriptExecute::runInstructions(BOOL b_print, const LLUUID &id, if(getEventCount() > 0) { ++events_processed; - callNextQueuedEventHandler(event_register, major_version, id, quanta); + callNextQueuedEventHandler(event_register, id, quanta); b_done = TRUE; } else @@ -890,7 +908,7 @@ void LLScriptExecute::runInstructions(BOOL b_print, const LLUUID &id, { event = return_first_event((S32)handled_current); ++events_processed; - callEventHandler(event, major_version, id, quanta); + callEventHandler(event, id, quanta); } b_done = TRUE; } @@ -898,8 +916,8 @@ void LLScriptExecute::runInstructions(BOOL b_print, const LLUUID &id, } } -// Run for a single timeslice, or until a yield is due -F32 LLScriptExecute::runQuanta(BOOL b_print, const LLUUID &id, const char **errorstr, BOOL &state_transition, F32 quanta, U32& events_processed, LLTimer& timer) +// Run for a single timeslice, or until a yield or state transition is due +F32 LLScriptExecute::runQuanta(BOOL b_print, const LLUUID &id, const char **errorstr, F32 quanta, U32& events_processed, LLTimer& timer) { U32 timer_checks = 0; F32 inloop = 0; @@ -910,7 +928,7 @@ F32 LLScriptExecute::runQuanta(BOOL b_print, const LLUUID &id, const char **erro // on current execution speed. while(true) { - runInstructions(b_print, id, errorstr, state_transition, + runInstructions(b_print, id, errorstr, events_processed, quanta); static const S32 lsl_timer_check_skip = 4; @@ -3280,7 +3298,7 @@ BOOL run_state(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) { major_version = 2; } - + S32 current_state = get_register(buffer, LREG_CS); if (state != current_state) { @@ -3988,7 +4006,6 @@ void lscript_run(const std::string& filename, BOOL b_debug) LLTimer timer; const char *error; - BOOL b_state; LLScriptExecuteLSL2 *execute = NULL; if (filename.empty()) @@ -4012,7 +4029,7 @@ void lscript_run(const std::string& filename, BOOL b_debug) do { LLTimer timer2; - execute->runQuanta(b_debug, LLUUID::null, &error, b_state, + execute->runQuanta(b_debug, LLUUID::null, &error, time_slice, events_processed, timer2); } while (!execute->isFinished()); |