From 002e45c6cc0a2610011a2c5e3f219fa5ecf64426 Mon Sep 17 00:00:00 2001 From: Matthieu Bricaud <259312198+mbricaud49@users.noreply.github.com> Date: Tue, 7 Jul 2026 10:36:52 +0200 Subject: [PATCH 1/3] add httpFieldName function --- cups/http.c | 12 ++++++++++++ cups/http.h | 1 + 2 files changed, 13 insertions(+) diff --git a/cups/http.c b/cups/http.c index c827099cb..83bcc6f94 100644 --- a/cups/http.c +++ b/cups/http.c @@ -639,6 +639,18 @@ httpFieldValue(const char *name) // I - String name return (HTTP_FIELD_UNKNOWN); } +// +// 'httpFieldName()' - Return the field name for a HTTP field enumeration. +// + +const char * // O - Field name +httpFieldName(http_field_t field) // I - Field index +{ + if (field >= HTTP_FIELD_ACCEPT && field < HTTP_FIELD_MAX) + return (http_fields[field]); + else + return (NULL); +} // // 'httpFlush()' - Flush data read from a HTTP connection. diff --git a/cups/http.h b/cups/http.h index 543b13117..443862961 100644 --- a/cups/http.h +++ b/cups/http.h @@ -445,6 +445,7 @@ extern char *httpDecode64(char *out, size_t *outlen, const char *in, const char extern char *httpEncode64(char *out, size_t outlen, const char *in, size_t inlen, bool url) _CUPS_PUBLIC; extern http_field_t httpFieldValue(const char *name) _CUPS_PUBLIC; +extern const char *httpFieldName(http_field_t field) _CUPS_PUBLIC; extern void httpFlush(http_t *http) _CUPS_PUBLIC; extern int httpFlushWrite(http_t *http) _CUPS_PUBLIC; From 154a25e5c23985453c4d9f4ae9fdb39f04db2610 Mon Sep 17 00:00:00 2001 From: Matthieu Bricaud <259312198+mbricaud49@users.noreply.github.com> Date: Tue, 7 Jul 2026 10:37:03 +0200 Subject: [PATCH 2/3] add httpFieldName in libcups3 definition file --- cups/libcups3.def | 1 + 1 file changed, 1 insertion(+) diff --git a/cups/libcups3.def b/cups/libcups3.def index 5dd05acf7..78bac882f 100644 --- a/cups/libcups3.def +++ b/cups/libcups3.def @@ -375,6 +375,7 @@ httpCopyPeerCredentials httpDecode64 httpEncode64 httpFieldValue +httpFieldName httpFlush httpFlushWrite httpGetActivity From b372708036dbfd4880be8101ff39309319476862 Mon Sep 17 00:00:00 2001 From: Matthieu Bricaud <259312198+mbricaud49@users.noreply.github.com> Date: Tue, 7 Jul 2026 10:37:09 +0200 Subject: [PATCH 3/3] Rename httpFieldName to httpFieldString --- cups/http.c | 4 ++-- cups/http.h | 2 +- cups/libcups3.def | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cups/http.c b/cups/http.c index 83bcc6f94..669195e60 100644 --- a/cups/http.c +++ b/cups/http.c @@ -640,11 +640,11 @@ httpFieldValue(const char *name) // I - String name } // -// 'httpFieldName()' - Return the field name for a HTTP field enumeration. +// 'httpFieldString()' - Return the field name for a HTTP field enumeration. // const char * // O - Field name -httpFieldName(http_field_t field) // I - Field index +httpFieldString(http_field_t field) // I - Field index { if (field >= HTTP_FIELD_ACCEPT && field < HTTP_FIELD_MAX) return (http_fields[field]); diff --git a/cups/http.h b/cups/http.h index 443862961..b2fc464da 100644 --- a/cups/http.h +++ b/cups/http.h @@ -445,7 +445,7 @@ extern char *httpDecode64(char *out, size_t *outlen, const char *in, const char extern char *httpEncode64(char *out, size_t outlen, const char *in, size_t inlen, bool url) _CUPS_PUBLIC; extern http_field_t httpFieldValue(const char *name) _CUPS_PUBLIC; -extern const char *httpFieldName(http_field_t field) _CUPS_PUBLIC; +extern const char *httpFieldString(http_field_t field) _CUPS_PUBLIC; extern void httpFlush(http_t *http) _CUPS_PUBLIC; extern int httpFlushWrite(http_t *http) _CUPS_PUBLIC; diff --git a/cups/libcups3.def b/cups/libcups3.def index 78bac882f..2923542cd 100644 --- a/cups/libcups3.def +++ b/cups/libcups3.def @@ -375,7 +375,7 @@ httpCopyPeerCredentials httpDecode64 httpEncode64 httpFieldValue -httpFieldName +httpFieldString httpFlush httpFlushWrite httpGetActivity