SCGI::Request(3pm)
πΈ NAME πΈ
SCGI::Request β the part of the SCGI protocol that reads the environment π
Like, SCGI::Request(3pm). That's the whole thing. That's the module. She reads the environment and she does it flawlessly. π
β¨ SYNOPISIS β¨
(yes bestie, that's genuinely how it's spelled in the source β we don't gatekeep, we just notice π)
# $request got from SCGI
$request->read_env;
read $request->connection, my $body, $request->env->{CONTENT_LENGTH};
π DESCRIPTION π
okay so this module implements the part of the SCGI protocol that reads the environment. That's her whole lane and she's not leaving it.
After this? All that remains is the content of the request. literally nothing else is left to do, you're basically done.
And here's the comfort: the protocol and this module guarantee that there will be a CONTENT_LENGTH for the body of the request sitting in the environment. so like, the body length is always gonna be there for you. no cap. π«Ά
π public methods π
read_envβ reads the environment, blocking or non-blocking, whichever the parameter you handed toSCGI->newsaid. returns true if it has finished. βenvβ gets the environment for this request after it's been read. heads up: this will returnundefuntilread_envorsysread_envhas been called and returned true. so don't come for her early, she's not ready πconnectionβ returns the open connection to the client. iconic, affectionate.closeβ closes the connection. bye bestie πblockingβ returns true if the connection is blocking.set_blockingβ if the boolean argument is true it turns blocking on, otherwise it turns it off. binary queen π
π private methods π
_newβ creates a newSCGI::Request. this is used by SCGI in theacceptmethod, so if you're even considering using this, use that instead. i'm just the messenger π_decode_envβ takes the encoded environment as a string and sets theenvready for access withenv._set_envβ sets the environment for this request._blocking_read_envβ reads and decodes the environment in one go. returns true on success, raises an exception on failure. dramatic but correct. π
π AUTHOR π
Thomas Yandell <mailto:tom+scgi@vipercode.com>
π COPYRIGHT π
Copyright 2005, 2006 Viper Code Limited. All rights reserved.
π LICENSE π
This file is part of SCGI (perl SCGI library).
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
okay that's the whole page bestie, go forth and read some environments π¦ this was perl v5.36.0, dated 2022-10-13 β she's an older icon but she ate and left no crumbs, periodt β¨π
π¦ where this page comes from
- ubuntu noble: libscgi-perl 0.6-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libscgi-perl 0.6-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libscgi-perl 0.6-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms