aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/lscript
diff options
context:
space:
mode:
authorJacek Antonelli2009-04-30 13:04:20 -0500
committerJacek Antonelli2009-04-30 13:07:16 -0500
commitca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch)
tree8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/lscript
parentSecond Life viewer sources 1.22.11 (diff)
downloadmeta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz
Second Life viewer sources 1.23.0-RC
Diffstat (limited to 'linden/indra/lscript')
-rw-r--r--linden/indra/lscript/CMakeLists.txt3
-rw-r--r--linden/indra/lscript/llscriptresource.h75
-rw-r--r--linden/indra/lscript/llscriptresourceconsumer.h67
-rw-r--r--linden/indra/lscript/llscriptresourcepool.h57
-rw-r--r--linden/indra/lscript/lscript_alloc.h3
-rw-r--r--linden/indra/lscript/lscript_byteconvert.h3
-rw-r--r--linden/indra/lscript/lscript_byteformat.h12
-rw-r--r--linden/indra/lscript/lscript_compile/indra.l51
-rw-r--r--linden/indra/lscript/lscript_compile/indra.y21
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_alloc.cpp3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_bytecode.cpp3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_bytecode.h3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_error.cpp3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_error.h3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_heap.cpp3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_heap.h3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_resource.cpp3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_resource.h3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_scope.cpp3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_scope.h3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_tree.cpp116
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_tree.h33
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_typecheck.cpp3
-rw-r--r--linden/indra/lscript/lscript_compile/lscript_typecheck.h3
-rw-r--r--linden/indra/lscript/lscript_execute.h21
-rw-r--r--linden/indra/lscript/lscript_execute/CMakeLists.txt6
-rw-r--r--linden/indra/lscript/lscript_execute/llscriptresource.cpp97
-rw-r--r--linden/indra/lscript/lscript_execute/llscriptresourceconsumer.cpp112
-rw-r--r--linden/indra/lscript/lscript_execute/llscriptresourcepool.cpp50
-rw-r--r--linden/indra/lscript/lscript_execute/lscript_execute.cpp37
-rw-r--r--linden/indra/lscript/lscript_execute/lscript_heapruntime.cpp3
-rw-r--r--linden/indra/lscript/lscript_execute/lscript_heapruntime.h3
-rw-r--r--linden/indra/lscript/lscript_execute/lscript_readlso.cpp13
-rw-r--r--linden/indra/lscript/lscript_execute/lscript_readlso.h3
-rw-r--r--linden/indra/lscript/lscript_execute_mono/assembly.cpp25
-rw-r--r--linden/indra/lscript/lscript_execute_mono/size.cpp25
-rw-r--r--linden/indra/lscript/lscript_export.h3
-rw-r--r--linden/indra/lscript/lscript_http.h3
-rw-r--r--linden/indra/lscript/lscript_library.h3
-rw-r--r--linden/indra/lscript/lscript_library/lscript_alloc.cpp3
-rw-r--r--linden/indra/lscript/lscript_library/lscript_export.cpp3
-rw-r--r--linden/indra/lscript/lscript_library/lscript_library.cpp9
-rw-r--r--linden/indra/lscript/lscript_rt_interface.h3
43 files changed, 833 insertions, 69 deletions
diff --git a/linden/indra/lscript/CMakeLists.txt b/linden/indra/lscript/CMakeLists.txt
index c655aef..937e2ec 100644
--- a/linden/indra/lscript/CMakeLists.txt
+++ b/linden/indra/lscript/CMakeLists.txt
@@ -1,6 +1,9 @@
1# -*- cmake -*- 1# -*- cmake -*-
2 2
3set(lscript_HEADER_FILES 3set(lscript_HEADER_FILES
4 llscriptresource.h
5 llscriptresourceconsumer.h
6 llscriptresourcepool.h
4 lscript_alloc.h 7 lscript_alloc.h
5 lscript_byteconvert.h 8 lscript_byteconvert.h
6 lscript_byteformat.h 9 lscript_byteformat.h
diff --git a/linden/indra/lscript/llscriptresource.h b/linden/indra/lscript/llscriptresource.h
new file mode 100644
index 0000000..8509413
--- /dev/null
+++ b/linden/indra/lscript/llscriptresource.h
@@ -0,0 +1,75 @@
1/**
2 * @file llscriptresource.h
3 * @brief LLScriptResource class definition
4 *
5 * $LicenseInfo:firstyear=2008&license=viewergpl$
6 *
7 * Copyright (c) 2008-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33#ifndef LL_LLSCRIPTRESOURCE_H
34#define LL_LLSCRIPTRESOURCE_H
35
36#include "stdtypes.h"
37
38// An LLScriptResource is a limited resource per ID.
39class LLScriptResource
40{
41public:
42 LLScriptResource();
43
44 // If amount resources are available will mark amount resouces
45 // used and returns true
46 // Otherwise returns false and doesn't mark any resources used.
47 bool request(S32 amount = 1);
48
49 // Release amount resources from use if at least amount resources are used and return true
50 // If amount is more than currently used no resources are released and return false
51 bool release(S32 amount = 1);
52
53 // Returns how many resources are available
54 S32 getAvailable() const;
55
56 // Sets the total amount of available resources
57 // It is possible to set the amount to less than currently used
58 // Most likely to happen on parcel ownership change
59 void setTotal(S32 amount);
60
61 // Get the total amount of available resources
62 S32 getTotal() const;
63
64 // Get the number of resources used
65 S32 getUsed() const;
66
67 // true if more resources used than total available
68 bool isOverLimit() const;
69
70private:
71 S32 mTotal; // How many resources have been set aside
72 S32 mUsed; // How many resources are currently in use
73};
74
75#endif // LL_LLSCRIPTRESOURCE_H
diff --git a/linden/indra/lscript/llscriptresourceconsumer.h b/linden/indra/lscript/llscriptresourceconsumer.h
new file mode 100644
index 0000000..917b7be
--- /dev/null
+++ b/linden/indra/lscript/llscriptresourceconsumer.h
@@ -0,0 +1,67 @@
1/**
2 * @file llscriptresourceconsumer.h
3 * @brief An interface for a script resource consumer.
4 *
5 * $LicenseInfo:firstyear=2008&license=viewergpl$
6 *
7 * Copyright (c) 2008-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33#ifndef LL_LLSCRIPTRESOURCECONSUMER_H
34#define LL_LLSCRIPTRESOURCECONSUMER_H
35
36#include "linden_common.h"
37
38class LLScriptResourcePool;
39
40// Entities that use limited script resources
41// should implement this interface
42
43class LLScriptResourceConsumer
44{
45public:
46 LLScriptResourceConsumer();
47
48 virtual ~LLScriptResourceConsumer() { }
49
50 // Get the number of public urls used by this consumer.
51 virtual S32 getUsedPublicURLs() const = 0;
52
53 // Get the resource pool this consumer is currently using.
54 LLScriptResourcePool& getScriptResourcePool();
55 const LLScriptResourcePool& getScriptResourcePool() const;
56
57 bool switchScriptResourcePools(LLScriptResourcePool& new_pool);
58 bool canUseScriptResourcePool(const LLScriptResourcePool& resource_pool);
59 bool isInPool(const LLScriptResourcePool& resource_pool);
60
61protected:
62 virtual void setScriptResourcePool(LLScriptResourcePool& pool);
63
64 LLScriptResourcePool* mScriptResourcePool;
65};
66
67#endif // LL_LLSCRIPTRESOURCECONSUMER_H
diff --git a/linden/indra/lscript/llscriptresourcepool.h b/linden/indra/lscript/llscriptresourcepool.h
new file mode 100644
index 0000000..250341c
--- /dev/null
+++ b/linden/indra/lscript/llscriptresourcepool.h
@@ -0,0 +1,57 @@
1/**
2 * @file llscriptresourcepool.h
3 * @brief A collection of LLScriptResources
4 *
5 * $LicenseInfo:firstyear=2008&license=viewergpl$
6 *
7 * Copyright (c) 2008-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33#ifndef LL_LLSCRIPTRESOURCEPOOL_H
34#define LL_LLSCRIPTRESOURCEPOOL_H
35
36#include "llscriptresource.h"
37
38// This is just a holder for LLSimResources
39class LLScriptResourcePool
40{
41public:
42 LLScriptResourcePool();
43 // ~LLSimResourceMgr();
44
45 LLScriptResource& getPublicURLResource();
46 const LLScriptResource& getPublicURLResource() const;
47
48 // An empty resource pool.
49 static LLScriptResourcePool null;
50
51private:
52 LLScriptResource mLSLPublicURLs;
53};
54
55
56
57#endif
diff --git a/linden/indra/lscript/lscript_alloc.h b/linden/indra/lscript/lscript_alloc.h
index a58d9eb..fe83c5c 100644
--- a/linden/indra/lscript/lscript_alloc.h
+++ b/linden/indra/lscript/lscript_alloc.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_byteconvert.h b/linden/indra/lscript/lscript_byteconvert.h
index 573a6ce..aa8c7ff 100644
--- a/linden/indra/lscript/lscript_byteconvert.h
+++ b/linden/indra/lscript/lscript_byteconvert.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_byteformat.h b/linden/indra/lscript/lscript_byteformat.h
index 418c248..ba2c46b 100644
--- a/linden/indra/lscript/lscript_byteformat.h
+++ b/linden/indra/lscript/lscript_byteformat.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -359,6 +360,7 @@ typedef enum e_lscript_state_event_type
359 LSTT_OBJECT_REZ, 360 LSTT_OBJECT_REZ,
360 LSTT_REMOTE_DATA, 361 LSTT_REMOTE_DATA,
361 LSTT_HTTP_RESPONSE, 362 LSTT_HTTP_RESPONSE,
363 LSTT_HTTP_REQUEST,
362 LSTT_EOF, 364 LSTT_EOF,
363 365
364 LSTT_STATE_BEGIN = LSTT_STATE_ENTRY, 366 LSTT_STATE_BEGIN = LSTT_STATE_ENTRY,
@@ -400,7 +402,8 @@ const U64 LSCRIPTStateBitField[LSTT_EOF] =
400 0x0000000020000000, // LSTT_MOVING_END 402 0x0000000020000000, // LSTT_MOVING_END
401 0x0000000040000000, // LSTT_OBJECT_REZ 403 0x0000000040000000, // LSTT_OBJECT_REZ
402 0x0000000080000000, // LSTT_REMOTE_DATA 404 0x0000000080000000, // LSTT_REMOTE_DATA
403 0x0000000100000000LL // LSTT_HTTP_RESPOSE 405 0x0000000100000000LL, // LSTT_HTTP_RESPOSE
406 0x0000000200000000LL // LSTT_HTTP_REQUEST
404}; 407};
405 408
406inline S32 get_event_handler_jump_position(U64 bit_field, LSCRIPTStateEventType type) 409inline S32 get_event_handler_jump_position(U64 bit_field, LSCRIPTStateEventType type)
@@ -550,5 +553,10 @@ const U32 LSCRIPTRunTimePermissionBits[SCRIPT_PERMISSION_EOF] =
550 (0x1 << 11),// SCRIPT_PERMISSION_CONTROL_CAMERA 553 (0x1 << 11),// SCRIPT_PERMISSION_CONTROL_CAMERA
551}; 554};
552 555
556// http_request string constants
557extern const char* URL_REQUEST_GRANTED;
558extern const char* URL_REQUEST_DENIED;
559extern const U64 LSL_HTTP_REQUEST_TIMEOUT;
560
553#endif 561#endif
554 562
diff --git a/linden/indra/lscript/lscript_compile/indra.l b/linden/indra/lscript/lscript_compile/indra.l
index 3e62195..ac52432 100644
--- a/linden/indra/lscript/lscript_compile/indra.l
+++ b/linden/indra/lscript/lscript_compile/indra.l
@@ -36,7 +36,8 @@ FS (f|F)
36#include "llclickaction.h" 36#include "llclickaction.h"
37 37
38void count(); 38void count();
39void comment(); 39void line_comment();
40void block_comment();
40void parse_string(); 41void parse_string();
41 42
42#define YYLMAX 16384 43#define YYLMAX 16384
@@ -60,7 +61,8 @@ extern "C" { int yyerror(const char *fmt, ...); }
60%} 61%}
61 62
62%% 63%%
63"//" { gInternalLine++; gInternalColumn = 0; comment(); } 64"//" { gInternalLine++; gInternalColumn = 0; line_comment(); }
65"/*" { block_comment(); }
64 66
65"integer" { count(); return(INTEGER); } 67"integer" { count(); return(INTEGER); }
66"float" { count(); return(FLOAT_TYPE); } 68"float" { count(); return(FLOAT_TYPE); }
@@ -116,6 +118,7 @@ extern "C" { int yyerror(const char *fmt, ...); }
116"object_rez" { count(); return(OBJECT_REZ); } 118"object_rez" { count(); return(OBJECT_REZ); }
117"remote_data" { count(); return(REMOTE_DATA); } 119"remote_data" { count(); return(REMOTE_DATA); }
118"http_response" { count(); return(HTTP_RESPONSE); } 120"http_response" { count(); return(HTTP_RESPONSE); }
121"http_request" { count(); return(HTTP_REQUEST); }
119"." { count(); return(PERIOD); } 122"." { count(); return(PERIOD); }
120 123
121 124
@@ -219,16 +222,17 @@ extern "C" { int yyerror(const char *fmt, ...); }
219"INVENTORY_ALL" { count(); yylval.ival = LLAssetType::AT_NONE; return(INTEGER_CONSTANT); } 222"INVENTORY_ALL" { count(); yylval.ival = LLAssetType::AT_NONE; return(INTEGER_CONSTANT); }
220"INVENTORY_NONE" { count(); yylval.ival = LLAssetType::AT_NONE; return(INTEGER_CONSTANT); } 223"INVENTORY_NONE" { count(); yylval.ival = LLAssetType::AT_NONE; return(INTEGER_CONSTANT); }
221 224
222"CHANGED_INVENTORY" { count(); yylval.ival = 0x1; return(INTEGER_CONSTANT); } 225"CHANGED_INVENTORY" { count(); yylval.ival = CHANGED_INVENTORY; return(INTEGER_CONSTANT); }
223"CHANGED_COLOR" { count(); yylval.ival = 0x2; return(INTEGER_CONSTANT); } 226"CHANGED_COLOR" { count(); yylval.ival = CHANGED_COLOR; return(INTEGER_CONSTANT); }
224"CHANGED_SHAPE" { count(); yylval.ival = 0x4; return(INTEGER_CONSTANT); } 227"CHANGED_SHAPE" { count(); yylval.ival = CHANGED_SHAPE; return(INTEGER_CONSTANT); }
225"CHANGED_SCALE" { count(); yylval.ival = 0x8; return(INTEGER_CONSTANT); } 228"CHANGED_SCALE" { count(); yylval.ival = CHANGED_SCALE; return(INTEGER_CONSTANT); }
226"CHANGED_TEXTURE" { count(); yylval.ival = 0x10; return(INTEGER_CONSTANT); } 229"CHANGED_TEXTURE" { count(); yylval.ival = CHANGED_TEXTURE; return(INTEGER_CONSTANT); }
227"CHANGED_LINK" { count(); yylval.ival = 0x20; return(INTEGER_CONSTANT); } 230"CHANGED_LINK" { count(); yylval.ival = CHANGED_LINK; return(INTEGER_CONSTANT); }
228"CHANGED_ALLOWED_DROP" { count(); yylval.ival = 0x40; return(INTEGER_CONSTANT); } 231"CHANGED_ALLOWED_DROP" { count(); yylval.ival = CHANGED_ALLOWED_DROP; return(INTEGER_CONSTANT); }
229"CHANGED_OWNER" { count(); yylval.ival = 0x80; return(INTEGER_CONSTANT); } 232"CHANGED_OWNER" { count(); yylval.ival = CHANGED_OWNER; return(INTEGER_CONSTANT); }
230"CHANGED_REGION" { count(); yylval.ival = 0x100; return(INTEGER_CONSTANT); } 233"CHANGED_REGION" { count(); yylval.ival = CHANGED_REGION; return(INTEGER_CONSTANT); }
231"CHANGED_TELEPORT" { count(); yylval.ival = 0x200; return(INTEGER_CONSTANT); } 234"CHANGED_TELEPORT" { count(); yylval.ival = CHANGED_TELEPORT; return(INTEGER_CONSTANT); }
235"CHANGED_REGION_START" { count(); yylval.ival = CHANGED_REGION_START; return(INTEGER_CONSTANT); }
232 236
233"OBJECT_UNKNOWN_DETAIL" { count(); yylval.ival = OBJECT_UNKNOWN_DETAIL; return(INTEGER_CONSTANT); } 237"OBJECT_UNKNOWN_DETAIL" { count(); yylval.ival = OBJECT_UNKNOWN_DETAIL; return(INTEGER_CONSTANT); }
234"OBJECT_NAME" { count(); yylval.ival = OBJECT_NAME; return(INTEGER_CONSTANT); } 238"OBJECT_NAME" { count(); yylval.ival = OBJECT_NAME; return(INTEGER_CONSTANT); }
@@ -250,6 +254,8 @@ extern "C" { int yyerror(const char *fmt, ...); }
250 254
251"NULL_KEY" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "00000000-0000-0000-0000-000000000000"); return(STRING_CONSTANT); } 255"NULL_KEY" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "00000000-0000-0000-0000-000000000000"); return(STRING_CONSTANT); }
252"EOF" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "\n\n\n"); return(STRING_CONSTANT); } 256"EOF" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, "\n\n\n"); return(STRING_CONSTANT); }
257"URL_REQUEST_GRANTED" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, URL_REQUEST_GRANTED); return(STRING_CONSTANT); }
258"URL_REQUEST_DENIED" { yylval.sval = new char[UUID_STR_LENGTH]; strcpy(yylval.sval, URL_REQUEST_DENIED); return(STRING_CONSTANT); }
253 259
254"PI" { count(); yylval.fval = F_PI; return(FP_CONSTANT); } 260"PI" { count(); yylval.fval = F_PI; return(FP_CONSTANT); }
255"TWO_PI" { count(); yylval.fval = F_TWO_PI; return(FP_CONSTANT); } 261"TWO_PI" { count(); yylval.fval = F_TWO_PI; return(FP_CONSTANT); }
@@ -790,7 +796,7 @@ S32 yywrap()
790 return(1); 796 return(1);
791} 797}
792 798
793void comment() 799void line_comment()
794{ 800{
795 char c; 801 char c;
796 802
@@ -798,6 +804,25 @@ void comment()
798 ; 804 ;
799} 805}
800 806
807void block_comment()
808{
809 char c1 = 0;
810 char c2 = yyinput();
811 while (c2 != 0 && c2 != EOF && !(c1 == '*' && c2 == '/')) {
812 if (c2 == '\n')
813 {
814 gInternalLine++;
815 gInternalColumn = 0;
816 }
817 else if (c2 == '\t')
818 gInternalColumn += 4 - (gInternalColumn % 8);
819 else
820 gInternalColumn++;
821 c1 = c2;
822 c2 = yyinput();
823 }
824}
825
801void count() 826void count()
802{ 827{
803 S32 i; 828 S32 i;
diff --git a/linden/indra/lscript/lscript_compile/indra.y b/linden/indra/lscript/lscript_compile/indra.y
index fdc240c..e4b10ff 100644
--- a/linden/indra/lscript/lscript_compile/indra.y
+++ b/linden/indra/lscript/lscript_compile/indra.y
@@ -92,6 +92,7 @@
92%token LINK_MESSAGE 92%token LINK_MESSAGE
93%token REMOTE_DATA 93%token REMOTE_DATA
94%token HTTP_RESPONSE 94%token HTTP_RESPONSE
95%token HTTP_REQUEST
95 96
96%token <sval> IDENTIFIER 97%token <sval> IDENTIFIER
97%token <sval> STATE_DEFAULT 98%token <sval> STATE_DEFAULT
@@ -195,6 +196,7 @@
195%type <event> object_rez 196%type <event> object_rez
196%type <event> remote_data 197%type <event> remote_data
197%type <event> http_response 198%type <event> http_response
199%type <event> http_request
198%type <event> link_message 200%type <event> link_message
199%type <event> timer 201%type <event> timer
200%type <event> chat 202%type <event> chat
@@ -848,6 +850,11 @@ event
848 $$ = new LLScriptEventHandler(gLine, gColumn, $1, $2); 850 $$ = new LLScriptEventHandler(gLine, gColumn, $1, $2);
849 gAllocationManager->addAllocation($$); 851 gAllocationManager->addAllocation($$);
850 } 852 }
853 | http_request compound_statement
854 {
855 $$ = new LLScriptEventHandler(gLine, gColumn, $1, $2);
856 gAllocationManager->addAllocation($$);
857 }
851 ; 858 ;
852 859
853state_entry 860state_entry
@@ -1216,6 +1223,20 @@ http_response
1216 } 1223 }
1217 ; 1224 ;
1218 1225
1226http_request
1227 : HTTP_REQUEST '(' LLKEY IDENTIFIER ',' STRING IDENTIFIER ',' STRING IDENTIFIER ')'
1228 {
1229 LLScriptIdentifier *id1 = new LLScriptIdentifier(gLine, gColumn, $4);
1230 gAllocationManager->addAllocation(id1);
1231 LLScriptIdentifier *id2 = new LLScriptIdentifier(gLine, gColumn, $7);
1232 gAllocationManager->addAllocation(id2);
1233 LLScriptIdentifier *id3 = new LLScriptIdentifier(gLine, gColumn, $10);
1234 gAllocationManager->addAllocation(id3);
1235 $$ = new LLScriptHTTPRequestEvent(gLine, gColumn, id1, id2, id3);
1236 gAllocationManager->addAllocation($$);
1237 }
1238 ;
1239
1219compound_statement 1240compound_statement
1220 : '{' '}' 1241 : '{' '}'
1221 { 1242 {
diff --git a/linden/indra/lscript/lscript_compile/lscript_alloc.cpp b/linden/indra/lscript/lscript_compile/lscript_alloc.cpp
index f522e18..76713de 100644
--- a/linden/indra/lscript/lscript_compile/lscript_alloc.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_alloc.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp b/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp
index f6e5127..9cd7d48 100644
--- a/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_bytecode.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_bytecode.h b/linden/indra/lscript/lscript_compile/lscript_bytecode.h
index c9f8633..5e2789d 100644
--- a/linden/indra/lscript/lscript_compile/lscript_bytecode.h
+++ b/linden/indra/lscript/lscript_compile/lscript_bytecode.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_error.cpp b/linden/indra/lscript/lscript_compile/lscript_error.cpp
index 5bdf2a2..c1a765b 100644
--- a/linden/indra/lscript/lscript_compile/lscript_error.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_error.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_error.h b/linden/indra/lscript/lscript_compile/lscript_error.h
index 2f8f8bc..95f48a4 100644
--- a/linden/indra/lscript/lscript_compile/lscript_error.h
+++ b/linden/indra/lscript/lscript_compile/lscript_error.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_heap.cpp b/linden/indra/lscript/lscript_compile/lscript_heap.cpp
index 5dccce9..b4d2764 100644
--- a/linden/indra/lscript/lscript_compile/lscript_heap.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_heap.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_heap.h b/linden/indra/lscript/lscript_compile/lscript_heap.h
index ced4609..b1a4b5c 100644
--- a/linden/indra/lscript/lscript_compile/lscript_heap.h
+++ b/linden/indra/lscript/lscript_compile/lscript_heap.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_resource.cpp b/linden/indra/lscript/lscript_compile/lscript_resource.cpp
index eb23665..c5eff1c 100644
--- a/linden/indra/lscript/lscript_compile/lscript_resource.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_resource.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_resource.h b/linden/indra/lscript/lscript_compile/lscript_resource.h
index f69e605..ede8b03 100644
--- a/linden/indra/lscript/lscript_compile/lscript_resource.h
+++ b/linden/indra/lscript/lscript_compile/lscript_resource.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_scope.cpp b/linden/indra/lscript/lscript_compile/lscript_scope.cpp
index 95a8eae..e6a7940 100644
--- a/linden/indra/lscript/lscript_compile/lscript_scope.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_scope.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_scope.h b/linden/indra/lscript/lscript_compile/lscript_scope.h
index 31125bc..ec36d37 100644
--- a/linden/indra/lscript/lscript_compile/lscript_scope.h
+++ b/linden/indra/lscript/lscript_compile/lscript_scope.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_tree.cpp b/linden/indra/lscript/lscript_compile/lscript_tree.cpp
index 2a41d91..e291d4c 100644
--- a/linden/indra/lscript/lscript_compile/lscript_tree.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_tree.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -630,7 +631,9 @@ static void print_cil_cast(LLFILE* fp, LSCRIPTType srcType, LSCRIPTType targetTy
630 switch(targetType) 631 switch(targetType)
631 { 632 {
632 case LST_INTEGER: 633 case LST_INTEGER:
633 fprintf(fp, "conv.i4\n"); 634 //fprintf(fp, "call int32 [LslLibrary]LindenLab.SecondLife.LslRunTime::ToInteger(float32)\n");
635 fprintf(fp, "conv.i4\n"); // TODO replace this line with the above
636 // we the entire grid is > 1.25.1
634 break; 637 break;
635 case LST_STRING: 638 case LST_STRING:
636 fprintf(fp, "call string [LslLibrary]LindenLab.SecondLife.LslRunTime::ToString(float32)\n"); 639 fprintf(fp, "call string [LslLibrary]LindenLab.SecondLife.LslRunTime::ToString(float32)\n");
@@ -3288,6 +3291,110 @@ S32 LLScriptHTTPResponseEvent::getSize()
3288 return 16; 3291 return 16;
3289} 3292}
3290 3293
3294void LLScriptHTTPRequestEvent::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pass, LSCRIPTPruneType ptype, BOOL &prunearg, LLScriptScope *scope, LSCRIPTType &type, LSCRIPTType basetype, U64 &count, LLScriptByteCodeChunk *chunk, LLScriptByteCodeChunk *heap, S32 stacksize, LLScriptScopeEntry *entry, S32 entrycount, LLScriptLibData **ldata)
3295{
3296 if (gErrorToText.getErrors())
3297 {
3298 return;
3299 }
3300 switch(pass)
3301 {
3302 case LSCP_PRETTY_PRINT:
3303 case LSCP_EMIT_ASSEMBLY:
3304 fdotabs(fp, tabs, tabsize);
3305 fprintf(fp, "http_request( key ");
3306 mRequestId->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3307 fprintf(fp, ", string ");
3308 mMethod->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3309 fprintf(fp, ", string ");
3310 mBody->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3311 fprintf(fp, " )\n");
3312 break;
3313
3314 case LSCP_SCOPE_PASS1:
3315 checkForDuplicateHandler(fp, this, scope, "http_request");
3316 if (scope->checkEntry(mRequestId->mName))
3317 {
3318 gErrorToText.writeError(fp, this, LSERROR_DUPLICATE_NAME);
3319 }
3320 else
3321 {
3322 mRequestId->mScopeEntry = scope->addEntry(mRequestId->mName, LIT_VARIABLE, LST_KEY);
3323 }
3324
3325 if (scope->checkEntry(mMethod->mName))
3326 {
3327 gErrorToText.writeError(fp, this, LSERROR_DUPLICATE_NAME);
3328 }
3329 else
3330 {
3331 mMethod->mScopeEntry = scope->addEntry(mMethod->mName, LIT_VARIABLE, LST_STRING);
3332 }
3333
3334 if (scope->checkEntry(mBody->mName))
3335 {
3336 gErrorToText.writeError(fp, this, LSERROR_DUPLICATE_NAME);
3337 }
3338 else
3339 {
3340 mBody->mScopeEntry = scope->addEntry(mBody->mName, LIT_VARIABLE, LST_STRING);
3341 }
3342 break;
3343
3344 case LSCP_RESOURCE:
3345 {
3346 // we're just tryng to determine how much space the variable needs
3347 if (mRequestId->mScopeEntry)
3348 {
3349 mRequestId->mScopeEntry->mOffset = (S32)count;
3350 mRequestId->mScopeEntry->mSize = 4;
3351 count += mRequestId->mScopeEntry->mSize;
3352
3353 mMethod->mScopeEntry->mOffset = (S32)count;
3354 mMethod->mScopeEntry->mSize = 4;
3355 count += mMethod->mScopeEntry->mSize;
3356
3357 mBody->mScopeEntry->mOffset = (S32)count;
3358 mBody->mScopeEntry->mSize = 4;
3359 count += mBody->mScopeEntry->mSize;
3360 }
3361 }
3362 break;
3363
3364 case LSCP_EMIT_BYTE_CODE:
3365 {
3366#ifdef LSL_INCLUDE_DEBUG_INFO
3367 char name[] = "http_request";
3368 chunk->addBytes(name, strlen(name) + 1); /*Flawfinder: ignore*/
3369 chunk->addBytes(mRequestId->mName, strlen(mRequestId->mName) + 1); /*Flawfinder: ignore*/
3370 chunk->addBytes(mMethod->mName, strlen(mMethod->mName) + 1); /*Flawfinder: ignore*/
3371 chunk->addBytes(mBody->mName, strlen(mBody->mName) + 1); /*Flawfinder: ignore*/
3372#endif
3373 }
3374 break;
3375 case LSCP_EMIT_CIL_ASSEMBLY:
3376 fdotabs(fp, tabs, tabsize);
3377 fprintf(fp, "http_request( valuetype [ScriptTypes]LindenLab.SecondLife.Key ");
3378 mRequestId->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3379 fprintf(fp, ", string ");
3380 mMethod->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3381 fprintf(fp, ", string ");
3382 mBody->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3383 fprintf(fp, " )\n");
3384 break;
3385 default:
3386 mRequestId->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3387 mMethod->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3388 mBody->recurse(fp, tabs, tabsize, pass, ptype, prunearg, scope, type, basetype, count, chunk, heap, stacksize, entry, entrycount, NULL);
3389 break;
3390 }
3391}
3392
3393S32 LLScriptHTTPRequestEvent::getSize()
3394{
3395 // key + string + string = 12
3396 return 12;
3397}
3291 3398
3292void LLScriptMoneyEvent::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pass, LSCRIPTPruneType ptype, BOOL &prunearg, LLScriptScope *scope, LSCRIPTType &type, LSCRIPTType basetype, U64 &count, LLScriptByteCodeChunk *chunk, LLScriptByteCodeChunk *heap, S32 stacksize, LLScriptScopeEntry *entry, S32 entrycount, LLScriptLibData **ldata) 3399void LLScriptMoneyEvent::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pass, LSCRIPTPruneType ptype, BOOL &prunearg, LLScriptScope *scope, LSCRIPTType &type, LSCRIPTType basetype, U64 &count, LLScriptByteCodeChunk *chunk, LLScriptByteCodeChunk *heap, S32 stacksize, LLScriptScopeEntry *entry, S32 entrycount, LLScriptLibData **ldata)
3293{ 3400{
@@ -9655,6 +9762,11 @@ void LLScriptEventHandler::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCom
9655 mScopeEntry->mFunctionArgs.addType(LST_LIST); 9762 mScopeEntry->mFunctionArgs.addType(LST_LIST);
9656 mScopeEntry->mFunctionArgs.addType(LST_STRING); 9763 mScopeEntry->mFunctionArgs.addType(LST_STRING);
9657 break; 9764 break;
9765 case LSTT_HTTP_REQUEST:
9766 mScopeEntry->mFunctionArgs.addType(LST_KEY);
9767 mScopeEntry->mFunctionArgs.addType(LST_STRING);
9768 mScopeEntry->mFunctionArgs.addType(LST_STRING);
9769 break;
9658 9770
9659 default: 9771 default:
9660 break; 9772 break;
diff --git a/linden/indra/lscript/lscript_compile/lscript_tree.h b/linden/indra/lscript/lscript_compile/lscript_tree.h
index 0e110f5..12c1690 100644
--- a/linden/indra/lscript/lscript_compile/lscript_tree.h
+++ b/linden/indra/lscript/lscript_compile/lscript_tree.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -758,12 +759,12 @@ class LLScriptHTTPResponseEvent : public LLScriptEvent
758{ 759{
759public: 760public:
760 LLScriptHTTPResponseEvent(S32 line, S32 col, 761 LLScriptHTTPResponseEvent(S32 line, S32 col,
761 LLScriptIdentifier *reqeust_id, 762 LLScriptIdentifier *request_id,
762 LLScriptIdentifier *status, 763 LLScriptIdentifier *status,
763 LLScriptIdentifier *metadata, 764 LLScriptIdentifier *metadata,
764 LLScriptIdentifier *body) 765 LLScriptIdentifier *body)
765 : LLScriptEvent(line, col, LSTT_HTTP_RESPONSE), 766 : LLScriptEvent(line, col, LSTT_HTTP_RESPONSE),
766 mRequestId(reqeust_id), mStatus(status), mMetadata(metadata), mBody(body) 767 mRequestId(request_id), mStatus(status), mMetadata(metadata), mBody(body)
767 { 768 {
768 } 769 }
769 770
@@ -782,6 +783,32 @@ public:
782 LLScriptIdentifier *mBody; 783 LLScriptIdentifier *mBody;
783}; 784};
784 785
786class LLScriptHTTPRequestEvent : public LLScriptEvent
787{
788public:
789 LLScriptHTTPRequestEvent(S32 line, S32 col,
790 LLScriptIdentifier *request_id,
791 LLScriptIdentifier *method,
792 LLScriptIdentifier *body)
793 : LLScriptEvent(line, col, LSTT_HTTP_REQUEST),
794 mRequestId(request_id), mMethod(method), mBody(body)
795 {
796 }
797
798 void recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePass pass,
799 LSCRIPTPruneType ptype, BOOL &prunearg, LLScriptScope *scope,
800 LSCRIPTType &type, LSCRIPTType basetype, U64 &count,
801 LLScriptByteCodeChunk *chunk, LLScriptByteCodeChunk *heap,
802 S32 stacksize, LLScriptScopeEntry *entry,
803 S32 entrycount, LLScriptLibData **ldata);
804
805 S32 getSize();
806
807 LLScriptIdentifier *mRequestId;
808 LLScriptIdentifier *mMethod;
809 LLScriptIdentifier *mBody;
810};
811
785class LLScriptRezEvent : public LLScriptEvent 812class LLScriptRezEvent : public LLScriptEvent
786{ 813{
787public: 814public:
diff --git a/linden/indra/lscript/lscript_compile/lscript_typecheck.cpp b/linden/indra/lscript/lscript_compile/lscript_typecheck.cpp
index ed01cdd..6a409b8 100644
--- a/linden/indra/lscript/lscript_compile/lscript_typecheck.cpp
+++ b/linden/indra/lscript/lscript_compile/lscript_typecheck.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_compile/lscript_typecheck.h b/linden/indra/lscript/lscript_compile/lscript_typecheck.h
index 7e3a35d..cebe3ce 100644
--- a/linden/indra/lscript/lscript_compile/lscript_typecheck.h
+++ b/linden/indra/lscript/lscript_compile/lscript_typecheck.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_execute.h b/linden/indra/lscript/lscript_execute.h
index cfea328..9a631c4 100644
--- a/linden/indra/lscript/lscript_execute.h
+++ b/linden/indra/lscript/lscript_execute.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -402,6 +403,8 @@ public:
402 virtual U32 getBytecodeSize() const = 0; 403 virtual U32 getBytecodeSize() const = 0;
403 virtual bool isMono() const = 0; 404 virtual bool isMono() const = 0;
404 virtual void error() {;} // Processing that must be performed when error flag is set and so run is not called. 405 virtual void error() {;} // Processing that must be performed when error flag is set and so run is not called.
406
407 virtual U32 getUsedMemory() = 0;
405 408
406 // Run current event handler for a maximum of time_slice seconds. 409 // Run current event handler for a maximum of time_slice seconds.
407 // Updates current handler and current events registers. 410 // Updates current handler and current events registers.
@@ -431,6 +434,13 @@ public:
431 F32 quanta, 434 F32 quanta,
432 U32& events_processed, LLTimer& timer); 435 U32& events_processed, LLTimer& timer);
433 436
437 // NOTE: babbage: this must be used on occasions where another script may already be executing. Only 2 levels of nesting are allowed.
438 // Provided to support bizarre detach behaviour only. Do not use.
439 virtual F32 runNested(BOOL b_print, const LLUUID &id,
440 const char **errorstr,
441 F32 quanta,
442 U32& events_processed, LLTimer& timer);
443
434 // Run smallest possible amount of code: an instruction for LSL2, a segment 444 // Run smallest possible amount of code: an instruction for LSL2, a segment
435 // between save tests for Mono 445 // between save tests for Mono
436 void runInstructions(BOOL b_print, const LLUUID &id, 446 void runInstructions(BOOL b_print, const LLUUID &id,
@@ -449,9 +459,16 @@ public:
449 // Called when the script is scheduled to be stopped from newsim/LLScriptData 459 // Called when the script is scheduled to be stopped from newsim/LLScriptData
450 virtual void stopRunning() = 0; 460 virtual void stopRunning() = 0;
451 461
462 // A timer is regularly checked to see if script takes too long, but we
463 // don't do it every opcode due to performance hits.
464 static void setTimerCheckSkip( S32 value ) { sTimerCheckSkip = value; }
465 static S32 getTimerCheckSkip() { return sTimerCheckSkip; }
466
452private: 467private:
453 468
454 BOOL mReset; 469 BOOL mReset;
470
471 static S32 sTimerCheckSkip; // Number of times to skip the timer check for performance reasons
455}; 472};
456 473
457class LLScriptExecuteLSL2 : public LLScriptExecute 474class LLScriptExecuteLSL2 : public LLScriptExecute
@@ -493,7 +510,7 @@ public:
493 virtual const U8* getBytecode() const {return mBytecode;} 510 virtual const U8* getBytecode() const {return mBytecode;}
494 virtual U32 getBytecodeSize() const {return mBytecodeSize;} 511 virtual U32 getBytecodeSize() const {return mBytecodeSize;}
495 virtual bool isMono() const {return false;} 512 virtual bool isMono() const {return false;}
496 513 virtual U32 getUsedMemory();
497 // Run current event handler for a maximum of time_slice seconds. 514 // Run current event handler for a maximum of time_slice seconds.
498 // Updates current handler and current events registers. 515 // Updates current handler and current events registers.
499 virtual void resumeEventHandler(BOOL b_print, const LLUUID &id, F32 time_slice); 516 virtual void resumeEventHandler(BOOL b_print, const LLUUID &id, F32 time_slice);
diff --git a/linden/indra/lscript/lscript_execute/CMakeLists.txt b/linden/indra/lscript/lscript_execute/CMakeLists.txt
index f30915b..3a16ffd 100644
--- a/linden/indra/lscript/lscript_execute/CMakeLists.txt
+++ b/linden/indra/lscript/lscript_execute/CMakeLists.txt
@@ -12,6 +12,9 @@ include_directories(
12 ) 12 )
13 13
14set(lscript_execute_SOURCE_FILES 14set(lscript_execute_SOURCE_FILES
15 llscriptresource.cpp
16 llscriptresourceconsumer.cpp
17 llscriptresourcepool.cpp
15 lscript_execute.cpp 18 lscript_execute.cpp
16 lscript_heapruntime.cpp 19 lscript_heapruntime.cpp
17 lscript_readlso.cpp 20 lscript_readlso.cpp
@@ -20,6 +23,9 @@ set(lscript_execute_SOURCE_FILES
20set(lscript_execute_HEADER_FILES 23set(lscript_execute_HEADER_FILES
21 CMakeLists.txt 24 CMakeLists.txt
22 25
26 ../llscriptresource.h
27 ../llscriptresourceconsumer.h
28 ../llscriptresourcepool.h
23 ../lscript_execute.h 29 ../lscript_execute.h
24 ../lscript_rt_interface.h 30 ../lscript_rt_interface.h
25 lscript_heapruntime.h 31 lscript_heapruntime.h
diff --git a/linden/indra/lscript/lscript_execute/llscriptresource.cpp b/linden/indra/lscript/lscript_execute/llscriptresource.cpp
new file mode 100644
index 0000000..6c4776c
--- /dev/null
+++ b/linden/indra/lscript/lscript_execute/llscriptresource.cpp
@@ -0,0 +1,97 @@
1/**
2 * @file llscriptresource.cpp
3 * @brief LLScriptResource class implementation for managing limited resources
4 *
5 * $LicenseInfo:firstyear=2008&license=viewergpl$
6 *
7 * Copyright (c) 2008-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33#include "llscriptresource.h"
34#include "llerror.h"
35
36LLScriptResource::LLScriptResource()
37: mTotal(0),
38 mUsed(0)
39{
40}
41
42bool LLScriptResource::request(S32 amount /* = 1 */)
43{
44 if (mUsed + amount <= mTotal)
45 {
46 mUsed += amount;
47 return true;
48 }
49
50 return false;
51}
52
53bool LLScriptResource::release(S32 amount /* = 1 */)
54{
55 if (mUsed >= amount)
56 {
57 mUsed -= amount;
58 return true;
59 }
60
61 return false;
62}
63
64S32 LLScriptResource::getAvailable() const
65{
66 if (mUsed > mTotal)
67 {
68 // It is possible after a parcel ownership change for more than total to be used
69 // In this case the user of this class just wants to know
70 // whether or not they can use a resource
71 return 0;
72 }
73 return (mTotal - mUsed);
74}
75
76void LLScriptResource::setTotal(S32 amount)
77{
78 // This may cause this resource to be over spent
79 // such that more are in use than total allowed
80 // Until those resources are released getAvailable will return 0.
81 mTotal = amount;
82}
83
84S32 LLScriptResource::getTotal() const
85{
86 return mTotal;
87}
88
89S32 LLScriptResource::getUsed() const
90{
91 return mUsed;
92}
93
94bool LLScriptResource::isOverLimit() const
95{
96 return (mUsed > mTotal);
97}
diff --git a/linden/indra/lscript/lscript_execute/llscriptresourceconsumer.cpp b/linden/indra/lscript/lscript_execute/llscriptresourceconsumer.cpp
new file mode 100644
index 0000000..5bade41
--- /dev/null
+++ b/linden/indra/lscript/lscript_execute/llscriptresourceconsumer.cpp
@@ -0,0 +1,112 @@
1/**
2 * @file llscriptresourceconsumer.cpp
3 * @brief An interface for a script resource consumer.
4 *
5 * $LicenseInfo:firstyear=2008&license=viewergpl$
6 *
7 * Copyright (c) 2008-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33#include "llscriptresourceconsumer.h"
34
35#include "llscriptresourcepool.h"
36
37LLScriptResourceConsumer::LLScriptResourceConsumer()
38 : mScriptResourcePool(&LLScriptResourcePool::null)
39{ }
40
41// Get the resource pool this consumer is currently using.
42// virtual
43LLScriptResourcePool& LLScriptResourceConsumer::getScriptResourcePool()
44{
45 return *mScriptResourcePool;
46}
47
48// Get the resource pool this consumer is currently using.
49// virtual
50const LLScriptResourcePool& LLScriptResourceConsumer::getScriptResourcePool() const
51{
52 return *mScriptResourcePool;
53}
54
55// virtual
56void LLScriptResourceConsumer::setScriptResourcePool(LLScriptResourcePool& new_pool)
57{
58 mScriptResourcePool = &new_pool;
59}
60
61bool LLScriptResourceConsumer::switchScriptResourcePools(LLScriptResourcePool& new_pool)
62{
63 if (&new_pool == &LLScriptResourcePool::null)
64 {
65 llwarns << "New pool is null" << llendl;
66 }
67
68 if (isInPool(new_pool))
69 {
70 return true;
71 }
72
73 if (!canUseScriptResourcePool(new_pool))
74 {
75 return false;
76 }
77
78 S32 used_urls = getUsedPublicURLs();
79
80 getScriptResourcePool().getPublicURLResource().release( used_urls );
81 setScriptResourcePool(new_pool);
82 getScriptResourcePool().getPublicURLResource().request( used_urls );
83
84 return true;
85}
86
87bool LLScriptResourceConsumer::canUseScriptResourcePool(const LLScriptResourcePool& resource_pool)
88{
89 if (isInPool(resource_pool))
90 {
91 return true;
92 }
93
94 if (resource_pool.getPublicURLResource().getAvailable() < getUsedPublicURLs())
95 {
96 return false;
97 }
98
99 return true;
100}
101
102bool LLScriptResourceConsumer::isInPool(const LLScriptResourcePool& resource_pool)
103{
104 const LLScriptResourcePool& current_pool = getScriptResourcePool();
105 if ( &resource_pool == &current_pool )
106 {
107 // This consumer is already in this pool
108 return true;
109 }
110 return false;
111}
112
diff --git a/linden/indra/lscript/lscript_execute/llscriptresourcepool.cpp b/linden/indra/lscript/lscript_execute/llscriptresourcepool.cpp
new file mode 100644
index 0000000..3052152
--- /dev/null
+++ b/linden/indra/lscript/lscript_execute/llscriptresourcepool.cpp
@@ -0,0 +1,50 @@
1/**
2 * @file llscriptresourcepool.cpp
3 * @brief Collection of limited script resources
4 *
5 * $LicenseInfo:firstyear=2008&license=viewergpl$
6 *
7 * Copyright (c) 2008-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33#include "llscriptresourcepool.h"
34
35LLScriptResourcePool LLScriptResourcePool::null;
36
37LLScriptResourcePool::LLScriptResourcePool()
38{
39
40}
41
42LLScriptResource& LLScriptResourcePool::getPublicURLResource()
43{
44 return mLSLPublicURLs;
45}
46
47const LLScriptResource& LLScriptResourcePool::getPublicURLResource() const
48{
49 return mLSLPublicURLs;
50}
diff --git a/linden/indra/lscript/lscript_execute/lscript_execute.cpp b/linden/indra/lscript/lscript_execute/lscript_execute.cpp
index d178a16..b2b54cd 100644
--- a/linden/indra/lscript/lscript_execute/lscript_execute.cpp
+++ b/linden/indra/lscript/lscript_execute/lscript_execute.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -41,6 +42,10 @@
41#include "lscript_heapruntime.h" 42#include "lscript_heapruntime.h"
42#include "lscript_alloc.h" 43#include "lscript_alloc.h"
43 44
45// Static
46const S32 DEFAULT_SCRIPT_TIMER_CHECK_SKIP = 4;
47S32 LLScriptExecute::sTimerCheckSkip = DEFAULT_SCRIPT_TIMER_CHECK_SKIP;
48
44void (*binary_operations[LST_EOF][LST_EOF])(U8 *buffer, LSCRIPTOpCodesEnum opcode); 49void (*binary_operations[LST_EOF][LST_EOF])(U8 *buffer, LSCRIPTOpCodesEnum opcode);
45void (*unary_operations[LST_EOF])(U8 *buffer, LSCRIPTOpCodesEnum opcode); 50void (*unary_operations[LST_EOF])(U8 *buffer, LSCRIPTOpCodesEnum opcode);
46 51
@@ -63,6 +68,12 @@ const char* LSCRIPTRunTimeFaultStrings[LSRF_EOF] = /*Flawfinder: ignore*/
63void LLScriptExecuteLSL2::startRunning() {} 68void LLScriptExecuteLSL2::startRunning() {}
64void LLScriptExecuteLSL2::stopRunning() {} 69void LLScriptExecuteLSL2::stopRunning() {}
65 70
71const char* URL_REQUEST_GRANTED = "URL_REQUEST_GRANTED";
72const char* URL_REQUEST_DENIED = "URL_REQUEST_DENIED";
73
74// HTTP Requests to LSL scripts will time out after 25 seconds.
75const U64 LSL_HTTP_REQUEST_TIMEOUT = 25 * USEC_PER_SEC;
76
66LLScriptExecuteLSL2::LLScriptExecuteLSL2(LLFILE *fp) 77LLScriptExecuteLSL2::LLScriptExecuteLSL2(LLFILE *fp)
67{ 78{
68 U8 sizearray[4]; 79 U8 sizearray[4];
@@ -744,6 +755,11 @@ S32 LLScriptExecuteLSL2::getMajorVersion() const
744 return major_version; 755 return major_version;
745} 756}
746 757
758U32 LLScriptExecuteLSL2::getUsedMemory()
759{
760 return getBytecodeSize();
761}
762
747LLScriptExecute::LLScriptExecute() : 763LLScriptExecute::LLScriptExecute() :
748 mReset(FALSE) 764 mReset(FALSE)
749{ 765{
@@ -891,14 +907,13 @@ void LLScriptExecute::runInstructions(BOOL b_print, const LLUUID &id,
891 b_done = TRUE; 907 b_done = TRUE;
892 } 908 }
893 909
894 while (!b_done) 910 if (!b_done)
895 { 911 {
896 // Call handler for next queued event. 912 // Call handler for next queued event.
897 if(getEventCount() > 0) 913 if(getEventCount() > 0)
898 { 914 {
899 ++events_processed; 915 ++events_processed;
900 callNextQueuedEventHandler(event_register, id, quanta); 916 callNextQueuedEventHandler(event_register, id, quanta);
901 b_done = TRUE;
902 } 917 }
903 else 918 else
904 { 919 {
@@ -910,8 +925,8 @@ void LLScriptExecute::runInstructions(BOOL b_print, const LLUUID &id,
910 ++events_processed; 925 ++events_processed;
911 callEventHandler(event, id, quanta); 926 callEventHandler(event, id, quanta);
912 } 927 }
913 b_done = TRUE;
914 } 928 }
929 b_done = TRUE;
915 } 930 }
916 } 931 }
917} 932}
@@ -919,7 +934,7 @@ void LLScriptExecute::runInstructions(BOOL b_print, const LLUUID &id,
919// Run for a single timeslice, or until a yield or state transition is due 934// Run for a single timeslice, or until a yield or state transition is due
920F32 LLScriptExecute::runQuanta(BOOL b_print, const LLUUID &id, const char **errorstr, F32 quanta, U32& events_processed, LLTimer& timer) 935F32 LLScriptExecute::runQuanta(BOOL b_print, const LLUUID &id, const char **errorstr, F32 quanta, U32& events_processed, LLTimer& timer)
921{ 936{
922 U32 timer_checks = 0; 937 S32 timer_checks = 0;
923 F32 inloop = 0; 938 F32 inloop = 0;
924 939
925 // Loop while not finished, yield not due and time remaining 940 // Loop while not finished, yield not due and time remaining
@@ -931,12 +946,11 @@ F32 LLScriptExecute::runQuanta(BOOL b_print, const LLUUID &id, const char **erro
931 runInstructions(b_print, id, errorstr, 946 runInstructions(b_print, id, errorstr,
932 events_processed, quanta); 947 events_processed, quanta);
933 948
934 static const S32 lsl_timer_check_skip = 4;
935 if(isYieldDue()) 949 if(isYieldDue())
936 { 950 {
937 break; 951 break;
938 } 952 }
939 else if(timer_checks++ == lsl_timer_check_skip) 953 else if(timer_checks++ >= LLScriptExecute::sTimerCheckSkip)
940 { 954 {
941 inloop = timer.getElapsedTimeF32(); 955 inloop = timer.getElapsedTimeF32();
942 if(inloop > quanta) 956 if(inloop > quanta)
@@ -946,9 +960,18 @@ F32 LLScriptExecute::runQuanta(BOOL b_print, const LLUUID &id, const char **erro
946 timer_checks = 0; 960 timer_checks = 0;
947 } 961 }
948 } 962 }
963 if (inloop == 0.0f)
964 {
965 inloop = timer.getElapsedTimeF32();
966 }
949 return inloop; 967 return inloop;
950} 968}
951 969
970F32 LLScriptExecute::runNested(BOOL b_print, const LLUUID &id, const char **errorstr, F32 quanta, U32& events_processed, LLTimer& timer)
971{
972 return LLScriptExecute::runQuanta(b_print, id, errorstr, quanta, events_processed, timer);
973}
974
952BOOL run_noop(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id) 975BOOL run_noop(U8 *buffer, S32 &offset, BOOL b_print, const LLUUID &id)
953{ 976{
954 if (b_print) 977 if (b_print)
diff --git a/linden/indra/lscript/lscript_execute/lscript_heapruntime.cpp b/linden/indra/lscript/lscript_execute/lscript_heapruntime.cpp
index d502275..df2e489 100644
--- a/linden/indra/lscript/lscript_execute/lscript_heapruntime.cpp
+++ b/linden/indra/lscript/lscript_execute/lscript_heapruntime.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_execute/lscript_heapruntime.h b/linden/indra/lscript/lscript_execute/lscript_heapruntime.h
index 69bd80f..ec3d2f9 100644
--- a/linden/indra/lscript/lscript_execute/lscript_heapruntime.h
+++ b/linden/indra/lscript/lscript_execute/lscript_heapruntime.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_execute/lscript_readlso.cpp b/linden/indra/lscript/lscript_execute/lscript_readlso.cpp
index 6dc1474..3b10cc6 100644
--- a/linden/indra/lscript/lscript_execute/lscript_readlso.cpp
+++ b/linden/indra/lscript/lscript_execute/lscript_readlso.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -624,6 +625,16 @@ void LLScriptLSOParse::printStates(LLFILE *fp)
624 bytestream2char(name, mRawData, event_offset, sizeof(name)); 625 bytestream2char(name, mRawData, event_offset, sizeof(name));
625 fprintf(fp, "\t\tstring %s\n", name); 626 fprintf(fp, "\t\tstring %s\n", name);
626 break; 627 break;
628 case LSTT_HTTP_REQUEST: // LSTT_HTTP_REQUEST
629 bytestream2char(name, mRawData, event_offset, sizeof(name));
630 fprintf(fp, "%s\n", name);
631 bytestream2char(name, mRawData, event_offset, sizeof(name));
632 fprintf(fp, "\t\tkey %s\n", name);
633 bytestream2char(name, mRawData, event_offset, sizeof(name));
634 fprintf(fp, "\t\tstring %s\n", name);
635 bytestream2char(name, mRawData, event_offset, sizeof(name));
636 fprintf(fp, "\t\tstring %s\n", name);
637 break;
627 default: 638 default:
628 break; 639 break;
629 } 640 }
diff --git a/linden/indra/lscript/lscript_execute/lscript_readlso.h b/linden/indra/lscript/lscript_execute/lscript_readlso.h
index 90ebb7b..3b0b75c 100644
--- a/linden/indra/lscript/lscript_execute/lscript_readlso.h
+++ b/linden/indra/lscript/lscript_execute/lscript_readlso.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_execute_mono/assembly.cpp b/linden/indra/lscript/lscript_execute_mono/assembly.cpp
index 4037dfc..01cadba 100644
--- a/linden/indra/lscript/lscript_execute_mono/assembly.cpp
+++ b/linden/indra/lscript/lscript_execute_mono/assembly.cpp
@@ -2,16 +2,27 @@
2 * @file llassembly.cpp 2 * @file llassembly.cpp
3 * @brief keeps track of user scripts, ensures that only one copy exists for each 3 * @brief keeps track of user scripts, ensures that only one copy exists for each
4 * 4 *
5 * $LicenseInfo:firstyear=2007&license=internal$ 5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 * 6 *
7 * Copyright (c) 2007-2009, Linden Research, Inc. 7 * Copyright (c) 2007-2009, Linden Research, Inc.
8 * 8 *
9 * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of 9 * Second Life Viewer Source Code
10 * this source code is governed by the Linden Lab Source Code Disclosure 10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * Agreement ("Agreement") previously entered between you and Linden 11 * to you under the terms of the GNU General Public License, version 2.0
12 * Lab. By accessing, using, copying, modifying or distributing this 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * software, you acknowledge that you have been informed of your 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * obligations under the Agreement and agree to abide by those obligations. 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
15 * 26 *
16 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
17 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
diff --git a/linden/indra/lscript/lscript_execute_mono/size.cpp b/linden/indra/lscript/lscript_execute_mono/size.cpp
index 6941b45..731eeb9 100644
--- a/linden/indra/lscript/lscript_execute_mono/size.cpp
+++ b/linden/indra/lscript/lscript_execute_mono/size.cpp
@@ -3,16 +3,27 @@
3 * @file size.c 3 * @file size.c
4 * @brief file from mono samples 4 * @brief file from mono samples
5 * 5 *
6 * $LicenseInfo:firstyear=2007&license=internal$ 6 * $LicenseInfo:firstyear=2007&license=viewergpl$
7 * 7 *
8 * Copyright (c) 2007-2009, Linden Research, Inc. 8 * Copyright (c) 2007-2009, Linden Research, Inc.
9 * 9 *
10 * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of 10 * Second Life Viewer Source Code
11 * this source code is governed by the Linden Lab Source Code Disclosure 11 * The source code in this file ("Source Code") is provided by Linden Lab
12 * Agreement ("Agreement") previously entered between you and Linden 12 * to you under the terms of the GNU General Public License, version 2.0
13 * Lab. By accessing, using, copying, modifying or distributing this 13 * ("GPL"), unless you have obtained a separate licensing agreement
14 * software, you acknowledge that you have been informed of your 14 * ("Other License"), formally executed by you and Linden Lab. Terms of
15 * obligations under the Agreement and agree to abide by those obligations. 15 * the GPL can be found in doc/GPL-license.txt in this distribution, or
16 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
17 *
18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at
22 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
23 *
24 * By copying, modifying or distributing this software, you acknowledge
25 * that you have read and understood your obligations described above,
26 * and agree to abide by those obligations.
16 * 27 *
17 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 28 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
18 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 29 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
diff --git a/linden/indra/lscript/lscript_export.h b/linden/indra/lscript/lscript_export.h
index bf00021..d4626a8 100644
--- a/linden/indra/lscript/lscript_export.h
+++ b/linden/indra/lscript/lscript_export.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_http.h b/linden/indra/lscript/lscript_http.h
index b988bb6..86b2d29 100644
--- a/linden/indra/lscript/lscript_http.h
+++ b/linden/indra/lscript/lscript_http.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_library.h b/linden/indra/lscript/lscript_library.h
index dd4b9d4..fa3b06b 100644
--- a/linden/indra/lscript/lscript_library.h
+++ b/linden/indra/lscript/lscript_library.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_library/lscript_alloc.cpp b/linden/indra/lscript/lscript_library/lscript_alloc.cpp
index 5683a70..2d47644 100644
--- a/linden/indra/lscript/lscript_library/lscript_alloc.cpp
+++ b/linden/indra/lscript/lscript_library/lscript_alloc.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_library/lscript_export.cpp b/linden/indra/lscript/lscript_library/lscript_export.cpp
index b108354..e8a3615 100644
--- a/linden/indra/lscript/lscript_library/lscript_export.cpp
+++ b/linden/indra/lscript/lscript_library/lscript_export.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
diff --git a/linden/indra/lscript/lscript_library/lscript_library.cpp b/linden/indra/lscript/lscript_library/lscript_library.cpp
index 2ac45f0..0342c97 100644
--- a/linden/indra/lscript/lscript_library/lscript_library.cpp
+++ b/linden/indra/lscript/lscript_library/lscript_library.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -450,6 +451,12 @@ void LLScriptLibrary::init()
450 451
451 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llSHA1String", "s", "s", "string llSHA1String(string sr)\nPerforms a SHA1 security Hash. Returns a 40 character hex string.")); 452 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llSHA1String", "s", "s", "string llSHA1String(string sr)\nPerforms a SHA1 security Hash. Returns a 40 character hex string."));
452 453
454 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetFreeURLs", "i", NULL, "integer llGetFreeURLs()\nreturns the available urls for the current script"));
455 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llRequestURL", "k", NULL, "key llRequestURL()\nRequests one HTTP:// url for use by this object\nTriggers an http_server event with results."));
456 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llRequestSecureURL", "k", NULL, "key llRequestSecureURL()\nRequests one HTTPS:// (SSL) url for use by this object\nTriggers an http_server event with results."));
457 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llReleaseURL", NULL, "s", "llReleaseURL(string url)\nReleases the specified URL, it will no longer be usable."));
458 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llHTTPResponse", NULL, "kis", "llHTTPResponse(key id, integer status, string body)\nResponds to request id with status and body."));
459 addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetHTTPHeader", "s", "ks", "string llGetHTTPHeader(key id, string header)\nGet the value for header for request id."));
453 460
454 // energy, sleep, dummy_func, name, return type, parameters, help text, gods-only 461 // energy, sleep, dummy_func, name, return type, parameters, help text, gods-only
455 462
diff --git a/linden/indra/lscript/lscript_rt_interface.h b/linden/indra/lscript/lscript_rt_interface.h
index f197d6b..78b6a1d 100644
--- a/linden/indra/lscript/lscript_rt_interface.h
+++ b/linden/indra/lscript/lscript_rt_interface.h
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,