Merge pull request #2 from Metrological/master

Minor changes to dial-reference client
This commit is contained in:
Jianchuan (J.C.) Li
2016-07-08 11:10:11 -07:00
committed by GitHub
3 changed files with 7 additions and 7 deletions

View File

@@ -168,7 +168,7 @@ private:
{ {
if( !stopurl.empty() ) if( !stopurl.empty() )
{ {
_pServer->stopApplication( stopurl, responseHeaders ); _pServer->stopApplication( _name, responseHeaders );
} }
#ifdef DEBUG #ifdef DEBUG
else ATRACE("%s: Not sending stop, stop URL is empty\n", __FUNCTION__); else ATRACE("%s: Not sending stop, stop URL is empty\n", __FUNCTION__);

View File

@@ -203,7 +203,7 @@ int DialServer::launchApplication(
{ {
ATRACE("%s: Launch %s\n", __FUNCTION__, application.c_str()); ATRACE("%s: Launch %s\n", __FUNCTION__, application.c_str());
string appUrl = m_appsUrl; string appUrl = m_appsUrl;
int status = sendCommand( appUrl.append(application), COMMAND_LAUNCH, payload, responseHeaders, responseBody); int status = sendCommand( appUrl.append("/" + application), COMMAND_LAUNCH, payload, responseHeaders, responseBody);
return status; return status;
} }
@@ -215,10 +215,10 @@ int DialServer::getStatus(
ATRACE("%s: GetStatus %s\n", __FUNCTION__, application.c_str()); ATRACE("%s: GetStatus %s\n", __FUNCTION__, application.c_str());
string emptyPayload; string emptyPayload;
string appUrl = m_appsUrl; string appUrl = m_appsUrl;
int status = sendCommand( appUrl.append(application), COMMAND_STATUS, emptyPayload, responseHeaders, responseBody ); int status = sendCommand( appUrl.append("/" + application), COMMAND_STATUS, emptyPayload, responseHeaders, responseBody );
if (!status) return 0; if (!status) return 0;
ATRACE("Body: %s\n", responseBody.c_str()); //ATRACE("Body: %s\n", responseBody.c_str());
unsigned found = responseBody.find("href="); unsigned found = responseBody.find("href=");
if( found != string::npos ) if( found != string::npos )
{ {
@@ -246,8 +246,8 @@ int DialServer::stopApplication(
getStatus( application, responseHeaders, responseBody ); getStatus( application, responseHeaders, responseBody );
int status = sendCommand( int status = sendCommand(
(appUrl.append(application)).append("/"+m_stopEndPoint), (appUrl.append("/" + application)).append("/"+m_stopEndPoint),
COMMAND_KILL, emptyPayload, responseHeaders, responseBody ); COMMAND_KILL, emptyPayload, responseHeaders, responseBody );
return status; return status;
} }

View File

@@ -8,7 +8,7 @@ OBJS := main.cpp DialServer.cpp DialDiscovery.cpp DialConformance.cpp DialClient
# You may not need all these libraries. This example uses a build of curl that needs crypto, ssl, cares, and zlib # You may not need all these libraries. This example uses a build of curl that needs crypto, ssl, cares, and zlib
dialclient: $(OBJS) ${includes} dialclient: $(OBJS) ${includes}
$(CC) -Wall -Werror -g $(OBJS) $(INCLUDES) $(LDFLAGS) -ldl -lpthread -lcurl -lz -lcrypto -lssl -lcares -m32 -o dialclient $(CC) -Wall -g $(OBJS) $(INCLUDES) $(LDFLAGS) -ldl -lpthread -lcurl -lz -lcrypto -lssl -lcares -o dialclient
clean: clean:
rm -f *.o dialclient rm -f *.o dialclient