mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
Update: Added debug level logging for client slurping
This commit is contained in:
parent
e9624ef523
commit
bde88f82ae
15
src/client.c
15
src/client.c
@ -578,14 +578,20 @@ client_slurp_result_t client_body_skip(client_t *client)
|
|||||||
char buf[2048];
|
char buf[2048];
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!client)
|
ICECAST_LOG_DEBUG("Slurping client %p");
|
||||||
|
|
||||||
|
if (!client) {
|
||||||
|
ICECAST_LOG_DEBUG("Slurping client %p ... failed");
|
||||||
return CLIENT_SLURP_ERROR;
|
return CLIENT_SLURP_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
if (client->request_body_length != -1) {
|
if (client->request_body_length != -1) {
|
||||||
size_t left = (size_t)client->request_body_length - client->request_body_read;
|
size_t left = (size_t)client->request_body_length - client->request_body_read;
|
||||||
|
|
||||||
if (!left)
|
if (!left) {
|
||||||
|
ICECAST_LOG_DEBUG("Slurping client %p ... was a success");
|
||||||
return CLIENT_SLURP_SUCCESS;
|
return CLIENT_SLURP_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
if (left > sizeof(buf))
|
if (left > sizeof(buf))
|
||||||
left = sizeof(buf);
|
left = sizeof(buf);
|
||||||
@ -593,8 +599,10 @@ client_slurp_result_t client_body_skip(client_t *client)
|
|||||||
client_body_read(client, buf, left);
|
client_body_read(client, buf, left);
|
||||||
|
|
||||||
if (client->request_body_length == client->request_body_read) {
|
if (client->request_body_length == client->request_body_read) {
|
||||||
|
ICECAST_LOG_DEBUG("Slurping client %p ... was a success");
|
||||||
return CLIENT_SLURP_SUCCESS;
|
return CLIENT_SLURP_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
|
ICECAST_LOG_DEBUG("Slurping client %p ... needs more data");
|
||||||
return CLIENT_SLURP_NEEDS_MORE_DATA;
|
return CLIENT_SLURP_NEEDS_MORE_DATA;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -604,12 +612,15 @@ client_slurp_result_t client_body_skip(client_t *client)
|
|||||||
ret = client_body_eof(client);
|
ret = client_body_eof(client);
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
case 0:
|
case 0:
|
||||||
|
ICECAST_LOG_DEBUG("Slurping client %p ... needs more data");
|
||||||
return CLIENT_SLURP_NEEDS_MORE_DATA;
|
return CLIENT_SLURP_NEEDS_MORE_DATA;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
ICECAST_LOG_DEBUG("Slurping client %p ... was a success");
|
||||||
return CLIENT_SLURP_SUCCESS;
|
return CLIENT_SLURP_SUCCESS;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
ICECAST_LOG_DEBUG("Slurping client %p ... failed");
|
||||||
return CLIENT_SLURP_ERROR;
|
return CLIENT_SLURP_ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user