Explorar el Código

Several small fixes.

mingodad hace 12 años
padre
commit
d9d38f4125

+ 12 - 5
SquiLu-ourbiz/companies-uk.nut

@@ -7,13 +7,14 @@
 //start dummy nested scope to allow reload without complain about constants already defined 
 //also it hides from outer scope anything declared as local
 {
- 
+
 local globals = getroottable();
 
 local function getCompaniesUkDBFileName(){
 	if (globals.rawget("jniLog", false)) return APP_CODE_FOLDER + "/companies-uk-RG.db";
 	if (globals.rawget("WIN32", false)) return APP_CODE_FOLDER + "/../../companies-uk/companies-uk-RG.db";
-	return APP_CODE_FOLDER + "/../../companies-uk/companies-uk-RG.db";
+	//return APP_CODE_FOLDER + "/../../companies-uk/companies-uk-RG.db";
+	return APP_CODE_FOLDER + "/../../companies-uk/companies-uk-2013-10.db";
 }
 
 local companiesUkDB = null;
@@ -52,6 +53,7 @@ local function getCiaUkSearchList(search_str, search_post_code, search_sic_code,
 	//debug_print(search_str or "nil", "\t",search_post_code or "nil", "\t", search_sic_code or "nil", "\t", page, "\n")
 	//print(search_str, search_post_code, search_sic_code, search_origin_post_code, search_around_post_code , page, limit)
 	//print("AtLine:", __LINE__)
+
 	if (strHasContent(search_str) && search_str.find_lua("%d+") == 0){
 		bind_str1 = search_str;
 		limit = 0;
@@ -181,6 +183,7 @@ limit ? offset ?
 			stmt.bind(xp++, offset);
 		}
 	}
+
 	local result = getDbListFromStmt(stmt, 30);
 	result.push(limit);
 	return  result;
@@ -246,7 +249,7 @@ from post_codes
 where post_code = ?
 ]=]);
 	stmt.bind(1, post_code);
-	local easting, northing;
+	local easting=0, northing=0;
 	if (stmt.step() == stmt.SQLITE_ROW){
 		easting = stmt.col(0);
 		northing = stmt.col(1);
@@ -492,7 +495,7 @@ local function getExtraCompanyData(cid, cnum){
 	}
 }
 
-add_uri_hanlders({
+local my_uri_handlers = {
 	["/search"] = function(request){
 		table_t data = {};
 		data.page_name <- "search_results"
@@ -574,7 +577,11 @@ add_uri_hanlders({
 		request.write_blob(mFile);
 		return true;
 	},
-});
+}
+
+add_uri_hanlders(my_uri_handlers);
+
+ ::MyCompaniesUkLoaded <- true;
 
 } //end dummy nested scope
  

+ 1 - 1
SquiLu-ourbiz/ourbiz-fltk.nut

@@ -27,7 +27,7 @@ Command line parameters.
 -password	password to authenticate
 */
 local appServer_host = app_cmd_parameters.get("-host", "localhost");
-local appServer_port = app_cmd_parameters.get("-port", 8855);
+local appServer_port = app_cmd_parameters.get("-port", 8855).tointeger() ;
 local appServer_user = app_cmd_parameters.get("-user", "mingote");
 local appServer_password = app_cmd_parameters.get("-password", "tr14pink");
 

+ 2 - 0
SquiLu-ourbiz/ourbiz.nut

@@ -3336,6 +3336,8 @@ add_uri_hanlders({
 	["/DB/m"] = ourbizDbMobile,
 });
 
+ ::MyOurBizLoaded <- true;
+ 
 } //end dummy nested scope
 
 

+ 2 - 2
SquiLu-ourbiz/sq-server-plugin.nut

@@ -555,11 +555,11 @@ function apply_uri_filters(request){
 	return false;
 }
 
-if(AT_DEV_DBG || !globals.rawget("checkCompaniesUkDBFile", false)) {
+if(AT_DEV_DBG || !globals.rawget("MyCompaniesUkLoaded", false)) {
 	dofile(APP_CODE_FOLDER + "/companies-uk.nut");
 }
 
-if(AT_DEV_DBG || !globals.rawget("ourbizDB", false)) {
+if(AT_DEV_DBG || !globals.rawget("MyOurBizLoaded", false)) {
 	dofile(APP_CODE_FOLDER + "/ourbiz.nut");
 }
 

+ 4 - 0
SquiLu/sq/sq.c

@@ -534,6 +534,7 @@ SQRESULT sqext_register_csv_parser (HSQUIRRELVM v);
 SQRESULT sqext_register_fltklib(HSQUIRRELVM v);
 SQRESULT sqext_register_dad_utils(HSQUIRRELVM v);
 SQRESULT sqext_register_gumbo(HSQUIRRELVM v);
+SQRESULT sqext_register_sys(HSQUIRRELVM v);
 
 int main(int argc, char* argv[])
 {
@@ -567,7 +568,9 @@ int main(int argc, char* argv[])
 	sqext_register_mix(v);
 	sqext_register_sqfs(v);
 	sqext_register_sq_socket(v);
+#ifdef USE_AXTLS
 	sqext_register_axtls(v);
+#endif
 	sqext_register_sq_zlib(v);
 	sqext_register_mongoose(v);
 	sqrat_register_importlib(v);
@@ -580,6 +583,7 @@ int main(int argc, char* argv[])
 	sqext_register_sq_slave_vm(v);
 	//sqext_register_ThreadObjects(v);
 	sqext_register_dad_utils(v);
+	//sqext_register_sys(v);
 
 #ifdef WITH_FULL_DAD_EXTRAS
 	sqext_register_csv_parser(v);

+ 14 - 0
SquiLu/squilu.cbp

@@ -36,6 +36,7 @@
 					<Add option="-Wall" />
 					<Add option="-DNDEBUG=1" />
 					<Add option="-DWITH_FULL_DAD_EXTRAS=1" />
+					<Add option="-DHAS_UNIX_DOMAIN_SOCKETS=1" />
 					<Add directory="../../zeromq-3.2.2/include" />
 				</Compiler>
 				<Linker>
@@ -409,6 +410,7 @@
 					<Add option="-DPROFILE_SQVM22=1" />
 					<Add option="-D_SQ64=1" />
 					<Add option="-DCONFIG_64=1" />
+					<Add option="-DHAS_UNIX_DOMAIN_SOCKETS=1" />
 					<Add directory="../../zeromq-3.2.2/include" />
 					<Add directory="../fltk" />
 					<Add directory="../libharu/include" />
@@ -444,6 +446,7 @@
 				<Option object_output="obj/Debug/" />
 				<Option type="1" />
 				<Option compiler="gcc" />
+				<Option parameters="test-socket-unix-server.nut" />
 				<Compiler>
 					<Add option="-O2" />
 					<Add option="-Wall" />
@@ -452,6 +455,7 @@
 					<Add option="-DWITH_FULL_DAD_EXTRAS=1" />
 					<Add option="-D_SQ64=1" />
 					<Add option="-DCONFIG_64=1" />
+					<Add option="-DHAS_UNIX_DOMAIN_SOCKETS=1" />
 					<Add directory="../../zeromq-3.2.2/include" />
 				</Compiler>
 				<Linker>
@@ -518,14 +522,17 @@
 			<Add directory=".." />
 			<Add directory="../SquiLu-ext" />
 			<Add directory="/usr/include/mysql" />
+			<Add directory="../gumbo" />
 		</Compiler>
 		<Linker>
 			<Add library="m" />
 			<Add library="uuid" />
+			<Add library="gumbo" />
 			<Add directory="lib" />
 			<Add directory="../myaxtls" />
 			<Add directory="../mpdecimal" />
 			<Add directory="../discount" />
+			<Add directory="../gumbo" />
 		</Linker>
 		<Unit filename="../SquiLu-ext/HighResolutionTimer.cpp" />
 		<Unit filename="../SquiLu-ext/HighResolutionTimer.h" />
@@ -725,6 +732,9 @@
 			<Option target="Release FLTK 64bits" />
 			<Option target="Debug 64bits" />
 		</Unit>
+		<Unit filename="../SquiLu-ext/sq_fastcgi.cpp">
+			<Option target="&lt;{~None~}&gt;" />
+		</Unit>
 		<Unit filename="../SquiLu-ext/sq_fltk.cpp">
 			<Option target="Debug" />
 			<Option target="Release" />
@@ -768,6 +778,7 @@
 			<Option target="Release FLTK 64bits" />
 			<Option target="Debug 64bits" />
 		</Unit>
+		<Unit filename="../SquiLu-ext/sq_gumbo.cpp" />
 		<Unit filename="../SquiLu-ext/sq_markdown.cpp">
 			<Option target="Debug" />
 			<Option target="Release" />
@@ -893,6 +904,9 @@
 			<Option target="Release FLTK 64bits" />
 			<Option target="Debug 64bits" />
 		</Unit>
+		<Unit filename="../SquiLu-ext/sq_sys.cpp">
+			<Option target="&lt;{~None~}&gt;" />
+		</Unit>
 		<Unit filename="../SquiLu-ext/sq_tinyxml2.cpp">
 			<Option target="Debug" />
 			<Option target="Release" />