RejectedSoftware Forums

Sign up

Beta release vibe.d 0.7.29-beta.1

Main changes

  • Drops support for DMD frontend 2.066.x and below (which includes the
    current stable GDC release) and adds support up to 2.071.0
  • Removes all deprecated functionality, as well as the libev driver
  • Contains considerable performance improvement for URLRouter

All changes can be found in the change log:
https://github.com/rejectedsoftware/vibe.d/blob/master/CHANGELOG.md

Please help testing by running dub upgrade --prerelase on your project.

Re: Beta release vibe.d 0.7.29-beta.1

On Fri, 22 Apr 2016 10:13:39 +0200, Sönke Ludwig wrote:

Main changes

  • Drops support for DMD frontend 2.066.x and below (which includes the
    current stable GDC release) and adds support up to 2.071.0
  • Removes all deprecated functionality, as well as the libev driver
  • Contains considerable performance improvement for URLRouter

All changes can be found in the change log:
https://github.com/rejectedsoftware/vibe.d/blob/master/CHANGELOG.md

Please help testing by running dub upgrade --prerelase on your project.

Hi Sönke!

I noticed a breaking change:

https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/http/server.d#L1662

			if (s.startsWith('[')) { // IPv6 address
				auto idx = s.indexOf(']');
				enforce(idx > 0, "Missing closing ']' for IPv6 address.");
				reqhost = s[1 .. idx];
				s = s[idx+1 .. $];
			} else { // host name or IPv4 address
				auto idx = s.indexOf(':');
				if (idx < 0) idx = s.length;
				enforce(idx > 0, "Missing host name.");
				reqhost = s[0 .. idx];
				s = s[idx .. $];
			}

This basically enforces there is a host in the headers, and if there isn't one, it will display the error page.

The bigger issue is that the error page will be called with an half-way initialized req and res which is problematic. Basically req.settings is not set yet so a req.fullURL in the error page call will crash the server.

Maybe just gracefully ignoring these two errors and picking the first v-host and then throwing the exception after more of the request is parsed would be a better response.

What do you think?

Re: Beta release vibe.d 0.7.29-beta.1

On Tue, 03 May 2016 12:47:49 GMT, Marcio Martins wrote:
https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/http/server.d#L1662

			if (s.startsWith('[')) { // IPv6 address
				auto idx = s.indexOf(']');
				enforce(idx > 0, "Missing closing ']' for IPv6 address.");
				reqhost = s[1 .. idx];
				s = s[idx+1 .. $];
			} else { // host name or IPv4 address
				auto idx = s.indexOf(':');
				if (idx < 0) idx = s.length;
				enforce(idx > 0, "Missing host name.");
				reqhost = s[0 .. idx];
				s = s[idx .. $];
			}

This basically enforces there is a host in the headers, and if there isn't one, it will display the error page.

The bigger issue is that the error page will be called with an half-way initialized req and res which is problematic. Basically req.settings is not set yet so a req.fullURL in the error page call will crash the server.

Maybe just gracefully ignoring these two errors and picking the first v-host and then throwing the exception after more of the request is parsed would be a better response.

What do you think?

I've made the Host header optional again, but only for HTTP 1.0. The enforcements now result in a 400 status instead of 500 and the request settings field is now set to the default settings as long as a specific virtual host hasn't been selected.

This still leaves some of the other initializations out (compression, URL parsing, cookie/session parsing, json/form parsing, default response headers), but those shouldn't matter for low level protocol violations anyway. They could be done with the default settings, but that would mean a performance hit for all requests only to support a rare edge case outside of any use case, so I didn't go that far.

Commit: c065005

Re: Beta release vibe.d 0.7.29-beta.1

On Thu, 12 May 2016 12:23:59 GMT, Sönke Ludwig wrote:

On Tue, 03 May 2016 12:47:49 GMT, Marcio Martins wrote:
https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/http/server.d#L1662

			if (s.startsWith('[')) { // IPv6 address
				auto idx = s.indexOf(']');
				enforce(idx > 0, "Missing closing ']' for IPv6 address.");
				reqhost = s[1 .. idx];
				s = s[idx+1 .. $];
			} else { // host name or IPv4 address
				auto idx = s.indexOf(':');
				if (idx < 0) idx = s.length;
				enforce(idx > 0, "Missing host name.");
				reqhost = s[0 .. idx];
				s = s[idx .. $];
			}

This basically enforces there is a host in the headers, and if there isn't one, it will display the error page.

The bigger issue is that the error page will be called with an half-way initialized req and res which is problematic. Basically req.settings is not set yet so a req.fullURL in the error page call will crash the server.

Maybe just gracefully ignoring these two errors and picking the first v-host and then throwing the exception after more of the request is parsed would be a better response.

What do you think?

I've made the Host header optional again, but only for HTTP 1.0. The enforcements now result in a 400 status instead of 500 and the request settings field is now set to the default settings as long as a specific virtual host hasn't been selected.

This still leaves some of the other initializations out (compression, URL parsing, cookie/session parsing, json/form parsing, default response headers), but those shouldn't matter for low level protocol violations anyway. They could be done with the default settings, but that would mean a performance hit for all requests only to support a rare edge case outside of any use case, so I didn't go that far.

Commit: c065005

Looks good Sönke! Thanks!

Second beta released

Am 22.04.2016 um 10:13 schrieb Sönke Ludwig:

Main changes

  • Drops support for DMD frontend 2.066.x and below (which includes the
    current stable GDC release) and adds support up to 2.071.0
  • Removes all deprecated functionality, as well as the libev driver
  • Contains considerable performance improvement for URLRouter

All changes can be found in the change log:
https://github.com/rejectedsoftware/vibe.d/blob/master/CHANGELOG.md

Please help testing by running dub upgrade --prerelase on your project.

The second beta contains some Json and serialization related fixes, as
well as some WebSocket improvements. If no further issues come up, this
will be tagged as a release candidate on June 6th.

Instead of dub upgrade --prerelease you need to manually put
"0.7.29-beta.2" into dub.selections.json, because there is already a
0.7.30-alpha.1 version, which would otherwise be chosen.