void setup_test_mock_server(test_baton_t *tb) { if (!tb->mh) /* TODO: move this to test_setup */ tb->mh = mhInit(); InitMockServers(tb->mh) SetupServer(WithHTTP, WithID("server"), WithPort(30080)) EndInit tb->serv_port = mhServerPortNr(tb->mh); tb->serv_host = apr_psprintf(tb->pool, "%s:%d", "localhost", tb->serv_port); tb->serv_url = apr_psprintf(tb->pool, "http://%s", tb->serv_host); }
NetworkRemoteHelper::NetworkRemoteHelper(Application* app) : app_(app) { app_ = app; connect(this, SIGNAL(ReloadSettingsSig()), app_->network_remote(), SLOT(ReloadSettings())); connect(this, SIGNAL(StartServerSig()), app_->network_remote(), SLOT(StartServer())); connect(this, SIGNAL(SetupServerSig()), app_->network_remote(), SLOT(SetupServer())); // Start the server once the playlistmanager is initialized connect(app_->playlist_manager(), SIGNAL(PlaylistManagerInitialized()), this, SLOT(StartServer())); sInstance = this; }
void setup_test_mock_https_server(test_baton_t *tb, const char *keyfile, const char **certfiles, test_verify_clientcert_t t) { if (!tb->mh) tb->mh = mhInit(); InitMockServers(tb->mh) SetupServer(WithHTTPS, WithID("server"), WithPort(30080), WithCertificateFilesPrefix(get_srcdir_file(tb->pool, "test/certs")), WithCertificateKeyFile(keyfile), WithCertificateKeyPassPhrase("serftest"), WithCertificateFileArray(certfiles), OnConditionThat(t == test_clientcert_mandatory, WithRequiredClientCertificate), OnConditionThat(t == test_clientcert_optional, WithOptionalClientCertificate)) EndInit tb->serv_port = mhServerPortNr(tb->mh); tb->serv_host = apr_psprintf(tb->pool, "%s:%d", "localhost", tb->serv_port); tb->serv_url = apr_psprintf(tb->pool, "https://%s", tb->serv_host); }