Browse Source

minor patch : global timeout of HttpConnection

Nicolas Cannasse 16 years ago
parent
commit
ce00b1bea5
4 changed files with 11 additions and 2 deletions
  1. 1 0
      doc/CHANGES.txt
  2. 1 1
      std/haxe/Http.hx
  3. 6 1
      std/haxe/remoting/HttpConnection.hx
  4. 3 0
      std/tools/haxelib/Main.hx

+ 1 - 0
doc/CHANGES.txt

@@ -10,6 +10,7 @@
 	flash9 : bugfix when overriding/implementing an method with an applied type parameter
 	flash9 : bugfix when overriding/implementing an method with an applied type parameter
 	php: fixed issues with classes that implement Dynamic
 	php: fixed issues with classes that implement Dynamic
 	all : ignore #! line at beginning of the hx file
 	all : ignore #! line at beginning of the hx file
+	haxelib : added tags, added documentation
 
 
 2009-07-26: 2.04
 2009-07-26: 2.04
 	flash9 : fixed get_full_path error with -D fdb
 	flash9 : fixed get_full_path error with -D fdb

+ 1 - 1
std/haxe/Http.hx

@@ -75,7 +75,7 @@ class Http {
 		params = new Hash();
 		params = new Hash();
 		#if js
 		#if js
 		async = true;
 		async = true;
-		#elseif (neko || php)
+		#elseif (neko || php || cpp)
 		cnxTimeout = 10;
 		cnxTimeout = 10;
 		#end
 		#end
 		#if php
 		#if php

+ 6 - 1
std/haxe/remoting/HttpConnection.hx

@@ -26,6 +26,8 @@ package haxe.remoting;
 
 
 class HttpConnection implements Connection, implements Dynamic<Connection> {
 class HttpConnection implements Connection, implements Dynamic<Connection> {
 
 
+	public static var TIMEOUT = 10;
+
 	var __url : String;
 	var __url : String;
 	var __path : Array<String>;
 	var __path : Array<String>;
 
 
@@ -44,11 +46,14 @@ class HttpConnection implements Connection, implements Dynamic<Connection> {
 		var data = null;
 		var data = null;
 		var h = new haxe.Http(__url);
 		var h = new haxe.Http(__url);
 		#if js
 		#if js
-			untyped h.async = false;
+			h.async = false;
 		#end
 		#end
 		#if (neko && no_remoting_shutdown)
 		#if (neko && no_remoting_shutdown)
 			h.noShutdown = true;
 			h.noShutdown = true;
 		#end
 		#end
+		#if (neko || php || cpp)
+			h.cnxTimeout = TIMEOUT;
+		#end
 		var s = new haxe.Serializer();
 		var s = new haxe.Serializer();
 		s.serialize(__path);
 		s.serialize(__path);
 		s.serialize(params);
 		s.serialize(params);

+ 3 - 0
std/tools/haxelib/Main.hx

@@ -347,6 +347,9 @@ class Main {
 		print("Sending data.... ");
 		print("Sending data.... ");
 		h.request(true);
 		h.request(true);
 
 
+		// processing might take some time, make sure we wait
+		print("Processing file.... ");
+		haxe.remoting.HttpConnection.TIMEOUT = 1000;
 		// ask the server to register the sent file
 		// ask the server to register the sent file
 		var msg = site.processSubmit(id,user,password);
 		var msg = site.processSubmit(id,user,password);
 		print(msg);
 		print(msg);