2

I'm running a .NET on mono 2.10, developed with ServiceStack 3.9.55

When i run the website with IIS Express everything is OK, but with mono 2.10 and fastcgi-server4 the page render extra numbers like 0 and f7e.

I've already tested this o Ubuntu 12, Debian 6 and 7 and the same numbers are displayed.

See it here. http://aaviseu.guilhermecardoso.pt/home

What you think it may be?

UPDATE: This error only appears on 2.10 and it's related with chuncked encoding (on 2x). I don't know when this was fixed, but i'm using 3.2.7 without any problem

Gui
  • 9,555
  • 10
  • 42
  • 54

1 Answers1

1

Looks like you're having a similar problem as me: Binary data corrupted when hosting ServiceStack in Mono + FastCGI - f7e is probably the data size (3966 bytes).

Edit:

This is due to chunked transfers (introduced in HTTP 1.1). I was able to work around my problem by forcing the request to use HTTP 1.0.

On my question knocte suggested a patch to mono that might fix your problem:

Patch: https://bugzilla.xamarin.com/attachment.cgi?id=3356

File: https://github.com/mono/mono/blob/master/mcs/class/System.Web/System.Web/HttpResponse.cs

Community
  • 1
  • 1
woli
  • 105
  • 1
  • 6
  • Unfortunately i'm not skilled enough to do it (yet!). This is what i've done: forked mono projected, made that patch on branch 2.10 in my repo (from github i've edit that file) and i've installed mono from my git repo selecting the branch 2.10. I still get the numbers on response but i'm not sure if i've sucefully installed the modified fork. Do you know how i should do this properly? – Gui Jul 21 '13 at 04:12
  • That's what I would do. To debug it just add a log message temporarily `if (worker_request.GetHttpVersion () == "HTTP/1.1") { string GatewayIface = context.Request.ServerVariables["GATEWAY_INTERFACE"]; use_chunked = (GatewayIface == null || !GatewayIface.StartsWith("CGI")); using (StreamWriter w = File.AppendText("/tmp/my_mono_fork.log")) w.WriteLine("use_chunked={0} GatewayIface={1}", use_chunked, GatewayIface); } else use_chunked = false;` – woli Jul 21 '13 at 08:42