summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-01-13 16:48:55 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-01-13 16:48:55 +0300
commit87a2660299edd64cbb6f6c92c33683e91a6d187c (patch)
treea1b0777ec5b8afc0c49fbb66cf6a122b5ac82c6d /include
parent21f52dbfa251d171b4cc9dc315e8736da2e2be08 (diff)
Netlib_GetHeader() - handful utility to avoid writing cycles
Diffstat (limited to 'include')
-rw-r--r--include/m_netlib.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/m_netlib.h b/include/m_netlib.h
index 3164125e2a..1d5be72fd2 100644
--- a/include/m_netlib.h
+++ b/include/m_netlib.h
@@ -434,6 +434,10 @@ struct NETLIBHTTPHEADER
char *szValue;
};
+EXTERN_C MIR_APP_DLL(char*) Netlib_GetHeader(const NETLIBHTTPREQUEST *pRec, const char *pszName);
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
#define REQUEST_RESPONSE 0 // used by structure returned by MS_NETLIB_RECVHTTPHEADERS
#define REQUEST_GET 1
#define REQUEST_POST 2
@@ -471,6 +475,10 @@ struct NETLIBHTTPREQUEST
char *szResultDescr;
HNETLIBCONN nlc;
int timeout;
+
+ __forceinline const char *operator[](const char *pszName) {
+ return Netlib_GetHeader(this, pszName);
+ }
};
EXTERN_C MIR_APP_DLL(int) Netlib_SendHttpRequest(HNETLIBCONN hConnection, NETLIBHTTPREQUEST *pRec);