FCGI_FINISH(3)
π FCGI_FINISH π
okay bestie, we're doing the FCGI_Finish page from the fcgi_stdio compatibility library and honestly? it's a short one but it's lowkey important. let's get into it β¨
πΈ SYNOPSIS πΈ
#include "fcgi_stdio.h"
void
FCGI_Finish(void);
that's it. no args, no drama, just vibes π«Ά
π¦ DESCRIPTION π¦
so here's the tea: FCGI_Finish finishes the current request from the HTTP server. and which request is "the current one"? the one that got started by the most recent call to FCGI_Accept(3). that's the origin story, no cap.
the whole point of FCGI_Finish is that it lets an app interleave other activities with the processing of requests. like, you don't have to be stuck in request-mode 24/7, you can go do your little side quests and come back. and in an extreme case β and I mean extreme, main character energy β an application would call FCGI_Finish to complete the current request before exiting, e.g. to reclaim leaked storage. cleanup era π
now, when it's completing that current request, FCGI_Finish may detect errors, e.g. a broken pipe to a client who has disconnected early. (rude of them, but okay.) and here's the thing β FCGI_Finish ignores such errors. it literally does not care. it's giving unbothered.
so if your application does want to handle those errors? you gotta do it yourself, explicitly:
- call
fclose(stderr) - then call
fclose(stdout)
and an EOF return from either one indicates an error. π that's your signal, bestie.
also super important: FCGI_Finish frees any storage allocated by the most recent call to FCGI_Accept. so like⦠that memory? gone. freed. not yours anymore.
β οΈ warning bestie: check out FCGI_Accept(3) for the warnings against retaining pointers to this storage. do NOT be holding onto those pointers, fr fr. that's how you get undefined behaviour and we are NOT doing that today π
β SEE ALSO β
FCGI_Accept(3)β go read it, it's the prequel π
π HISTORY π
Copyright (c) 1996 Open Market, Inc.
See the file "LICENSE" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
$Id: FCGI_Finish.3,v 1.1.1.1 1997/09/16 15:36:25 stanleyg Exp $
and that's the whole page, bestie!! π₯³ this came straight outta the fcgi_stdio compatibility library, the version tag is FCGI_Finish.3,v 1.1.1.1 and the date on it is 1997/09/16 15:36:25 (stanleyg's era, iconic). go free your storage and slay β¨ππ¦
π¦ where this page comes from
- alpine 3.22: fcgi-doc 2.4.6-r0 Β· OML
- alpine 3.23: fcgi-doc 2.4.6-r0 Β· OML
- alpine 3.24: fcgi-doc 2.4.6-r0 Β· OML
- arch rolling: fcgi 2.4.7-1 Β· custom
- debian trixie: libfcgi-dev 2.4.5-0.1 Β· FASTCGI
- epel 10: fcgi-devel 2.4.7-1.el10_2 Β· OML
- epel 9: fcgi-devel 2.4.7-1.el9 Β· OML
- fedora 43: fcgi-devel 2.4.6-2.fc43 Β· OML
- fedora 43: fcgi-devel 2.4.6-2.fc43 Β· OML
- fedora 43: fcgi-devel 2.4.7-1.fc43 Β· OML
- fedora 43: fcgi-devel 2.4.7-1.fc43 Β· OML
- fedora 44: fcgi-devel 2.4.7-2.fc44 Β· OML
- fedora 44: fcgi-devel 2.4.7-2.fc44 Β· OML
- nixos 26.05: fcgi 2.4.7
- nixpkgs unstable: fcgi 2.4.7
- opensuse-leap 16.0: FastCGI-devel 2.4.6-160000.2.2 Β· OML
- opensuse-leap 16.0: FastCGI-devel 2.4.6-160000.2.2 Β· OML
- opensuse-leap 16.0: FastCGI-devel 2.4.6-160000.2.2 Β· OML
- opensuse-leap 16.0: FastCGI-devel 2.4.6-160000.2.2 Β· OML
- ubuntu questing: libfcgi-dev 2.4.5-0.1build1
- ubuntu resolute: libfcgi-dev 2.4.5-0.1build2 Β· FASTCGI
- ubuntu stonking: libfcgi-dev 2.4.5-0.1build2 Β· FASTCGI
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms