Giter VIP home page Giter VIP logo

Comments (25)

jcheng5 avatar jcheng5 commented on August 10, 2024

I believe env$rook.input$read() should give you a raw vector with all the data.

from httpuv.

jeroen avatar jeroen commented on August 10, 2024

No need to pass it an argument?

from httpuv.

jcheng5 avatar jcheng5 commented on August 10, 2024

I don't remember about rook in general, but for httpuv, the default value is -1 which means return everything.

from httpuv.

jeroen avatar jeroen commented on August 10, 2024

OK I got it to work now. The problem was that I was unaware that the rewind() method needs to be called before being able to read the data.

from httpuv.

jcheng5 avatar jcheng5 commented on August 10, 2024

Hmmm, you shouldn't need to call rewind() first. Is there a bug?

from httpuv.

jeroen avatar jeroen commented on August 10, 2024

There is some funky stuff going on. Also it doesn't work consistently if I upload some (larger) files. Could it be that some buffer is not properly cleared in between requests or so?

from httpuv.

jcheng5 avatar jcheng5 commented on August 10, 2024

It's certainly possible. How large?

from httpuv.

jcheng5 avatar jcheng5 commented on August 10, 2024

And what version of Rcpp do you have installed?

from httpuv.

jeroen avatar jeroen commented on August 10, 2024

It happens occasionally (not consistently) when uploading files of +/-
10MB. I have Rcpp_0.10.3 right now. I'll upgrade it.

On Fri, Jun 14, 2013 at 3:48 PM, Joe Cheng [email protected] wrote:

And what version of Rcpp do you have installed?


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-19485726
.

from httpuv.

jeroen avatar jeroen commented on August 10, 2024

I updated Rcpp and httpuv and at least part of the problem seems to have disappeared...

from httpuv.

jcheng5 avatar jcheng5 commented on August 10, 2024

In my own tests I couldn't find any problem when conducting requests serially, even with requests that are hundreds of MB. However there appear to be a quite serious bug in concurrent uploads that I had not detected until now. I'll get it fixed ASAP. Thanks!

from httpuv.

jeroen avatar jeroen commented on August 10, 2024

Just to clarify: I am writing a multipart/form-data parser and it works fine most of the time, but for sometimes when I do a request in chrome (usually though an iframe in the browser) the input seem contains nothing but jibberish. Could it be that the request body is gzipped or so? Otherwise it might be a bug in chrome.

from httpuv.

jcheng5 avatar jcheng5 commented on August 10, 2024

It's possible. You could check for the header, then ungzip it in R just to
see if that fixes it. If so we can see about handling that transparently in
httpuv.

On Fri, Jun 14, 2013 at 8:18 PM, Jeroen [email protected] wrote:

Just to clarify: I am writing a multipart/form-data parser and it works
fine most of the time, but for sometimes when I do a request in chrome
(usually though an iframe in the browser) the input seem contains nothing
but jibberish. Could it be that the request body is gzipped or so?
Otherwise it might be a bug in chrome.


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-19490474
.

from httpuv.

jcheng5 avatar jcheng5 commented on August 10, 2024

gzcon has an allowNonCompressed flag that should let you always wrap it, at least for testing.

On Fri, Jun 14, 2013 at 10:29 PM, Joe Cheng [email protected] wrote:

It's possible. You could check for the header, then ungzip it in R just to
see if that fixes it. If so we can see about handling that transparently in
httpuv.
On Fri, Jun 14, 2013 at 8:18 PM, Jeroen [email protected] wrote:

Just to clarify: I am writing a multipart/form-data parser and it works
fine most of the time, but for sometimes when I do a request in chrome
(usually though an iframe in the browser) the input seem contains nothing
but jibberish. Could it be that the request body is gzipped or so?
Otherwise it might be a bug in chrome.


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-19490474
.

from httpuv.

jeroen avatar jeroen commented on August 10, 2024

Hmm so the problem is not gzip, turns out the request body is just truncated. It's really strange, it only happens for chrome + httpuv. It doesn't happen in firefox or using rhttpd. I'll try to debug it a bit further.

from httpuv.

jcheng5 avatar jcheng5 commented on August 10, 2024

What version of Chrome? What operating system?

On Sat, Jun 15, 2013 at 1:04 PM, Jeroen [email protected] wrote:

Hmm so the problem is not gzip, turns out the body is just truncated. It's really strange, it only happens for chrome + httpuv. It doesn't happen in firefox or using rhttpd. I'll try to debug it a bit further.

Reply to this email directly or view it on GitHub:
#8 (comment)

from httpuv.

jeroen avatar jeroen commented on August 10, 2024

It happens on all chrome, in all three OS (Linux, Win, OSX). It's tricky to reproduce, because it only seems to happen when I post a form targeting an iframe (ajax does not support file uploads). Maybe it's just something funky on chrome that somehow is triggered by headers from httpuv or so.

from httpuv.

jeroen avatar jeroen commented on August 10, 2024

I'm having such a hard time narrowing this down. In case you want to reproduce:

install_github("ocpu", "jeroenooms")
library(ocpu)

Should popup two browsers. In the httpuv one, fill out the fields as shown in the picture and click the 'iframe' button. For debugging purposes, a file containing a dump of the request-body of each POST request is saved on your desktop.

screenshot

from httpuv.

jeroen avatar jeroen commented on August 10, 2024

I just installed the latest version from github and I think the problem has disappeared with your latest fix.

from httpuv.

jcheng5 avatar jcheng5 commented on August 10, 2024

Ok great. That would make sense as the bug I fixed would've resulted in truncation.

​Sorry for the inconvenience!

On Sat, Jun 15, 2013 at 2:26 PM, Jeroen [email protected] wrote:

I just installed the latest version from github and I think the problem has disappeared with your latest fix.

Reply to this email directly or view it on GitHub:
#8 (comment)

from httpuv.

jeroen avatar jeroen commented on August 10, 2024

Thanks for the quick fix :-) Closing this issue now. PS: will you be in Spain for user 2013 next month?

from httpuv.

jcheng5 avatar jcheng5 commented on August 10, 2024

Yes, you?

from httpuv.

jeroen avatar jeroen commented on August 10, 2024

yes :) See you there.

On Sat, Jun 15, 2013 at 3:48 PM, Joe Cheng [email protected] wrote:

Yes, you?


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-19504757
.

from httpuv.

jeroen avatar jeroen commented on August 10, 2024

Is there an easy way to build this new version for windows? I would like to test it on win, but I can't get it to compile.

from httpuv.

jeroen avatar jeroen commented on August 10, 2024

Ah I just discovered Uwe's win-builder service :-) Here is a copy of the win build for R 3.0.1 if someone else is interested: http://www.stat.ucla.edu/~jeroen/httpuv_1.0.6.99.zip

from httpuv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.