Bugfix for POST and PUT method

This commit is contained in:
2020-12-29 11:48:56 +01:00
parent bc4a764bd5
commit 798c41f1c8
5 changed files with 32 additions and 4 deletions

View File

@ -510,6 +510,13 @@ int fastcgi_receive(fastcgi_conn *conn, sock *client, unsigned long len) {
.paddingLength = 0,
.reserved = 0
};
if (client->buf != NULL && client->buf_len - client->buf_off > 0) {
ret = (int) (client->buf_len - client->buf_off);
memcpy(buf, client->buf + client->buf_off, ret);
goto send;
}
while (rcv_len < len) {
if (client->enc) {
ret = SSL_read(client->ssl, buf, sizeof(buf));
@ -524,6 +531,7 @@ int fastcgi_receive(fastcgi_conn *conn, sock *client, unsigned long len) {
return -1;
}
}
send:
rcv_len += ret;
header.contentLengthB1 = (ret >> 8) & 0xFF;
header.contentLengthB0 = ret & 0xFF;