Skip to content

Commit e2186ae

Browse files
committed
http: Fix code smells detected by SonarCloud
1 parent ff6c33d commit e2186ae

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

http.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ int headers_recv(int fd, rr_data_t data) {
270270
* Returns: 1 if OK, 0 in case of socket error
271271
*/
272272
int headers_send(int fd, rr_data_const_t data) {
273-
hlist_t t;
273+
hlist_const_t t;
274274
char *buf;
275275
int i;
276276
int len;
@@ -511,7 +511,7 @@ length_t http_has_body(rr_data_const_t request, rr_data_const_t response) {
511511
rr_data_const_t current;
512512
length_t length;
513513
int nobody;
514-
char *tmp;
514+
const char *tmp;
515515

516516
/*
517517
* Are we checking a complete req+res conversation or just the
@@ -640,7 +640,7 @@ int http_body_drop(int fd, rr_data_const_t response) {
640640
*
641641
* Return 1 = creds parsed OK, 0 = no creds, -1 = invalid creds
642642
*/
643-
int http_parse_basic(hlist_t headers, const char *header, struct auth_s *tcreds) {
643+
int http_parse_basic(hlist_const_t headers, const char *header, struct auth_s *tcreds) {
644644
char *tmp = NULL;
645645
char *pos = NULL;
646646
char *buf = NULL;

http.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ typedef long long int length_t;
3939
extern int is_http_header(const char *src);
4040
extern char *get_http_header_name(const char *src);
4141
extern char *get_http_header_value(const char *src);
42-
extern int http_parse_basic(hlist_t headers, const char *header, struct auth_s *tcreds);
42+
extern int http_parse_basic(hlist_const_t headers, const char *header, struct auth_s *tcreds);
4343
extern int headers_recv(int fd, rr_data_t data);
4444
extern int headers_send(int fd, rr_data_const_t data);
4545
extern int tunnel(int cd, int sd);

0 commit comments

Comments
 (0)