diff options
| author | George Hazan <ghazan@miranda.im> | 2020-01-13 16:48:55 +0300 |
|---|---|---|
| committer | George Hazan <ghazan@miranda.im> | 2020-01-13 16:48:55 +0300 |
| commit | 87a2660299edd64cbb6f6c92c33683e91a6d187c (patch) | |
| tree | a1b0777ec5b8afc0c49fbb66cf6a122b5ac82c6d /include | |
| parent | 21f52dbfa251d171b4cc9dc315e8736da2e2be08 (diff) | |
Netlib_GetHeader() - handful utility to avoid writing cycles
Diffstat (limited to 'include')
| -rw-r--r-- | include/m_netlib.h | 8 |
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);
|
