mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-04-07 11:08:36 +00:00
Use UINT64_MAX instead of -1 for Rhizome HTTP response content_length
Fixes -Wsign-compare warnings
This commit is contained in:
parent
ebc3133f5c
commit
b7528412df
@ -911,6 +911,8 @@ struct http_response_parts {
|
||||
char *content_start;
|
||||
};
|
||||
|
||||
#define HTTP_RESPONSE_CONTENT_LENGTH_UNSET UINT64_MAX
|
||||
|
||||
int unpack_http_response(char *response, struct http_response_parts *parts);
|
||||
|
||||
/* rhizome storage methods */
|
||||
|
@ -434,7 +434,7 @@ static int receive_http_response(int sock, char *buffer, size_t buffer_len, stru
|
||||
INFOF("Failed HTTP request: server returned %03u %s", parts->code, parts->reason);
|
||||
return -1;
|
||||
}
|
||||
if (parts->content_length == -1) {
|
||||
if (parts->content_length == HTTP_RESPONSE_CONTENT_LENGTH_UNSET) {
|
||||
if (config.debug.rhizome_rx)
|
||||
DEBUGF("Invalid HTTP reply: missing Content-Length header");
|
||||
return -1;
|
||||
|
@ -1541,7 +1541,7 @@ void rhizome_fetch_poll(struct sched_ent *alarm)
|
||||
rhizome_fetch_switch_to_mdp(slot);
|
||||
return;
|
||||
}
|
||||
if (parts.content_length == -1) {
|
||||
if (parts.content_length == HTTP_RESPONSE_CONTENT_LENGTH_UNSET) {
|
||||
if (config.debug.rhizome_rx)
|
||||
DEBUGF("Invalid HTTP reply: missing Content-Length header");
|
||||
rhizome_fetch_switch_to_mdp(slot);
|
||||
@ -1619,7 +1619,7 @@ int unpack_http_response(char *response, struct http_response_parts *parts)
|
||||
parts->code = 0;
|
||||
parts->reason = NULL;
|
||||
parts->range_start=0;
|
||||
parts->content_length = -1;
|
||||
parts->content_length = HTTP_RESPONSE_CONTENT_LENGTH_UNSET;
|
||||
parts->content_start = NULL;
|
||||
char *p = NULL;
|
||||
if (!str_startswith(response, "HTTP/1.0 ", (const char **)&p)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user