private fork
Fork of GSwifiInterface by
Diff: GSwifi/GSwifi_http.cpp
- Revision:
- 11:71d67fea5ace
- Parent:
- 8:64184a968e3b
- Child:
- 12:057089026a20
diff -r 7d8134e7df01 -r 71d67fea5ace GSwifi/GSwifi_http.cpp --- a/GSwifi/GSwifi_http.cpp Thu Oct 31 08:34:45 2013 +0000 +++ b/GSwifi/GSwifi_http.cpp Fri Nov 15 04:20:14 2013 +0000 @@ -22,6 +22,8 @@ char ip[17]; int cid; + if (!isConnected() && _state.status == STAT_READY) return -1; + if (getHostByName(host, ip)) return -1; if (! port) { if (ssl) { @@ -45,6 +47,7 @@ cmdHTTPCONFDEL(2); } + _state.cid = -1; if (cmdHTTPOPEN(ip, port, ssl)) return -1; if (_state.cid < 0) return -1; cid = _state.cid; @@ -60,6 +63,8 @@ char ip[17]; int cid, len; + if (!isConnected() && _state.status == STAT_READY) return -1; + if (getHostByName(host, ip)) return -1; if (! port) { if (ssl) { @@ -85,6 +90,7 @@ cmdHTTPCONFDEL(2); } + _state.cid = -1; if (cmdHTTPOPEN(ip, port, ssl)) return -1; if (_state.cid < 0) return -1; cid = _state.cid;