[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 181/256: Curl_checkheaders: make it available for I
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 181/256: Curl_checkheaders: make it available for IMAP and SMTP too |
Date: |
Fri, 06 Oct 2017 19:44:32 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 02eb6184ad6ba6133382dfe24b45472176df92f7
Author: Daniel Stenberg <address@hidden>
AuthorDate: Fri Sep 8 15:13:42 2017 +0200
Curl_checkheaders: make it available for IMAP and SMTP too
... not only HTTP uses this now.
Closes #1875
---
lib/http.c | 21 ---------------------
lib/http.h | 2 --
lib/mime.c | 2 +-
lib/transfer.c | 25 +++++++++++++++++++++++++
lib/transfer.h | 5 ++++-
5 files changed, 30 insertions(+), 25 deletions(-)
diff --git a/lib/http.c b/lib/http.c
index f4a1faac3..e7f6872d5 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -173,27 +173,6 @@ CURLcode Curl_http_setup_conn(struct connectdata *conn)
}
/*
- * checkheaders() checks the linked list of custom HTTP headers for a
- * particular header (prefix).
- *
- * Returns a pointer to the first matching header or NULL if none matched.
- */
-char *Curl_checkheaders(const struct connectdata *conn,
- const char *thisheader)
-{
- struct curl_slist *head;
- size_t thislen = strlen(thisheader);
- struct Curl_easy *data = conn->data;
-
- for(head = data->set.headers;head; head=head->next) {
- if(strncasecompare(head->data, thisheader, thislen))
- return head->data;
- }
-
- return NULL;
-}
-
-/*
* checkProxyHeaders() checks the linked list of custom proxy headers
* if proxy headers are not available, then it will lookup into http header
* link list
diff --git a/lib/http.h b/lib/http.h
index 3e446813f..d2781bc0f 100644
--- a/lib/http.h
+++ b/lib/http.h
@@ -40,8 +40,6 @@ bool Curl_compareheader(const char *headerline, /* line to
check */
const char *header, /* header keyword _with_ colon */
const char *content); /* content string to find */
-char *Curl_checkheaders(const struct connectdata *conn,
- const char *thisheader);
char *Curl_copy_header_value(const char *header);
char *Curl_checkProxyheaders(const struct connectdata *conn,
diff --git a/lib/mime.c b/lib/mime.c
index 514f6b2ae..74b653649 100644
--- a/lib/mime.c
+++ b/lib/mime.c
@@ -1820,7 +1820,7 @@ CURLcode curl_mime_headers(curl_mimepart *part,
void Curl_mime_initpart(curl_mimepart *part, struct Curl_easy *easy)
{
(void) part;
- (void) data;
+ (void) easy;
}
void Curl_mime_cleanpart(curl_mimepart *part)
diff --git a/lib/transfer.c b/lib/transfer.c
index 24a21aa46..b36de2803 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -74,12 +74,37 @@
#include "non-ascii.h"
#include "http2.h"
#include "mime.h"
+#include "strcase.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
#include "curl_memory.h"
#include "memdebug.h"
+#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_SMTP) || \
+ !defined(CURL_DISABLE_IMAP)
+/*
+ * checkheaders() checks the linked list of custom headers for a
+ * particular header (prefix).
+ *
+ * Returns a pointer to the first matching header or NULL if none matched.
+ */
+char *Curl_checkheaders(const struct connectdata *conn,
+ const char *thisheader)
+{
+ struct curl_slist *head;
+ size_t thislen = strlen(thisheader);
+ struct Curl_easy *data = conn->data;
+
+ for(head = data->set.headers;head; head=head->next) {
+ if(strncasecompare(head->data, thisheader, thislen))
+ return head->data;
+ }
+
+ return NULL;
+}
+#endif
+
/*
* This function will call the read callback to fill our buffer with data
* to upload.
diff --git a/lib/transfer.h b/lib/transfer.h
index 518967260..72526a834 100644
--- a/lib/transfer.h
+++ b/lib/transfer.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2016, Daniel Stenberg, <address@hidden>, et al.
+ * Copyright (C) 1998 - 2017, Daniel Stenberg, <address@hidden>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -22,6 +22,9 @@
*
***************************************************************************/
+char *Curl_checkheaders(const struct connectdata *conn,
+ const char *thisheader);
+
void Curl_init_CONNECT(struct Curl_easy *data);
CURLcode Curl_pretransfer(struct Curl_easy *data);
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 214/256: mime: fix an explicit null dereference (#1899), (continued)
- [GNUnet-SVN] [gnurl] 214/256: mime: fix an explicit null dereference (#1899), gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 194/256: tests: enable gssapi in travis-ci linux build, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 168/256: vtls: fix memory corruption, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 170/256: OpenSSL: fix yet another mistake while encapsulating SSL backend data, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 206/256: cookies: reject oversized cookies, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 176/256: ossfuzz: add some more handled CURL options, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 155/256: fixup data/test1135, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 200/256: conversions: fix several compiler warnings, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 239/256: Set and use more necessary options when some protocols are disabled, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 173/256: configure: fix curl_off_t check's include order, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 181/256: Curl_checkheaders: make it available for IMAP and SMTP too,
gnunet <=
- [GNUnet-SVN] [gnurl] 250/256: proxy: read the "no_proxy" variable only if necessary, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 191/256: URL: on connection re-use, still pick the new remote port, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 192/256: test1150: verify same host fetch using different ports over proxy, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 199/256: server/getpart: provide dummy function to build conversion enabled, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 230/256: RELEASE-NOTES: synced with d8ab5dc50, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 134/256: headers: move the global_sslset() proto from multi.h to curl.h, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 190/256: RELEASE-NOTES: synced with 87501e57f, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 252/256: idn: fix source code comment, gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 135/256: lib: bump version info (soname). Adapt and reenable test 1135., gnunet, 2017/10/06
- [GNUnet-SVN] [gnurl] 193/256: tests: add initial gssapi test using stub implementation, gnunet, 2017/10/06