Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get() stalls when called from HTTP::Easy #107

Closed
wants to merge 1 commit into from
Closed

Conversation

drKreso
Copy link

@drKreso drKreso commented Mar 1, 2013

I am not sure if this makes any sense at all. I did run the full spec test suite. It did not break any more than usual. IO tests all passed.

This makes HTTP::Easy work as advertised (and consequently Bailador).

@moritz
Copy link
Member

moritz commented Mar 1, 2013

I fear this patch takes the wrong approach.

Setting the encoding of the socket is necessary to make sure that multi-byte sequences aren't torn apart. For example in UTF-16LE and BE there can be two-byte sequences starting with 0A, but with your patch the 0A would be wrongly recognized as a newline, and terminate the string returned from .get. Subsequent decoding as UTF-16{LE,BE} would fail. Parrot's readline method supposedly already has code that handles this problem.

Have you found out why the current approach does not work? If it's due to a bug in Parrot, we should report it.

(I might consider applying this patch as a last resort anyway, but I'd rather have a proper fix, if at all possible).

@drKreso
Copy link
Author

drKreso commented Mar 1, 2013

I agree, I thought you might say something like that. I am not sure if it's parrot fault or how to recreate there.

@drKreso
Copy link
Author

drKreso commented Mar 1, 2013

I did further logging - it definitely stops on this line:

   my str $line = $PIO.readline(nqp::unbox_s($!input-line-separator));

Host: localhost:3000
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.99 Safari/537.22
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: remember_user_token=BAhbB1sGaQZJIiIkMmEkMTAkOEFlRHpVbkhlRGMuSEo5TU9nOVNaLgY6BkVU--115f241404a6c3d4bbfdd1a4fed7a1873ea54ae2; remember_korisnik_token=BAhbB1sGaQZJIhlSelY5ODFhenJoOXN5eE5QeGl6WQY6BkVG--b7c4594a3f8eb77d1579789982a20c28fc48e168

Then it tries to readline again - and this is where it stops.

@moritz
Copy link
Member

moritz commented Mar 5, 2013

Can you please try the current rakudo code (ie without your patch) with parrot/master? There have been a few fixes to sockets. You can build a rakudo on top of parrot master with

  $ perl Configure.pl --gen-parrot=master && make install

in rakudo's source dir.

@drKreso
Copy link
Author

drKreso commented Mar 6, 2013

I get stuck on bootstraping panda

perl6 bootstrap.pl
==> Bootstrapping Panda
Unable to parse expression in string; couldn't find final "
in any FAILGOAL at src/stage2/QRegex.nqp:1084
in regex string at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/Grammar.pm:25
in regex pair at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/Grammar.pm:7
in regex pairlist at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/Grammar.pm:6
in regex object at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/Grammar.pm:5
in regex value:sym at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/Grammar.pm:21
in any !protoregex at src/stage2/QRegex.nqp:746
in regex value at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/Grammar.pm:11
in regex arraylist at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/Grammar.pm:9
in regex array at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/Grammar.pm:8
in regex TOP at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny/Grammar.pm:4
in method parse at src/gen/CORE.setting:10788
in sub from-json at /Users/kbojcic/dev/nuke/panda/ext/JSON__Tiny/lib/JSON/Tiny.pm:50
in submethod BUILD at /Users/kbojcic/dev/nuke/panda/lib/Panda/Ecosystem.pm:62
in method BUILDALL at src/gen/CORE.setting:759
in method bless at src/gen/CORE.setting:743
in method new at src/gen/CORE.setting:728
in method new at /Users/kbojcic/dev/nuke/panda/lib/Panda.pm:20
in block at bin/panda:108

@FROGGS
Copy link
Member

FROGGS commented Mar 6, 2013

drKreso: this got fixed right now, please try again with rakudo HEAD.

@colomon
Copy link
Contributor

colomon commented Mar 6, 2013

On Wed, Mar 6, 2013 at 3:03 AM, Kresimir Bojcic
notifications@github.com wrote:

I get stuck on bootstraping panda

I can confirm this has been fixed in the very latest Rakudo.

Solomon Foster: colomon@gmail.com
HarmonyWare, Inc: http://www.harmonyware.com

@drKreso
Copy link
Author

drKreso commented Mar 6, 2013

Ok, panda thing is working.
HTTP::Easy test server - blocks exactly same way

@labster
Copy link
Member

labster commented May 17, 2015

I'm going to tag this ticket as Parrot specific, because it seems to be related to the readline bugs noted above. And there's not enough information to otherwise reproduce the bug here. Let me know if this affects other VMs.

@lizmat
Copy link
Contributor

lizmat commented Jun 11, 2015

Since parrot is no longer is a supported VM, I'm closing this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants