Cumulocity Official / Mbed 2 deprecated MbedSmartRestMain Featured

Dependencies:   C027_Support C12832 LM75B MMA7660 MbedSmartRest mbed-rtos mbed

Fork of MbedSmartRestMain by Vincent Wochnik

Revision:
125:979ab0d075de
Parent:
124:311fa85af2b3
Child:
126:e1fcf720c63a
--- a/operation/PollThread.cpp	Fri May 29 12:05:01 2015 +0000
+++ b/operation/PollThread.cpp	Mon Jun 01 11:24:17 2015 +0000
@@ -9,10 +9,11 @@
         l = snprintf(buf, sizeof(buf), fmtSmartRest, uri, l, buf2);
         sock.setBlocking(3000);
         l = sock.sendAndReceive(buf, l, sizeof(buf));
-        if (l <= 0)
-                return false;
+        if (l <= 0) return false;
+        const char* p = skipHTTPHeader(buf);
+        if (p == NULL) return false;
         size_t i = 0;
-        for (const char* p = skipHTTPHeader(buf); isalnum(*p); ++p, ++i) {
+        for (; isalnum(*p); ++p, ++i) {
                 bayeuxId[i] = *p;
         }
         bayeuxId[i] = 0;