slurmrestd - Convert to http_header_t
Convert from http_header_entry_t to http_header_t as struct type name.
Issue: 50189
diff --git a/src/slurmrestd/http.c b/src/slurmrestd/http.c
index da98f2a..11f077e 100644
--- a/src/slurmrestd/http.c
+++ b/src/slurmrestd/http.c
@@ -232,7 +232,7 @@
{
http_context_t *context = arg;
request_t *request = &context->request;
- http_header_entry_t *entry = NULL;
+ http_header_t *entry = NULL;
xassert(context->magic == MAGIC);
@@ -525,7 +525,7 @@
/* send along any requested headers */
if (args->headers) {
list_itr_t *itr = list_iterator_create(args->headers);
- http_header_entry_t *header = NULL;
+ http_header_t *header = NULL;
while ((header = list_next(itr))) {
if ((rc = _write_fmt_header(args->con, header->name,
header->value)))
@@ -768,10 +768,10 @@
return context;
}
-/* find operator against http_header_entry_t */
+/* find operator against http_header_t */
static int _http_header_find_key(void *x, void *y)
{
- http_header_entry_t *entry = (http_header_entry_t *)x;
+ http_header_t *entry = (http_header_t *) x;
const char *key = (const char *)y;
xassert(entry->name);
@@ -786,13 +786,14 @@
extern const char *find_http_header(list_t *headers, const char *name)
{
- http_header_entry_t *header = NULL;
+ http_header_t *header = NULL;
if (!headers || !name)
return NULL;
- header = (http_header_entry_t *)list_find_first(
- headers, _http_header_find_key, (void *)name);
+ header = (http_header_t *) list_find_first(headers,
+ _http_header_find_key,
+ (void *) name);
if (header)
return header->value;
diff --git a/src/slurmrestd/http.h b/src/slurmrestd/http.h
index 3f094a8..0e36252 100644
--- a/src/slurmrestd/http.h
+++ b/src/slurmrestd/http.h
@@ -78,8 +78,6 @@
const char *body_encoding; /* body encoding type or NULL */
} on_http_request_args_t;
-typedef http_header_t http_header_entry_t;
-
/* find http header from header list
* IN headers List of http_header_entry_t
* IN name name of header to find
diff --git a/src/slurmrestd/operations.c b/src/slurmrestd/operations.c
index 3bbbf84..da9f220 100644
--- a/src/slurmrestd/operations.c
+++ b/src/slurmrestd/operations.c
@@ -235,7 +235,7 @@
.body_encoding = (body_encoding ? body_encoding : "text/plain"),
.body_length = (err ? strlen(err) : 0),
};
- http_header_entry_t close = {
+ http_header_t close = {
.name = "Connection",
.value = "Close",
};