summaryrefslogtreecommitdiff
path: root/src/libwaitress/waitress.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libwaitress/waitress.c')
-rw-r--r--src/libwaitress/waitress.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libwaitress/waitress.c b/src/libwaitress/waitress.c
index 5e3fd41..9910059 100644
--- a/src/libwaitress/waitress.c
+++ b/src/libwaitress/waitress.c
@@ -484,7 +484,7 @@ static bool WaitressFormatAuthorization (WaitressHandle_t *waith,
/* get default http port if none was given
*/
-static const char *WaitressDefaultPort (WaitressUrl_t *url) {
+static const char *WaitressDefaultPort (const WaitressUrl_t * const url) {
return url->port == NULL ? "80" : url->port;
}
@@ -514,7 +514,7 @@ static char *WaitressGetline (char * const str) {
/* identity encoding handler
*/
static WaitressHandlerReturn_t WaitressHandleIdentity (WaitressHandle_t *waith,
- char *buf, size_t size) {
+ char *buf, const size_t size) {
waith->request.contentReceived += size;
if (waith->callback (buf, size, waith->data) == WAITRESS_CB_RET_ERR) {
return WAITRESS_HANDLER_ABORTED;
@@ -527,12 +527,12 @@ static WaitressHandlerReturn_t WaitressHandleIdentity (WaitressHandle_t *waith,
* trailing \0.
*/
static WaitressHandlerReturn_t WaitressHandleChunked (WaitressHandle_t *waith,
- char *buf, size_t size) {
+ char *buf, const size_t size) {
char *content = buf, *nextContent;
while (1) {
if (waith->request.chunkSize > 0) {
- size_t remaining = size-(content-buf);
+ const size_t remaining = size-(content-buf);
if (remaining >= waith->request.chunkSize) {
if (WaitressHandleIdentity (waith, content,
@@ -557,7 +557,7 @@ static WaitressHandlerReturn_t WaitressHandleChunked (WaitressHandle_t *waith,
}
if ((nextContent = WaitressGetline (content)) != NULL) {
- long int chunkSize = strtol (content, NULL, 16);
+ const long int chunkSize = strtol (content, NULL, 16);
if (chunkSize == 0) {
return WAITRESS_HANDLER_DONE;
} else if (chunkSize < 0) {