compile errors
[iotcloud.git] / version2 / src / C / CloudComm.cc
index dc2835507966b311950773da54347ce3921028eb..9055d8624c0e2708decad944755a829c94681438 100644 (file)
@@ -29,7 +29,6 @@ CloudComm::CloudComm() :
        salt(NULL),
        table(NULL),
        listeningPort(-1),
-       localServerThread(NULL),
        doEnd(false),
        timer(TimingSingleton_getInstance()),
        getslot(new Array<char>("getslot", 7)),
@@ -55,7 +54,6 @@ CloudComm::CloudComm(Table *_table,  IoTString *_baseurl, IoTString *_password,
        salt(NULL),
        table(_table),
        listeningPort(_listeningPort),
-       localServerThread(NULL),
        doEnd(false),
        timer(TimingSingleton_getInstance()) {
        if (listeningPort > 0) {
@@ -354,7 +352,8 @@ int getResponseCode(int fd) {
        }
        response[offset] = 0;
        int ver1 = 0, ver2 = 0, respcode = 0;
-       sscanf(response, "HTTP-%d.%d %d", &ver1, &ver2, &respcode);
+       sscanf(response, "HTTP/%d.%d %d", &ver1, &ver2, &respcode);
+       printf("Response code %d\n", respcode);
        return respcode;
 }
 
@@ -723,7 +722,7 @@ void CloudComm::localServerWorkerFunction() {
 void CloudComm::closeCloud() {
        doEnd = true;
 
-       if (localServerThread != NULL) {
+       if (listeningPort > 0) {
                if (pthread_join(localServerThread, NULL) != 0)
                        throw new Error("Local Server thread join issue...");
        }