Logo Search packages:      
Sourcecode: gsoap version File versions

static const char* SoapSharedLibraries_loadAllLibraries ( SoapSharedLibraries This,
apr_pool_t *  pTempPool 
) [static]

Returns:
the error message if a load failed, NULL on success.

< we loaded one, lets retry with all others, maybe they depend on that.

Definition at line 291 of file mod_gsoap.c.

References SoapSharedLibraries_S::m_bAllLibrariesLoaded, SoapSharedLibrary_S::m_bIsSOAPLibrary, SoapSharedLibrary_S::m_hLibrary, SoapSharedLibraries_S::m_pfnEntryPoint, SoapSharedLibraries_S::m_pLibraries, SoapSharedLibraries_S::m_pPool, SoapSharedLibrary_S::m_pszPath, and SoapSharedLibrary_load().

Referenced by gsoap_handler().

                                                                                                         {
    bool bAllLibrariesLoaded = false;
    const char *pszError = NULL;
    bool bRetry = false;
    int i = 0;
    int nRetry = 0;

    assert(NULL != This);


    if (This->m_bAllLibrariesLoaded) 
      {
            return NULL;
    }
    for (nRetry = 0; nRetry < 5 && !bAllLibrariesLoaded; nRetry++) { 
            do {
                  pszError = NULL;
                  bRetry = false; // don't try it again.
                  bAllLibrariesLoaded = true;
                  for (i = 0; i < This->m_pLibraries->nelts; i++) {
                        SoapSharedLibrary *pLib = SoapSharedLibraries_getLibrary(This, i);
                        if (NULL == pLib->m_hLibrary) {
                              pszError = SoapSharedLibrary_load(pLib, pTempPool);
                              if (NULL == pszError) {
                                    assert(NULL != pLib->m_hLibrary);
                                    bRetry = true; ///< we loaded one, lets retry with all others, maybe they depend on that.
                              } else {
                                    bAllLibrariesLoaded = false;
                              }
                              if (NULL != pLib->m_hLibrary && pLib->m_bIsSOAPLibrary) 
                              {
                                    void *pfun = (void *)DLSYM(pLib->m_hLibrary, APACHE_HTTPSERVER_ENTRY_POINT);
                                    if (NULL == pfun) {
                                          pszError = apr_psprintf(pTempPool, 
                                                                           "gsoap: load library \"%s\" success, but failed to find the \"%s\" entry point",
                                                                           pLib->m_pszPath,  APACHE_HTTPSERVER_ENTRY_POINT);
                                          return pszError;
                                    } else {
                                          This->m_pfnEntryPoint = (apache_init_soap_interface_fn)pfun;
                                          pszError = SoapSharedLibraries_getEntryPoints(This, pLib, pTempPool);
                                          pszError = apr_psprintf(NULL == pTempPool ? This->m_pPool : pTempPool, "mod_gsoap: has got entrypoint %s from library", APACHE_HTTPSERVER_ENTRY_POINT);

                                    }
                              }
                        }
                  }
            } while(bRetry);
    }
    if (bAllLibrariesLoaded) {
            This->m_bAllLibrariesLoaded = true;
            pszError = NULL;
    }
    return pszError;
}


Generated by  Doxygen 1.6.0   Back to index