FastCGI: Improve handling of EPIPE while writing response

That would previously result in the worker getting killed with SIGPIPE.
Which works, but we can also recover from that error without restarting
the process.
This commit is contained in:
Yorhel 2026-01-05 08:57:48 +01:00
parent d300f4d791
commit 48fe393d5f
4 changed files with 34 additions and 15 deletions

6
FU.xs
View file

@ -3,7 +3,7 @@
#include <time.h> /* struct timespec & clock_gettime() */
#include <string.h> /* strerror() */
#include <arpa/inet.h> /* inet_ntop(), inet_ntoa() */
#include <sys/socket.h> /* fd passing */
#include <sys/socket.h> /* send(), fd passing */
#include <sys/un.h> /* fd passing */
#include <dlfcn.h> /* dlopen() etc */
@ -170,11 +170,11 @@ void print(fufcgi *ctx, SV *sv)
CODE:
STRLEN len;
const char *buf = SvPVbyte(sv, len);
fufcgi_print(ctx, buf, len);
fufcgi_print(aTHX_ ctx, buf, len);
void flush(fufcgi *ctx)
CODE:
fufcgi_done(ctx);
fufcgi_done(aTHX_ ctx);
void DESTROY(fufcgi *ctx)
CODE: