Logo Search packages:      
Sourcecode: libupnp4 version File versions  Download package

EXPORT_SPEC int UpnpEnableWebserver ( int  enable  ) 

Enables or disables the webserver.

Returns:
An integer representing one of the following:
  • UPNP_E_SUCCESS: The operation completed successfully.
  • UPNP_E_INVALID_ARGUMENT: enable is not valid.
Parameters:
enable  [in] TRUE to enable, FALSE to disable.

Definition at line 3757 of file upnpapi.c.

References bWebServerState, SetHTTPGetCallback(), UPNP_E_FINISH, UPNP_E_INVALID_PARAM, and UpnpSdkInit.

Referenced by UpnpInitStartServers().

{
    int retVal;

    if( UpnpSdkInit != 1 ) {
        return UPNP_E_FINISH;
    }

    switch ( enable ) {
#ifdef INTERNAL_WEB_SERVER
        case TRUE:
            if( ( retVal = web_server_init() ) != UPNP_E_SUCCESS ) {
                return retVal;
            }
            bWebServerState = WEB_SERVER_ENABLED;
            SetHTTPGetCallback( web_server_callback );
            break;

        case FALSE:
            web_server_destroy();
            bWebServerState = WEB_SERVER_DISABLED;
            SetHTTPGetCallback( NULL );
            break;
#endif
        default:
            return UPNP_E_INVALID_PARAM;
    }

    return UPNP_E_SUCCESS;
}


Generated by  Doxygen 1.6.0   Back to index