private fork

Fork of GSwifiInterface by gs fan

Revision:
18:20970aec3ad3
Parent:
16:105b56570533
Child:
19:d035412a7803
--- a/GSwifi/GSwifi_httpd.cpp	Fri Mar 07 15:16:55 2014 +0000
+++ b/GSwifi/GSwifi_httpd.cpp	Mon May 12 01:24:09 2014 +0000
@@ -85,10 +85,12 @@
         case 0x0d: // CR
             break;
         case 0x0a: // LF
-            if (_httpd[cid].buf != NULL && _httpd[cid].buf->available() == 0) {
+//            if (_httpd[cid].buf != NULL && _httpd[cid].buf->available() == 0) {
 //                if ((_httpd[cid].enter == 0x0d && c == 0x0a) || (_httpd[cid].enter == 0x0a && c == 0x0a)) {
                 if (_httpd[cid].enter == 0x0a && c == 0x0a) {
-                    _httpd[cid].buf->flush();
+                    if (_httpd[cid].buf != NULL) {
+                        _httpd[cid].buf->flush();
+                    }
 #ifdef CFG_ENABLE_WEBSOCKET
                     if (_httpd[cid].websocket) {
                         INFO("MODE_WEBSOCKET_BEGIN");
@@ -104,13 +106,11 @@
                         _con[cid].received = true;
                     }
                 }
-                _httpd[cid].buf->flush();
-                _httpd[cid].enter = c;
-                break;
-            }
+//                break;
+//            }
 
+            _httpd[cid].enter = c;
             httpdParseHeader(cid);
-            _httpd[cid].enter = c;
             break;
         default:
             if (_httpd[cid].buf != NULL) {