Installs an alternate callback to the default implementation of * CPLHTTPFetchEx(). * * This callback will only be used in the thread where this function has been * called. It must be un-installed by CPLHTTPPopFetchCallback(), which must also * be called from the same thread. * * @param pFunc Callback function to be called with CPLHTTPFetchEx() is called. * @param pUserData Last argument t
| 990 | * @since GDAL 3.2 |
| 991 | */ |
| 992 | int CPLHTTPPushFetchCallback(CPLHTTPFetchCallbackFunc pFunc, void *pUserData) |
| 993 | { |
| 994 | auto psCtx = GetHTTPFetchContext(true); |
| 995 | if (psCtx == nullptr) |
| 996 | return false; |
| 997 | psCtx->stack.emplace_back( |
| 998 | std::pair<CPLHTTPFetchCallbackFunc, void *>(pFunc, pUserData)); |
| 999 | return true; |
| 1000 | } |
| 1001 | |
| 1002 | /************************************************************************/ |
| 1003 | /* CPLHTTPPopFetchCallback() */ |