FU: Less verbose and cryptic error message on write error

This commit is contained in:
Yorhel 2026-01-05 13:20:59 +01:00
parent 48fe393d5f
commit a7e9fa1866
2 changed files with 3 additions and 4 deletions

View file

@ -417,7 +417,7 @@ static void fufcgi_flush(pTHX_ fufcgi *ctx) {
hdr.type = FCGI_STDOUT;
hdr.id = ctx->reqid;
if (fufcgi_write_record(ctx, &hdr, ctx->buf) != FUFE_OK)
croak("write error: %s", strerror(errno));
croak("%s\n", strerror(errno));
ctx->len = 0;
}
}
@ -442,13 +442,13 @@ static void fufcgi_done(pTHX_ fufcgi *ctx) {
hdr.type = FCGI_STDOUT;
hdr.id = ctx->reqid;
if (fufcgi_write_record(ctx, &hdr, ctx->buf) != FUFE_OK)
croak("write error: %s", strerror(errno));
croak("%s\n", strerror(errno));
memcpy(ctx->buf+8, "\0\0\0\0\0\0\0\0", 8); /* FCGI_REQUEST_COMPLETE */
hdr.type = FCGI_END_REQUEST;
hdr.len = 8;
if (fufcgi_write_record(ctx, &hdr, ctx->buf) != FUFE_OK)
croak("write error: %s", strerror(errno));
croak("%s\n", strerror(errno));
ctx->reqid = ctx->len = ctx->off = 0;
}