The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2016-03-11

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

All times shown according to UTC.

Time Nick Message
00:04 asarch joined #mojo
00:07 orev joined #mojo
00:11 bpmedley http://bmedley.org/minion_ui-001.png <-- thoughts?
00:19 bpmedley http://bmedley.org/minion_ui-002.png
00:25 PryMar56 joined #mojo
00:31 yakudzo joined #mojo
01:00 jontaylor joined #mojo
01:22 vicash looks good bpmedley. when you're ready with this, I would like to use it if it is open source.
01:31 bpmedley vicash : Awesome!! Clone or fork 'n go.. :)
01:31 bpmedley https://github.com/brianmed/minion_ui  <-- Artistic license
02:02 jontaylor joined #mojo
02:05 jontaylor_ joined #mojo
02:12 jontaylor_ joined #mojo
02:32 jontaylor_ joined #mojo
02:42 cpan_mojo Mojo-ACME-0.03 by JBERGER https://metacpan.org/release/JBERGER/Mojo-ACME-0.03
02:46 cpan_mojo Mojolicious-Plugin-Tables-0.01 by FRANKC https://metacpan.org/release/FRANKC/Mojolicious-Plugin-Tables-0.01
03:13 mcsnolte joined #mojo
03:28 Adura joined #mojo
03:42 noganex_ joined #mojo
04:00 TonyC joined #mojo
04:30 lluad joined #mojo
04:37 inokenty-w joined #mojo
04:47 davido joined #mojo
04:58 Topic for #mojo is now 🍆 cheers | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
05:04 irqq joined #mojo
05:23 ichi joined #mojo
05:56 melo joined #mojo
06:35 melo1 joined #mojo
07:04 dod joined #mojo
07:09 dod joined #mojo
07:12 ichi joined #mojo
07:23 acamari joined #mojo
07:28 mdom ~
07:34 Vandal joined #mojo
07:37 McA joined #mojo
07:48 McA joined #mojo
07:56 jacoby joined #mojo
08:04 kes joined #mojo
08:11 AndrewIsh joined #mojo
08:28 McA joined #mojo
08:29 trone joined #mojo
08:36 osfabibisi joined #mojo
08:41 punter joined #mojo
08:44 McA2 joined #mojo
08:45 new_student bpmedley: Just saw your message. No, I didn't use any perl module to find out the bug. I'm stilla beginner in perl. I just re-read the code and tried to understand why it could've screwed up and then I realized that I was referring to a $c which didn't exist anymore. But thanks for letting me know about those modules. I'll read about them.
08:48 McA joined #mojo
09:03 berov joined #mojo
09:46 jkramer joined #mojo
09:46 jkramer Ahoy!
09:48 jkramer In the Mojo::UserAgent docs it says it supports "connection pooling", but I can't find any information about what exactly it does or ways to control it. Can't even find the word 'pool' anywhere in the source.
09:48 jkramer Well except the one mention in the perldoc
09:49 jkramer Where can I learn what exactly it does?
09:50 batman jkramer: connection pooling means that it will keep tcp connections open to the remove webserver if it supports that feature
09:50 batman you can control that with https://metacpan.org/pod/Mojo::UserAgent#max_connections
09:51 batman note that "max_connections" is not the maximum number of connections the ua can make, but simply how many the ua can keep open
09:52 jkramer Ah neat, exactly what I need. Thanks!
09:55 jkramer I have a weird problem with one specific webservice I'm using where requests after a while get really slow. I suspect that it claims to support persistent connections but they go stale so for followup requests the UA tries an existing socket and hangs for a long time.
09:56 jkramer Has anyone ever had something like this? In another piece of code I was using LWP::UserAgent with LWP::ConnCache and the problem went away as soon as I removed LWP::ConnCache.
09:56 batman can't say i've seen it
09:58 jkramer Yeah, me neither before. I've been tracking this down for days now and I'm getting frustrated. :) It only seems to happen with this particular service as well.
10:04 batman i can't remember how, but you maybe you can set some connection header to force the connection to get closed
10:04 batman maybe it's in the cookbook
10:05 batman wild guess: $ua->get("...", {Connection => "close"});
10:06 jkramer I think there's a bug in max_connections()
10:07 batman that would surprise me
10:07 jkramer If I set it to 0 as described in the docs I get "Premature connection close" and on the server side it looks like there was no attempt to connect at all
10:07 batman is your code non-blocking?
10:07 jkramer Yes
10:08 batman can you show some code?
10:08 batman maybe your $ua goes out of scope?
10:08 jkramer Ah nevermind, it still occurs when set max_connections to 1.
10:09 jkramer Ha, yeah that's mostly likely it, thanks. I replaced $c->ua->get with Mojo::UserAgent->max_connections(0)->get :D
10:09 batman yeah. that doesn't work :/
10:09 nic maybe you need to make use of a timeout so it doesn't try an existing connection for too long?
10:11 jkramer nic: I can only set the timeout in seconds and the avg request with a new connection takes about 0.2s :) So I'd rather disable the connection cache altogether
10:14 jkramer Ok it works with state $ua = ...; Let's hope that makes all my mysterious problems go away magically.
10:43 melo joined #mojo
10:47 irqq joined #mojo
13:27 sri joined #mojo
13:29 Topic for #mojo is now 🍻 cheers | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
13:29 Adura was kicked by sri: one week timeout, you've been warned
13:31 kaare joined #mojo
13:43 neilhwatson joined #mojo
13:44 punter joined #mojo
14:13 ramortegui joined #mojo
14:41 asarch joined #mojo
14:42 mcsnolte joined #mojo
14:51 McA joined #mojo
15:32 berov left #mojo
16:16 lluad joined #mojo
16:17 hummeleBop joined #mojo
16:21 melo joined #mojo
16:34 lluad joined #mojo
16:55 disputin joined #mojo
17:11 acamari joined #mojo
17:12 irqq joined #mojo
17:14 gtodd1 joined #mojo
18:05 dod joined #mojo
18:28 trone joined #mojo
18:50 Lee joined #mojo
20:04 ichi joined #mojo
20:08 orev I seem to be running into issues with csrf on a login form.  I frequently get submissions where the csrf doesn't validate, but I don't know why.  this is on my dev system and I'm sure that I'm not doing anything to the form
20:09 orev code is very simple: http://fpaste.org/337368/57726967/
20:10 orev I thought it might have been because of making changes to code and morbo reloading, but I'm not doing that now and it still fails
20:14 orev I guess I don't understand how csrf is generated and then checked to be valid
20:14 jacoby joined #mojo
20:21 batman orev: could it be that the session cookie is invalid?
20:22 batman is the session secret random? or is it ssl only?
20:22 orev possibly.  in this case I am seeing it after the session has expired
20:22 batman that's one of the things that tripped me off
20:23 orev session secret? as in the app->secrets?
20:23 batman yeah
20:23 orev app secrets is a fixed value, doesn't change
20:23 batman ok
20:23 orev not using ssl either on this dev system
20:23 batman so "csrf_token" is stored in the session cookie, so if the cookie expires or is invalid in some way, it doesn't validate
20:24 batman try setting some data in $c->session(...) and see if "that" is still there when the csrf fail
20:25 batman https://metacpan.org/pod/Mojolicious::Sessions#secure <-- this is what i meant about ssl
20:26 batman if $app->session->secure(1) is set then you need ssl, or the cookie will always be invalid
20:26 orev no, session->secure is currently 0
20:27 batman ok. so try and see if session(x => 123) is still there when the csrf fail
20:27 batman if it's not, then you know the session timeout/invalid/....
20:28 orev I think it's probably the session expiring.  I'm mostly seeing this after I do a logout where session is expired, then log back in using the same form.  logout send you back to the login page with a flash message of "successful logout"
20:28 orev to use flash on that page, I set the session to expire in 10 seconds instead of immediately
20:29 batman oh. why don't you expire it on logout?
20:29 batman why wait 10 seconds?
20:29 batman 10 seconds sounds like a very bad idea :/
20:30 orev because the flash message is stored in the session, so if you expire the session it goes away and flash is no longer defined
20:30 orev session is already expired in local db
20:30 batman then why expire it in the browser?
20:30 batman i actually never expire the cookie. i just delete stuff like "uid" on logout
20:31 batman s/never/almost never/
20:31 orev maybe that is a way to go with it.  I just don't like to leave stuff lying around
20:32 batman :)
20:34 orev I see.  I didn't realize a session cookie is created even before you login
20:34 batman the session cookie is created when you do stuff with $c->session(...)
20:36 orev at this point I'm just checking if a session exists and then showing a login form.  that form has a csrf_field in it, so I imagine that is causing the session to be created then
20:37 batman yes. when you do <%= csrf_token %> the session cookie is created
20:37 batman https://metacpan.org/pod/Mojolicious::Plugin::DefaultHelpers#csrf_token <-- as described here
20:39 orev yes, I'm just now understanding the relationship between csrf and the session.  I thought the token was being calculated some other way, but now it makes more sense to just be in the session
20:40 batman yeah. mojo doesn't persist anything on disk, so the only persistent storage available is the cookie
21:12 PryMar56 joined #mojo
23:31 da5id joined #mojo
23:31 phillipadsmith_ joined #mojo
23:31 Lucas1 joined #mojo
23:32 SmokeMachine joined #mojo
23:34 mcsnolte joined #mojo
23:41 bjakubski joined #mojo
23:46 harleypig joined #mojo
23:46 mikeo joined #mojo
23:47 mikeo If I have a template (that uses a layout), what's the best way to include the content of an additional template inside the former?
23:53 pink_mist %= include 'anothertemplate'; (I'm unsure..)
23:54 jberger content buffers

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