Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Is chunked transfer encoding supported by Cassini?
rupertl
#1 Posted : Wednesday, February 28, 2007 5:43:33 AM(UTC)
Groups: Member
Joined: 2/28/2007(UTC)
Posts: 3
Location: Maryland,USA

I am developing a site to receive uploaded data from mobile handsets (the client is J2ME), that send HTTP uploads using chunked encoding.

This works with IIS, but not with Cassini (or the ASP.NET dev server).

To test this I use cURL(http://curl.haxx.se/) with a test upload page that echoes POSTed fields or attached files.
Code:

C:\Program Files\cURL>curl -X POST -H "Transfer-Encoding: chunked" --form "upload=@README" http://localhost:3030/upload.aspx --show-error --verbose

* About to connect() to localhost port 3030 (#0)
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 3030 (#0)
> POST /upload.aspx HTTP/1.1
> User-Agent: curl/7.16.0 (i586-pc-mingw32msvc) libcurl/7.16.0 zlib/1.2.2
> Host: localhost:3030
> Accept: */*
> Transfer-Encoding: chunked
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=----------------------------f7783df477cd
>
< HTTP/1.1 200 OK
< Server: UltiDev Cassini/2.1.4.3
< Date: Wed, 28 Feb 2007 15:32:25 GMT
< X-AspNet-Version: 2.0.50727
< Cache-Control: private
< Content-Type: text/html; charset=utf-8
< Content-Length: 50
< Connection: Close
**** Form Fields *****<br><br>**** Files *****<br>* Closing connection #0



This will work OK if the -H "Transfer-Encoding: chunked" is removed...

Code:
C:\Program Files\cURL>curl -X POST --form "upload=@README" http://localhost:3030/upload.aspx --show-error --verbose
* About to connect() to localhost port 3030 (#0)
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 3030 (#0)
> POST /upload.aspx HTTP/1.1
> User-Agent: curl/7.16.0 (i586-pc-mingw32msvc) libcurl/7.16.0 zlib/1.2.2
> Host: localhost:3030
> Accept: */*
> Content-Length: 2000
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=----------------------------d1c5d26d570a
>
< HTTP/1.1 100 Continue
< Server: UltiDev Cassini/2.1.4.3
< Date: Wed, 28 Feb 2007 15:34:27 GMT
< Content-Length: 0
< HTTP/1.1 200 OK
< Server: UltiDev Cassini/2.1.4.3
< Date: Wed, 28 Feb 2007 15:34:27 GMT
< X-AspNet-Version: 2.0.50727
< Cache-Control: private
< Content-Type: text/html; charset=utf-8
< Content-Length: 72
< Connection: Close
**** Form Fields *****<br><br>**** Files *****<br>README length=1800<br>* Closing connection #0









Ultidev Team
#2 Posted : Wednesday, February 28, 2007 5:58:20 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi there!

UltiDev Cassini can do Response chunking, but as for the Request - we'll need some time to go through the code. It may be the case that requests have to have Content-length header set.

We'll post more definite answer later today.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Ultidev Team
#3 Posted : Wednesday, February 28, 2007 4:44:58 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi again.

We've looked through Cassini code for both CLR 1.1 and 2.0 and didn't see anything obvious that would Cassini not pick up chunked requests. After more careful looking at the snippets you've sent, we couldn't see exactly the manifestation of the problem. Could you please tell us how exactly does the error look like?

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
rupertl
#4 Posted : Thursday, March 1, 2007 4:55:39 AM(UTC)
Groups: Member
Joined: 2/28/2007(UTC)
Posts: 3
Location: Maryland,USA

Hi again,

The cURL command is POSTing a file called README to the following script:

Code:
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("**** Form Fields *****<br>");
foreach (string formVal in Request.Form)
{
Response.Write(formVal);
Response.Write("=");
Response.Write(Request.Form[formVal]);
Response.Write("<br>");
}

Response.Write("<br>**** Files *****<br>");
foreach (string file in Request.Files)
{
Response.Write(Request.Files[file].FileName);
Response.Write(" length=");
Response.Write(Request.Files[file].ContentLength);
Response.Write("<br>");
}

Response.End();
}


In the first case (without chunked transfer) the script is printing out the uploaded file name & length as expected. When chunking is enabled, no file attachments or form fields are seen (look for the 'README length=1800' in the last line). When using IIS or Apache/PHP, the attachment is seen in both cases. I have verified that cURL is generating the chunked transfer correctly.

Thanks for your help

Rupert

Ultidev Team
#5 Posted : Thursday, March 1, 2007 6:37:57 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Now we see the problem, thank you.

Does the problem occur with form fields too - the snippet shows difference only for uploaded files.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
rupertl
#6 Posted : Thursday, March 1, 2007 11:02:45 AM(UTC)
Groups: Member
Joined: 2/28/2007(UTC)
Posts: 3
Location: Maryland,USA

Yes - no form fields are seen either

Regards,

Rupert
Ultidev Team
#7 Posted : Thursday, March 1, 2007 3:58:30 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Rupert,

thank you for the report. We've logged the issue and will do our best to address it in the next release of UltiDev Cassini.

All the best,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Rss Feed  Atom Feed
Users browsing this topic
Guest (3)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.