Browse Source

Dependencis upgraded (#5641)

Xueping 5 years ago
parent
commit
5e77c622d5

+ 2 - 2
frameworks/D/hunt/dub.json

@@ -2,11 +2,11 @@
 	"name": "hunt-minihttp",
 	"targetType": "executable",
 	"description": "A mini http server powered by Hunt.",
-	"copyright": "Copyright (C) 2017-2019, HuntLabs",
+	"copyright": "Copyright (C) 2017-2020, HuntLabs",
 	"homepage": "https://www.huntlabs.net",
 	"license": "Apache-2.0",
 	"dependencies": {
-		"hunt": "~>1.5.0-beta.2",
+		"hunt": "~>1.5.0-beta.3",
 		"std_data_json": "~>0.18.2"
 	},
 	"versions": [

+ 1 - 1
frameworks/D/hunt/http/http/Processor.d

@@ -83,7 +83,7 @@ public:
 	}
 
 	void run() {
-		client.onReceived((ByteBuffer buffer) {
+		client.received((ByteBuffer buffer) {
 			version(NO_HTTPPARSER) {
 				client.write(cast(ubyte[])ResponseData);
 			} else {

+ 5 - 5
frameworks/D/hunt/pico/http/Processor.d

@@ -20,7 +20,7 @@ import std.string;
 import core.stdc.string;
 import core.stdc.stdlib;
 import std.stdio;
-
+import hunt.io.IoError;
 import std.experimental.allocator;
 private	alias Parser = HttpParser!HttpProcessor;
 
@@ -125,7 +125,7 @@ public:
 	}
 
 	void run() {
-		client.onReceived((ByteBuffer buffer) {
+		client.received((ByteBuffer buffer) {
 			version(NO_HTTPPARSER) {
 				client.write(cast(ubyte[])ResponseData);
 			} else {
@@ -138,11 +138,11 @@ public:
 				}
 			}
 		})
-		.onClosed(() {
+		.closed(() {
 			// notifyClientClosed();
 		})
-		.onError((string msg) {
-			 warning("Error: ", msg);
+		.error((IoError msg) {
+			 warning("Error: ", msg.errorMsg());
 		})
 		.start();
 	}

+ 1 - 1
frameworks/D/hunt/pico/http/Server.d

@@ -41,7 +41,7 @@ abstract class AbstractTcpServer {
 		_tcpStreamoption = TcpStreamOptions.create();
 		_tcpStreamoption.bufferSize = 1024 * 4;
 		_tcpStreamoption.isKeepalive = false;
-		_group = new EventLoopGroup(cast(uint) thread*6);
+		_group = new EventLoopGroup(cast(uint) thread);
     //_group = theAllocator.make!EventLoopGroup(cast(uint) thread*2);
 		this._workersCount = workersCount;
     //defaultPoolThreads(thread);