Mojo. HTTP pipelining?

43 views
Skip to first unread message

Анатолий Шарифулин

unread,
Jul 22, 2010, 4:33:54 AM7/22/10
to mojol...@googlegroups.com
http://community.livejournal.com/ru_perl/366844.html

Translate to English (with Google Translate):

want a simple - to enable ping via the web at Mojo (tools for a support):) In this regard, such a strange question: how to make at Mojo, so that output the ping command on a remote server, the output gradually to the browser user? Ie that the answer is not buffered. This is called HTTP pipelining?


--
С уважением,
 Анатолий Шарифулин.

t...@dix.cz

unread,
Jul 22, 2010, 5:04:40 AM7/22/10
to mojol...@googlegroups.com

Hi,
connect to freshly generated aplication with: http://localhost:3000/:

syntax error at (eval 289) line 1, near "require nothing:::"

{
'status' => 500,
'content' => {},
'route' => undef,
'mojo.started' => [
1279789227,
662131
],
...
...

I'm affraid, this can be somehow exploitable..


Regards,
Tomas Hruby

vti

unread,
Jul 22, 2010, 5:51:48 AM7/22/10
to mojol...@googlegroups.com
They think that HTTP pipelining is something like unbuffered output.
When you print data to the browser on the fly.

What I suggest is to use WebSockets + Pure Perl Ping implementation,
just not to bother with forks, output capturing and so on.

2010/7/22 Sebastian Riedel <kra...@googlemail.com>:
>> http://community.livejournal.com/ru_perl/366844.html
>
> That sentence doesn't make any sense and i don't speak russian...

Анатолий Шарифулин

unread,
Jul 22, 2010, 6:52:11 AM7/22/10
to mojol...@googlegroups.com
Ok, subject is wrong.

What about unbuffered output in Mojolicious?

On Thu, Jul 22, 2010 at 2:18 PM, Sebastian Riedel <kra...@googlemail.com> wrote:
http://en.wikipedia.org/wiki/HTTP_pipelining
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To post to this group, send email to mojol...@googlegroups.com.
To unsubscribe from this group, send email to mojolicious...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mojolicious?hl=en.

Sebastian Riedel

unread,
Jul 22, 2010, 7:00:34 AM7/22/10
to mojol...@googlegroups.com
> Ok, subject is wrong.
>
> What about unbuffered output in Mojolicious?

What about it?

Sebastian Riedel

unread,
Jul 22, 2010, 1:36:39 PM7/22/10
to mojol...@googlegroups.com
> I understand that now there is no support for non-buffered output to the client in Mojolicious applications. Right? Is it posible in Mojolicious?

Non buffered output is a myth, there is pretty much always a buffer involved on some layer, especially portability is a huge problem.
The closest you will get in Mojo/Mojolicious is the response callback.

$self->res->body(sub {...});

Which means you don't actually process the request when it hits your Mojolicious controller, but later when the server binding invokes the callback.

$self->res->code(200);
$self->res->headers->content_length(...);
$self->res->body(sub {
# Do stuff and return response body chunk wise
});

Note that you need to know the Content-Length in advance or use chunked Transfer-Encoding.

> Same feature exists in CGI – nph scripts.

Also a myth, the server can still do whatever it wants, there are no guarantees.

Sebastian Riedel

unread,
Jul 22, 2010, 1:45:40 PM7/22/10
to mojol...@googlegroups.com
> I understand that now there is no support for non-buffered output to the client in Mojolicious applications.

To make it absolutely clear, what you are proposing here would mean that whenever one of your handlers writes a chunk of information, the whole server process would have to block and wait for the data to travel all across the internet and back, before being able to do anything else again.

Doesn't sound like such a good idea, does it? :)

Reply all
Reply to author
Forward
0 new messages