SCGI::Request(3pm)

πŸ“¦
version 0.6 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

🌸 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 to SCGI->new said. returns true if it has finished. ⭐
  • env β€” gets the environment for this request after it's been read. heads up: this will return undef until read_env or sysread_env has 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 new SCGI::Request. this is used by SCGI in the accept method, 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 the env ready for access with env.
  • _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 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