Camelia, the Perl 6 bug

IRC log for #mojo, 2011-08-25

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:37 perlrocks Twitter: "Mojolicious Web Framework - Join the Perl revolution! http://t.co/JgQd1ue" --perl_m8y http://twitter.com/perl_m8y​/status/106525625128460288
00:49 Akron joined #mojo
00:58 Alias joined #mojo
01:06 mattastrophe joined #mojo
01:21 d4rkie joined #mojo
01:24 Skylos joined #mojo
01:29 xaka joined #mojo
01:39 mattastrophe joined #mojo
02:03 tempire There hasn't been a topic set for ages.
02:03 tempire I'm going to set it.
02:04 sri i can see one
02:04 tempire hmm
02:04 Topic for #mojo is now join the revolution ♥ http://mojolicio.ushttp://irclog.perlgeek.de/mojo/today
02:05 jwang I saw that
02:05 tempire there we go
02:05 sri suppose it doesn't survive netsplit
02:06 sri some good points brought up by the Sjors guy earlier btw
02:07 sri i'll change our redirect code a bit to be closer to browser behavior
02:07 sri it seems they all handle it rather sane now, we should have proper support for unit testing
02:09 sri i'll go for 301, 302, 303 and 307 i guess
02:10 sri i knew $req->is_dynamic would come in handly some day :)
02:10 sri now i can use it to determine if a message is cloneable
02:23 crab hi
02:28 * sri waves
02:28 crab it's good to know about 307
02:29 crab i could very much use that in some stuff i do (though i wonder how IE would behave, since i have to support IE)
02:29 tempire I didn't even know about 307 before.
02:29 tempire either.
02:31 sri according to his tests it works http://dazjorz.com/fwd/
02:31 sri just links doesn't do it… lol
02:34 crab wow, this is cool.
02:35 crab i'm still not used to the whole "can haz new http/html/whatever features in web apps" thing.
03:24 tempire You know, jobs.perl.org really needs a comments section
03:25 tempire would be good to let potential hires know some of the realities of some of these posters
03:42 xaka i found only one job where mojolicious is required, ah!
04:04 Skylos you want to comment on the employers
04:04 Skylos or the job descriptions
04:19 GitHub194 joined #mojo
04:19 GitHub194 [mojo] kraih pushed 1 new commit to master: http://git.io/fjH9oQ
04:19 GitHub194 [mojo/master] improved redirect support in Mojo::UserAgent to be closer to commonly used browsers - Sebastian Riedel
04:19 GitHub194 left #mojo
04:19 sri added *a few* new tests :)
04:20 Skylos I appalaud
04:31 yko_ joined #mojo
04:33 GitHub108 joined #mojo
04:33 GitHub108 [mojo] kraih pushed 1 new commit to master: http://git.io/i2Jbug
04:33 GitHub108 [mojo/master] added a few more tests - Sebastian Riedel
04:33 GitHub108 left #mojo
04:35 sri cloning requests is tricky, i've cheated a bit and reused the actual content
04:42 sri still remember when i was celebrating 5000 unit tests
04:42 sri now we are already at 7000 :)
04:44 Skylos yay!
04:44 Skylos what are thecodecoverage statistics
04:45 sri think it was something above 90% last time
04:45 Skylos excellent
04:45 sri 96 or so
04:45 sri it's mostly just the commands that are not covered
04:47 sri pretty much everything with an api was developed using TDD
04:47 * Skylos tortures the command developer.
04:48 tempire the employers, of course
04:52 tempire employers don't have enough checks and balances
04:53 sri first we need to get rid of cpanratings
04:54 tempire looks like they removed blue
04:54 sri nope
04:55 sri he actually changed his rating from 2 to 1 star -.-
04:55 sri fucking troll
04:55 tempire oh, there he is
04:55 sri you can see that he upvoted his own rating 10 times...
04:55 sri it's has almost exactly 10 votes more than everything around it
04:56 tempire well, it's possible other people felt the same way
04:56 tempire blue doesn't bother me
04:56 sri i've mailed ask a few times now… and didn't even get a response
04:57 tempire actually, the only thing I mind about cpanratings is the design
04:57 sri maybe i'll really invest a weekend and build a bot to gamble the system myself
04:58 tempire NO!
04:58 * tempire reprograms sri to work on mongodb
04:58 * sri turns around and works on mongodb
05:03 omega sri: thats good :)
05:05 preflex_ joined #mojo
05:25 alpha6 joined #mojo
05:41 noganex_ joined #mojo
05:44 Drossel joined #mojo
05:54 perlrocks Twitter: "Mojolicious 1.91 by SRI - http://t.co/NdnvFYP" (ms) --cpan_new http://twitter.com/cpan_new​/status/106605393685389313
05:57 GitHub113 joined #mojo
05:57 GitHub113 [mojo] kraih pushed 1 new commit to master: http://git.io/U5FGkg
05:57 GitHub113 [mojo/master] documentation tweaks - Sebastian Riedel
05:57 GitHub113 left #mojo
06:02 GitHub96 joined #mojo
06:02 GitHub96 [mojo] kraih pushed 1 new commit to master: http://git.io/1sUg9Q
06:02 GitHub96 [mojo/master] move architecture overview again - Sebastian Riedel
06:02 GitHub96 left #mojo
06:17 koban` joined #mojo
06:23 Firkin joined #mojo
06:31 marcus MOJOLICIOUS TRAIN KEEPS ROLLING *CHUU* *CHUU*
06:31 sri *CHUU* *CHUU*
06:33 zakame woo
06:38 marcus sri: If you're going to invest a weekend in gambling a system, I'd choose the stock market system rather than cpanratings :p
06:39 marcus sri: did you see my question yesterday about printing the url of the response in MOJO_USERAGENT_DEBUG?
06:39 sri that's not very geeky...
06:40 sri nope, but i don't like that idea that much anyway
06:42 marcus sri: it's pretty hard to know which response you are looking at when you do parallel requests with xml responses.
06:42 marcus as it stands today..
06:43 sri MOJO_USERAGENT_DEBUG is not a general purpose debug tool for endusers
06:43 sri it has always been a tool for me to find bugs
06:43 marcus well, it's bloody useful to see what's going on for end users.
06:43 marcus and it's documented :)
06:43 sri ...
06:44 marcus sri: how would you debug your http request as an end user if not using USERAGENT_DEBUG?
06:44 sri i actually told moritz this would happen when he bugged me about documenting it ;p
06:44 marcus :D
06:45 sri don't know
06:45 sri but i'm very much against adding that much code to Mojo::UserAgent
06:46 sri my main problem
06:46 purl sri, your main problem is, like, the name
06:46 sri :O
06:47 marcus :o
06:48 Eugene joined #mojo
06:48 irs death and taxes!
06:48 purl i think death and taxes is http://www.deviantart.com/view/9410862/
06:52 maja joined #mojo
06:54 sromanov joined #mojo
06:54 marcus irs: death and taxes are my main problems as well
07:08 irs marcus: here's the deal, adding the url would be 40 extra lines of code in Mojo::UserAgent, if you can remove that many lines (refactoring, moving code into other modules) we can talk :D
07:10 irs (my ultimate goal is to have Mojo::UserAgent just be glue)
07:11 irs A CHALLENGE!
07:11 purl hmmm... a challenge is if p6 is largely defined by a prelude of p6 multi's, the performance of my p6 implementation ends up hightly dependent on the performance of my multi implementation.
07:12 irs purl: forget a challenge
07:12 purl irs: I forgot challenge
07:15 irs hmm… maybe not the smartest move… he might actually do it :S
07:16 random joined #mojo
07:22 cosmincx joined #mojo
07:29 alpha6 joined #mojo
07:36 kaare joined #mojo
07:52 spleenjack joined #mojo
08:10 judofyr joined #mojo
08:36 sugar joined #mojo
09:01 perlrocks joined #mojo
09:05 cosmincx1 joined #mojo
09:31 rhaen moin
09:33 rhaen well well.
09:49 rhaen I love this Mojolicious!
09:50 irs then you're at the right place! ;p
09:50 perlrocks Twitter: "I love # Mojolicious! # Perl" (de) --rabenfeder http://twitter.com/rabenfede​r/status/106664717971501057
10:09 rhaen install Mojolicious;
10:09 rhaen Do I need more modules these days?
10:09 rhaen that should be fine for all my tasks.
10:12 perlrocks Twitter: "Helicon Zoo - a repository of web frameworks (RoR, Django, Perl, Mojolicious)  for MS IIS using msdeploy. http://t.co/ZPmne6B" --socrat3z http://twitter.com/socrat3z​/status/106670209405960192
10:41 arpadszasz_ joined #mojo
10:59 ispy_ joined #mojo
11:15 rhaen hm, I thought you can have a private repo on github for like 7 days or so.
11:15 rhaen ok, ok...
11:24 remex joined #mojo
11:41 cosimo joined #mojo
12:01 koban` joined #mojo
12:09 cosimo anyone here faced problems parsing cookies with comma in the value?
12:09 cosimo we're seeing this with salesforce generated cookies
12:10 cosimo stuff like '__kti=123456789,www.bullshit.com,lalala ; __ktv=...'
12:13 rhaen huh.
12:14 rhaen never dealt with comma separated stuff.
12:16 cosimo it starts thinking that www.bullshit.com is a cookie name and everything goes wrong from there on
12:20 Eugene joined #mojo
12:24 crab cosimo: test case!
12:24 purl test case is what made it possible to fix the problem anyway
12:24 cosimo crab: https://github.com/cosimo/mojo/commit/7​06f1be99d294156f7f2e402d6341f122be07eb8
12:25 cosimo I have a fix too, but it's quite horrible
12:42 cosimo crab, any input?
12:43 Skylos you know cosimo, I don't quite fullyunderstand your test case, but I'm trying to understand why I don't see any negative in the test.
12:44 marcus cosimo: shouldn't salesforce escape it?
12:48 marcus Skylos: it gives failures here
12:49 marcus t/mojo/cookie.t
12:49 Skylos marcus - Idon't mean 'the tests fail',Imean 'the tests indicate both that the function does what its supposed to and does not do what its not supposed to'
13:00 gtsafas joined #mojo
13:17 sugar joined #mojo
13:21 cosimo marcus: they should, yes
13:21 cosimo however, they don't do it. so we're left with not many options, are we?
13:21 marcus cosimo: and browsers work with these cookies?
13:22 cosimo they do, yes
13:22 marcus :-/
13:24 cosimo I agree that's lame of sf to do this, but we knew already that the world is not perfect
13:25 cosimo in this unfortune case, since that stupid sf cookie is set on the opera.com domain, it prevents me from using mojolicious on *any* <something>.opera.com
13:26 cosimo which is what I'm trying to do :-|
13:26 Skylos Does it crash  the cookie parser?
13:27 cosimo Skylos: look at the test case, it swaps cookie names with values, so the cookie list is destroyed
13:27 Skylos if you put in some doesn't's
13:27 Skylos to say 'what this is doing, it shouldn't do'
13:28 Skylos It would be more obvious to me.  I'm having trouble understanding whatit IS doing, the tests indicate what it should do.  Probably a personal problem though.
13:28 cosimo i just assembled it quickly, but yes, it should explain
13:29 Skylos so you'r getting __kti in the value spot?
13:29 Skylos and 131... in the key?
13:29 marcus cosimo: I'm sure sri will sort you out once he comes back, seems like a real problem to me.
13:30 cosimo Skylos: yes
13:30 cosimo marcus: i could open an issue on gh perhaps
13:30 cosimo Skylos: actually that happens starting with the second cookie __ktv or whatever
13:30 Skylos _tokenize isn't giving the right result.
13:30 marcus cosimo: yeah
13:31 Skylos do you know where _tokenize method is defined?
13:31 Skylos probably Mojo::cookie
13:31 Skylos its $Mojo::Cookie::NAME_RE
13:32 Skylos I suspect the commas are confusing it.
13:33 cosimo Skylos: the problem is with VALUE_RE I think
13:33 Skylos values can't have commas.
13:33 Skylos indeed, you have a point.
13:34 Skylos cosimo - you test a patch of remove \, from VALUE_RE?
13:34 cosimo Skylos: yes, it fixes the problem while passing all the other tests
13:35 Skylos cosimo - bonus.  Commit it!  ;)
13:35 cosimo not sure actually
13:35 Skylos it passes allt he other tests.
13:36 Skylos how much more sure can you be?
13:36 Skylos can you think of a pattern where this would break something?
13:37 cosimo Skylos: RFC 2965, "a server SHOULD also accept comma (,) as the separator between cookie-values for future compatibility"
13:37 cosimo now
13:38 Skylos cosimo - that would require a mode that handles ='s between ,'s.
13:38 cosimo i'm not sure if that means between different cookies, or between values of the same cookie?
13:38 cosimo Skylos: yeah
13:38 Skylos thats incompatible with http://objectmix.com/inetserver/283921-best-pr​actices-cookies-classic-asp-memory-usage.html
13:38 Skylos because they're using commas in a cookie that have nothing to do with that, right?
13:39 Skylos hmm.
13:39 Skylos I think the tokenization strategy is a little wonky for that concept.
13:41 Skylos make a new test
13:41 Skylos forming a cookie similarly
13:42 Skylos only using commas as the separator between cookie-values.
13:42 Skylos oh hoh, I think I'm seeing the syntax now.
13:42 Skylos cookie          =  "Cookie:" cookie-version 1*((";" | ",") cookie-value)
13:42 Skylos cookie-value    =  NAME "=" VALUE [";" path] [";" domain] [";" port]
13:43 Skylos When they say 'cookie value' they're at the tokenization level of 'cookie-value' whichis outside the realm of the name=value;path;domain;port
13:45 Skylos the sepparator is only in that first line.
13:46 Skylos wher eit can be ; or ,
13:47 Skylos in section 4.1.7 it shows a cookie with 7 parts.
13:48 Skylos but cookie-value is repeated twice.
13:49 Skylos so IF cookie-string is an RFC2965 cookie string
13:50 Skylos THEN each key that does not start with a $ is the beginning of a new cookie-value
13:54 judofyr what's the Mojo DEBUG AGENT environment variables again?
13:55 judofyr found it! MOJO_USERAGENT_DEBUG
14:05 d4rkie joined #mojo
14:07 perlrocks Twitter: "Mojolicious::Plugin::I18N - search.cpan.org http://t.co/ImjjmuD" --perl_m8y http://twitter.com/perl_m8y​/status/106729460266577920
14:11 arthas joined #mojo
14:16 shonorio joined #mojo
14:21 koban` left #mojo
14:22 arpadszasz joined #mojo
14:51 abra joined #mojo
14:57 rhaen wHEEEEEEEEEEEEEEEEEEEEEEEEEEEEE-OH!
15:16 Eugene joined #mojo
15:26 marty joined #mojo
15:50 xaka joined #mojo
15:53 Eugene joined #mojo
16:09 rhaen hm.
16:12 rhaen oh, well - well.
16:15 Skylos well.
16:18 rhaen Any experiences with Mojolicious::Plugins?
16:18 Skylos sorry no
16:18 rhaen What's the way to return data from them?
16:18 Skylos least on my part.
16:18 rhaen ah, ok:)
16:19 Skylos I've done DBIX::Class plugins.  dunno if its similar even.
16:20 rhaen good question :)
16:21 rhaen gimme a sec
16:22 rhaen cleaning up code :)
16:22 rhaen ah, nm, I might have found it :)
16:24 Skylos yay!
16:25 rhaen yo :(
16:25 rhaen the problem is simple. I am using an async operation to get image data from the internet
16:26 rhaen but I try to return data before the image is sent to me.
16:26 rhaen therefore: it won't work.
16:26 purl That's because you can't just stick your bomb into someone else's country and expect it to work!
16:26 * rhaen hugs purl.
16:26 * purl hugs rhaen back
16:28 Skylos Can you return a 'ask me later'?
16:28 Skylos I can see how that would bea problem.
16:28 Skylos I like to use closures for that.
16:28 rhaen hm. probably. Time for a break.
16:28 Skylos "retrieve this images and pass it to *this* code block"
16:29 rhaen Maybe this will clear a few things
16:29 Skylos and that code block does what it needs to when it has the data to operate with.
16:29 rhaen this is the code
16:29 rhaen https://github.com/rhaen/Mojolicious-Plugin-​QR/blob/master/lib/Mojolicious/Plugin/QR.pm
16:29 rhaen it works perfectly with line 39.
16:29 tze` joined #mojo
16:29 rhaen I get the image and it is stored in $result. Cool
16:30 rhaen uups, return missing in 46.
16:31 rhaen However, data might be returned empty as the cb function is not fired at that point.
16:31 rhaen I am quite new to async programming style - so it's a new exp.
16:32 Skylos closures are awesome for async.
16:32 Skylos no wait loop
16:33 rhaen true. Anyway - time to head home, then I'll give it another chance.
16:47 perlrocks Twitter: "Stuck with a #mojolicious problem. Returning data from a plugin which does an async call. Time for a small break. #perl" --rabenfeder http://twitter.com/rabenfede​r/status/106769701828427776
16:51 perlrocks Twitter: "We should plan a #mojoconf for 2012. I'll organize it. Join #mojo tonight for more information. #mojolicious #perl" --rabenfeder http://twitter.com/rabenfede​r/status/106770748340842496
17:01 SmokeMachine joined #mojo
17:44 Kulag joined #mojo
17:46 stephen joined #mojo
18:09 metaperl joined #mojo
18:15 Firkin left #mojo
18:38 tabbi joined #mojo
18:38 tabbi left #mojo
18:50 irs eeep
18:50 Skylos yah?
18:50 purl i heard yah was at a point of agreement almost
18:50 irs that's some fucked up cookie
18:51 Skylos there's no accounting for programmers.
18:52 irs but if in doubt i go with the netscape spec http://curl.haxx.se/rfc/cookie_spec.html
18:52 alpha6 joined #mojo
18:52 Skylos some programmers don't seemto know formal specs exist
18:52 irs even google.com sends netscape cookies
18:52 vel joined #mojo
18:53 Skylos netscape pretty much invented them.
18:53 Skylos does netscape cookie prohibit commas
18:54 Skylos indeed it does.
18:54 irs doesn't look that way
18:54 irs oh?
18:54 Skylos This string is a sequence of characters excluding semi-colon, comma and white space.
18:54 Skylos right uner NAME=VALUE
18:54 irs damn
18:55 Skylos So, yes, they absolutely clearly violate netscape spec.
18:55 Skylos so (technically speaking) failing to parse it is not a bug.
18:55 sugar joined #mojo
18:55 irs technically not
18:55 irs it gets even worse
18:56 Skylos recovering from itcleanly so other cookies are not affected is a bug though.
18:56 Skylos or rather failing to is a bug.
18:56 irs the http spec allows us to join header values with commas
18:56 Skylos how so
18:57 Skylos Multiple message-header fields with the same field-name MAY be present in a message if and only if the entire field-value for that header field is defined as a comma-separated list
18:57 Skylos So Cookie: five,six === Cookie: five\nCookie: six
18:58 Skylos Which works perfectly legitimately for RFC2965
18:58 irs "It MUST be possible to combine the multiple header fields into one
18:58 irs "field-name: field-value" pair, without changing the semantics of the
18:58 irs message, by appending each subsequent field-value to the first, each
18:58 irs separated by a comma."
18:58 irs RFC2616
18:58 Skylos Ooh, awesome ammunition.
18:58 Skylos Not only broke by netscape
18:58 Skylos But broke by RFC2616
18:59 Skylos And by RFC2965, as , is a reserved special
18:59 Skylos (though it is technically posisble to distinguish comma abuse from intention based on other patterns in RFC2965)
19:01 Skylos here's a thought.
19:01 Skylos What if we used that It MUST be possible to combine the multiple header fields into one01
19:02 Skylos in order to legitimize a reverse map
19:02 Skylos if it must be possible to combine them
19:02 Skylos it must be possible to uncombine them.
19:03 Skylos @cookievalues = split /,|;\s*/
19:03 Skylos Then process cookievalues through name/value pairs, and use the order to distinguish the correlation per 2965 where $Version is involved.
19:04 irs actually, the solution proposed by cosimo seems to work ok
19:04 Skylos because the non $-prepended names in RFC2616 must occur first, and $Version signals the beginning.
19:04 Skylos nya, I mean, RFC2965.
19:04 irs joining multiple header values seems to work too
19:04 irs in the end it's not what the rfc says, but what browsers actually do :S
19:04 Skylos which solution was that?
19:05 irs just changing the regex to allow , in values
19:05 Skylos (heh, I suggestedthat)
19:05 Skylos Does that still allow my new test to work?
19:06 Skylos http://pastebin.com/6CcCuLRK
19:06 Skylos I don't know if he incorporated this test in there, as a valid 2965 cookie parse test.
19:07 Skylos my checkout barfs hard
19:07 Skylos t/mojo/cookie.t ............................ 1/105 Modification of non-creatable array value attempted, subscript -1 at /home/dihnen/mojo/blib/lib/Mojo/Cookie/Request.pm line 23.
19:07 irs no, but i don't care until i see that cookie in the wild
19:07 * Skylos frowns.
19:08 irs welcome to the wonderful reality of web development ;p
19:08 Skylos the reality that people will ignore RFCs and simultaneously complain when people don't follow them?
19:08 Skylos you're merely part of the problem if you don't handle RFC'd formats.
19:08 irs exactly that reality
19:09 Skylos is it worth being incompatible to save the minimal time to comply?
19:10 irs if you can make it work without turning the parser into a total mess, feel free
19:12 rhaen hmpf. I don't get it.
19:15 irs oh, it actually breaks tests elsewhere
19:15 Skylos non-cookie unit tests?
19:16 irs message.t
19:16 irs joining header values doesn't work somewhere
19:16 Skylos do you think should ignore that non-compliance or should fixit
19:26 Skylos oh fug.  expires has a comma in it.
19:27 rhaen huah, this async stuff kills me one day.
19:27 Skylos Netscape Set-Cookie can't be stacked by RFC2616 unless the comma is escaped.
19:28 irs i don't see a way to solve this spec compliant
19:29 Skylos not as a general solution
19:29 irs not at all
19:29 Skylos But you can have an RFC2965 solution
19:29 Skylos And a netscape solution
19:29 Skylos which if detected ignores 2616.
19:29 irs which browsers actually use the rfc?
19:30 Skylos cookie value form is dependent on code not browser.
19:30 Skylos that is, if a value has commas in it, its not because the browser putit there.  its because the web server did.
19:31 Skylos its a blind string for its value as far as the browser is concerned, beyond the expires/path/secure/domain attributes
19:31 gtsafas Skylos: greek?
19:31 purl it has been said that greek is nice too, I hear. or illlegible to idiots who can't read Greek. or illegible to geniuses who can't read Greek or greek to me
19:32 Skylos gtsafas - gia sou.  No, actually,I'm american.
19:32 gtsafas what?
19:32 gtsafas er
19:32 irs in cosimo's case the browser set the cookie
19:32 gtsafas wrong chan
19:32 Skylos gtsafas - I'm on the wrong channel?
19:32 gtsafas I was
19:32 gtsafas the what?, er
19:33 Skylos ooh.
19:33 Skylos the browser set the cookie?
19:33 amoore joined #mojo
19:33 Skylos how can browsers set cookies?  Either a javascript set it or a server set it.
19:33 irs javascript
19:33 purl it has been said that javascript is a language built entirely out of umbrellas or for people not from Oregon or hard to freakin' test properly or a symlink to broken or testbed at http://jsfiddle.net or http://666.is/link/5932
19:33 * irs throws the rfc out the window
19:33 Skylos its not the decision of the browser in *any* case what the string-that-may-be-=-separated actually consists of.
19:34 Skylos is defenestrating the rfc productive?  :)
19:34 irs where are you going with that argument?
19:34 Skylos I'm saying, stop delcaring 'well did the browser do it'
19:34 Skylos because the browser doesn't do those thigns at all
19:35 Skylos it needs to be handled in some sane manner
19:35 Skylos but its the server that caused the problem.  its important that mojo handle what it gets - and what it may get, by standards.
19:36 Skylos I think it can be handled, as long as its done methodically.  Is it a version 0 cookie?  Then handle it with version 0 rules, such as , in expires and such.
19:37 Skylos is it a version 1 cookie?  Then handle it with version 1 rules.  They're easy to tell apart.  I can make a patch.
19:37 Skylos its compliant to react to versioning.
19:37 Skylos The inability of netscape non-rfc to comply with 2616 is a reality we have to deal with.  :(
19:38 irs don't you see the problem with that?
19:38 Skylos does expires/domain/path/secure ever come from a browser?
19:38 Skylos This is the set-cookie format not the cookie: format.
19:38 irs btw. we are not just server side, our useragent needs to parse cookies too
19:38 Skylos neh, its not an issue on the request side of the system.  what a molehill.
19:39 Skylos ooh, good point.
19:39 purl nice and sharp
19:39 irs i don't see this argument going anywhere, since you're just avoiding the actual issues
19:39 Skylos what do yout hink the actual issue is?
19:40 irs the big problem is "," being the last character in a header value
19:40 irs that's the one case we can't parse easily
19:41 irs anyway, i'll stop discussing and just try to solve the problem
19:41 irs i suggest you do the same
19:41 Skylos okay.
19:57 irs cosimo: why does salesforce set that cookie in the first place?
19:59 jwang joined #mojo
20:00 irs cosimo: atm i don't see a way to handle this, and i do not consider it a bug, that value is simply broken
20:00 irs if someone comes up with a way we can talk about it
20:02 Skylos I canfix it.
20:02 Skylos getting close
20:02 arne joined #mojo
20:03 cosimo irs: there's multiple ways to fix the problem
20:03 irs cosimo: i'm all ears
20:03 irs your original proposal broke tests elsewhere
20:04 cosimo what proposal?
20:04 purl rumour has it proposal is like the first few minutes of a job interview.  If you come in scabbily dressed, scratching my balls and slurring, we're not going to hire you
20:04 irs removng the , restriction
20:05 cosimo mh, not really, my proposal it's much uglier than that
20:06 cosimo but passes all tests ;)
20:07 irs ok, look
20:07 irs http://pastie.org/2429657
20:07 irs how do you handle that?
20:08 irs that's the logical consequence
20:08 irs impossible, it breaks RFC2616
20:08 Skylos so does netscape.
20:09 irs but netscape keeps the comma inside the value
20:09 irs which is possible to handle
20:09 Skylos there is no provisio in 2616 for spaces betwen the ,'s is there
20:09 Skylos er, around
20:10 perlite_ joined #mojo
20:10 irs Skylos: i never know what you're arguing for :S
20:11 irs cosimo: will you show us the solution too?
20:14 cosimo https://gist.github.com/1171761
20:14 cosimo don't take it too seriously
20:14 irs umm
20:14 irs i was about to ask if you were serious ;p
20:15 cosimo i don't have many alternatives, unfortunately
20:15 cosimo or if there are, i'm all ears
20:16 cosimo i don't think contacting salesforce is an option, even though they deserve to be shot
20:16 irs ok, i don't consider it a bug at this point, feel free to reopen the issue if you find a better solution
20:17 cosimo regarding http://pastie.org/2429657,
20:18 cosimo can you explain the problem there?
20:19 irs RFC2616 allow us to join it into "foo=bar, __ktv=acf5-6baa-f861-434013200ab2b50, __kti=1314271210320,http%3​A%2F%2Fwww.kraih.com%2F,"
20:23 black joined #mojo
20:23 irs for your mojolicious app there's a very ugly workaround
20:24 cosimo yes?
20:25 irs clean up the header values in a before_dispatch hook, delete the ->req->{cookies} cache and rerun ->sessions->load($c)
20:26 irs of course messing with private request data might break at some point in the future (like i said, ugly)
20:29 preflex joined #mojo
20:29 cosimo i'll keep that in mind, thanks
20:30 irs maybe Skylos finds something, i think he's still looking
20:34 Skylos heh.
20:34 Skylos I've got the working for 2956
20:34 Skylos er, whatever that number was
20:35 Skylos now I'm trying to figure out whats up with netscape cookies.
20:35 cosimo would the problem be different if the cookie was quoted? (__kti="....")
20:35 Skylos yes.
20:35 Skylos quoting makes nothing special but "
20:35 Skylos or newline I suppose
20:36 cosimo I didn't seem to notice any special treatment for quotes in Mojo::Cookie, maybe I didn't look very well
20:40 Skylos got the funky cookies to work
20:40 Skylos now why aren't the normal cookies working.
20:49 xaka irs? what the irs? upgraded version of sri? what the changelog?
20:53 Skylos pass
20:54 Skylos checking message fial
20:56 arpadszasz joined #mojo
20:57 Akron joined #mojo
20:58 cosimo Skylos: i'm interested
20:58 Skylos somethingsubtle about double netscape cookies.
20:58 Skylos I'll paste a diff for you to peruse.
20:58 cosimo I had a look at how django deals with this stuff. Seems pretty robust.
20:59 Akron Is it possible to update cookie.t including the funny testcase with a skip as a challenge?
20:59 Skylos http://pastie.org/2429885
20:59 Skylos I have cookie.t passing.
20:59 Skylos message.t isn't though.
20:59 arne joined #mojo
20:59 Skylos (which indicates cookie.t is incomplete)
21:00 Skylos heh, my debug current is in there too
21:01 cosimo Skylos, irs, I think I'll give this a shot tomorrow and see if I can come up with something useful
21:01 Skylos separator detection isn't working in the netscape cookie
21:01 Skylos thats the only problem I have left as far as I see.
21:03 Skylos hm.  comma on the end.
21:03 Skylos foo=bar; Version=1; Path=/foobar, bar=baz; Version=1; Path=/test/23
21:03 Skylos vs. the __kti cookie
21:03 Skylos hmm.
21:04 Skylos which begs the question
21:04 Skylos is the , at the end of the __kti cookie part of the cookie or not
21:10 irs Skylos: message.t fails because cookie headers are concatenated there!
21:10 irs Skylos: that's what i was talking about the whole time
21:10 irs the one problem
21:10 purl the one problem is, like, that app developers are working on knocking down that barrier
21:11 Skylos quite right irs
21:11 Skylos I apologize for not seeing that
21:11 irs that patch is massive yet doesn't do more than removing the , restrictions :S
21:11 Skylos I think maybe this regexp will work
21:12 Skylos (;|, |$)
21:12 Skylos to indicate an end-of-a-value
21:12 irs i don't even see why the rfc version needs special treatment
21:13 Skylos Because there are different rules regarding commas.
21:13 Skylos 2616 is valid in 2956
21:13 Skylos but its not in netscape
21:13 Skylos Thats really the fundamental split.
21:13 irs Skylos: no, ", " will not work, because "," is also a valid value separator
21:13 Skylos quote please?
21:13 purl Ticker data invalid
21:14 irs see quote above
21:14 Skylos how far above
21:14 irs it only says "separated by a comma
21:14 irs "
21:14 irs no more, no less
21:15 Skylos sure it says WHAT can be separated by a comma
21:15 Skylos and its *cookies* that can be sepaarted by a comma.
21:15 irs afk, back later
21:15 Skylos not values.  Cookies.
21:23 Skylos pass pass
21:25 Skylos VERY concise patch.
21:25 Skylos http://pastie.org/2430016
21:26 Skylos Doesn't necessarily handle RFC2956 cookies joined 2616 style though.
21:32 Skylos And arbitrarily excludes the string comma-space from values.
21:43 Akron As long as it's not in the test suite, there is no problem to fix. Please put it in the test suite.
21:44 Skylos >:-)
21:51 black joined #mojo
22:03 shonorio joined #mojo
22:08 irs Skylos: that's more like it
22:08 Skylos has prroblems with some cookie forms though.
22:11 Skylos like it can't distinguish cookie transitions
22:11 Skylos in RFC 2965 cookies.
22:11 Skylos this ia ctaullytwo cookies.
22:11 Skylos $Version=1; foo=bar; $Path=/test; baz=la la; $Path=/tset
22:11 Skylos but the cookie transition character is ,
22:11 Skylos Which doesn't eixt.
22:11 Skylos you need a whole new set of rule to parse this 2965 cookie.
22:12 Skylos the transition is at baz because its a non-$ starting key in a 2965 cookie.
22:12 Skylos the alternate form of 2965 cookie that uses , as the separator works fine though.
22:42 GitHub82 joined #mojo
22:42 GitHub82 [mojo] kraih pushed 1 new commit to master: http://git.io/WMgcwg
22:42 GitHub82 [mojo/master] fixed quoting bug in Mojo::Cookie - Sebastian Riedel
22:42 GitHub82 left #mojo
22:43 irs also added a few new tests
22:43 irs and removed references to the spec… since it's silly
22:44 irs if we were compliant we would work in the real world
22:44 irs *wouldn't
22:44 Skylos did you pass the RFC2965 style tests both , and ; separated
22:44 Skylos check message.t for sanity
22:45 irs i did not apply your patch if that's what you mean
22:47 irs we did not handle quoting correctly before, foo="bar; baz," did not work
22:47 Skylos No,I mean does the code work for the tests I created.
22:47 irs didn't look
22:47 Skylos broked.
22:48 irs rfc compliance is not the goal anyway, i want more real world examples
22:48 Skylos test diff...
22:49 Skylos http://pastie.org/2430392
22:51 irs that test looks wrong
22:51 irs dog=woof; Version=1; Path=/canine, cat=meow; Version=1; Path=/feline;
22:51 Skylos its right out of message.t's code
22:51 Skylos I had a failure to parse at one point on my mods that was based on that cookie string.
22:52 Skylos well, with different words,ofcourse.
22:52 Skylos but that style
22:52 Skylos without the ; before th comma, with the double Version and Path
22:52 Skylos I propogated it as a regression into the cookie.t file so it woul be easier to test and debug.
22:59 xaka does mojo have logs in apache2 format and how can i enable it for production? i've created "log" dir, but there is nothing, but "listening..."
23:00 tempire snap
23:00 tempire an erlang thread takes 1.2k of memory
23:00 irs wow, that's cheap
23:01 xaka i need logs, ahhh
23:01 irs perhaps you should start logging then?
23:01 xaka perhaps, but how
23:02 xaka there is no logging HTTP requests by default?
23:02 xaka there is no logging HTTP requests by default? i have to write my own plugin?
23:02 irs only as debug messages
23:03 irs you do have to write your own production logging plugin, yes
23:03 xaka really really bad :( so useful stuff which is everywhere and i need to spend time to write it
23:03 tempire xaka: you probably want to have your proxy do logging
23:03 irs exactly
23:04 irs normal people don't let application servers log
23:04 tempire it's assumed that in production, you'll have something like nginx serving static files
23:04 tempire and either forward requests to hypnotoad, or have a proxy forward to both nginx and hypnotoad
23:04 xaka but what if i dont and morbo is enought for me?
23:05 tempire then run morbo in dev mode
23:05 xaka it's over complicated guys
23:05 irs no it is not
23:05 purl i already had it that way, irs.
23:05 irs i better leave the discussion now :)
23:05 irs and let the sherriff do his job
23:06 * irs vanishes in a cloud of glitter
23:06 * tempire doesn't believe in the irs
23:06 xaka i dont know why you dont do things which is expectable and exists in other tools? i dont ask for orm or someting, just logs and you tell me - setup proxy, setup nginx, ... are you serious? just for logging?
23:07 tempire xaka: 'cause that's not what mojolicious is for
23:07 xaka tempire: so what for "log" directory and that the only "listening" message?
23:07 tempire it's for running apps.  it's kind of like expecting a desktop application to have standard logging built in
23:07 tempire for what you want to do, morbo in dev mode is fine
23:08 tempire that's how I run my websites
23:08 tempire 'cause I don't need any 'real' production features on my personal stuff
23:08 tempire 'cause I'm not popular enough
23:08 rhaen oh boy!
23:08 * tempire cries
23:08 rhaen here might be help!
23:08 rhaen Can I bother someone with async calls from helper functions?
23:08 xaka tempire: it's not only for mojo, but for cherrypy, django, turbogears, ror, ... it's everywhere and it helps people, but mojo as always steps out
23:09 rhaen This won't work: https://gist.github.com/a5fe8a57dbe3dd5309b8
23:10 rhaen what's the correct way to return data from that async call back to the controller?
23:10 shonorio joined #mojo
23:10 tempire if you feel that it's necessary and *should be* part of the distribution, I'm sure a pull request would be accepted if it was sensible and had a sensible use case.
23:10 tempire it's not really been an issue
23:10 tempire since it makes sense considering hypnotoad's intended use
23:12 tempire every framework has it's "opinions".  it's all fun and games until your chosen framework doesn't do what you think it should do.
23:12 tempire and then we get frustrated
23:12 xaka logging isn't about opinion, logging is the first and major stuff everywhere
23:13 tempire that entire statement is subjective.
23:13 xaka if it's in 99% frameworks - it isn't
23:16 xaka tempire: look, i have dev and prod mode. For dev mode i use fake backend to some service. Fake because i want to check my routes and so on and dont spend time on real backend work. In prod i use real backend and i got an issue - a lot of requests and i cant see which one. To test mojo app + real backend i dont want ot setup proxy or whatever
23:18 xaka so logs could help me, but there is no one and i have to learn how to write plugins, how to use internal logger and other many stuffs just to implement the thing which is everywhere by default
23:19 irs rhaen: non-blocking is well, non-blocking :)
23:19 rhaen irs: cool :) Yep, understood :)
23:19 rhaen irs: is there a "solution" for this problem?
23:19 irs you have to use a callback and render inside it
23:20 irs as in pass a callback to the helper and into the useragent
23:20 rhaen is that a callback inside the controller or a callback inside the helper?
23:20 rhaen *ugh*
23:20 irs welcome to the wonderful world of non-blocking!
23:20 rhaen irs: thanks, I am making myself a home here.
23:21 rhaen irs: I am rhaen, a neighbour. Hi.
23:21 irs get off my lawn!
23:22 rhaen hm. Still thinking about it, but didn't get it. This means:
23:22 tempire xaka: this might help - http://mojolicio.us/perldo​c/Mojolicious/Lite#Logging
23:23 rhaen irs: nah, I didn't get it.
23:24 irs rhaen: http://mojolicio.us/perldoc​/Mojolicious/Controller#ua
23:24 irs the non-blocking example
23:24 irs you render inside the callback
23:25 rhaen you mean the 2nd. example, right?
23:25 rhaen the non-blocking one.
23:25 * irs nods
23:28 rhaen irs: ok, is there a way to return that data from the helper instead of passing it to render_data?
23:29 rhaen the way the async works for ua is easy, however if you have stuff in a helper function I didn't find a way to get the data back out of there.
23:29 irs rhaen: you can't block
23:30 irs the helper will return immediately
23:30 rhaen like I might have several requests for several images.
23:30 irs then you could use a trigger to synchronize them
23:30 rhaen irs: true, so that should be a blocking operation then, right?
23:30 irs which is example 3 ;)
23:30 irs no
23:31 irs you really can't block
23:31 irs your only options are to handle requests sequantial, or non-blocking
23:31 irs are you new to event loops?
23:32 rhaen yup.
23:32 irs ok, maybe some research is in order then
23:32 rhaen just trying to get into them.
23:32 rhaen sure.
23:32 rhaen I will.
23:32 irs it's a bit tricky to get the right mindset
23:33 rhaen example 3 is quite easy.
23:33 rhaen so what he does is starting 2 calls, they might get back in the order they are started, but they might return reverse.
23:34 irs right
23:34 irs and once they both do the trigger gets invoked
23:34 rhaen a way out of the problem might be to assign the requests to a hash, so that you can sort them out later.
23:34 rhaen right?
23:35 irs you can also return the transactions, which contain the requests
23:35 rhaen ah, cool.
23:35 irs but yea, you can collect whatever data you like
23:35 rhaen right.
23:35 rhaen ok, I had some fun with node.js the last days/weeks.
23:35 irs s/return/collect/
23:35 irs that should surely help
23:35 rhaen but I think I should have a look (a deep one) into Mojo::IOLoop
23:36 irs it's basically the same
23:36 rhaen thanks for your time!
23:36 irs my pleasure
23:36 rhaen *bows*
23:36 rhaen bedtime for me.
23:36 rhaen Have a nice day!
23:36 purl If you didn't receive a receipt, you're shit out of luck!
23:38 Kulag joined #mojo
23:52 GitHub70 joined #mojo
23:52 GitHub70 [mojo] kraih pushed 1 new commit to master: http://git.io/Dm6aRw
23:52 GitHub70 [mojo/master] more cookie tests - Sebastian Riedel
23:52 GitHub70 left #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary