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:

  1. call fclose(stderr)
  2. 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 ⭐


πŸ‘‘ 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 βœ¨πŸ’–πŸ¦‹