“存在BUG
git commit -m “存在BUG
This commit is contained in:
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
#include "HttpClient.h"
|
#include "HttpClient.h"
|
||||||
#include "b64.h"
|
#include "b64.h"
|
||||||
|
|
||||||
// Initialize constants
|
// Initialize constants
|
||||||
const char* HttpClient::kUserAgent = "Arduino/2.2.0";
|
const char* HttpClient::kUserAgent = "Arduino/2.2.0";
|
||||||
const char* HttpClient::kContentLengthPrefix = HTTP_HEADER_CONTENT_LENGTH ": ";
|
const char* HttpClient::kContentLengthPrefix = HTTP_HEADER_CONTENT_LENGTH ": ";
|
||||||
@ -687,13 +686,13 @@ bool HttpClient::headerAvailable()
|
|||||||
{
|
{
|
||||||
// clear the currently store header line
|
// clear the currently store header line
|
||||||
iHeaderLine = "";
|
iHeaderLine = "";
|
||||||
|
int i = 0;
|
||||||
while (!endOfHeadersReached())
|
while (!endOfHeadersReached())
|
||||||
{
|
{
|
||||||
// read a byte from the header
|
// read a byte from the header
|
||||||
int c = readHeader();
|
int c = readHeader();
|
||||||
|
|
||||||
if (c == '\r' || c == '\n')
|
if (c == '\r' || c == '\n'||c==-1)
|
||||||
{
|
{
|
||||||
if (iHeaderLine.length())
|
if (iHeaderLine.length())
|
||||||
{
|
{
|
||||||
@ -709,6 +708,8 @@ bool HttpClient::headerAvailable()
|
|||||||
|
|
||||||
// append byte to header line
|
// append byte to header line
|
||||||
iHeaderLine += (char)c;
|
iHeaderLine += (char)c;
|
||||||
|
i++;
|
||||||
|
if(i>20000) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (iHeaderLine.length() > 0);
|
return (iHeaderLine.length() > 0);
|
||||||
|
@ -61,13 +61,18 @@ String getnetData()
|
|||||||
int times_try = 0;
|
int times_try = 0;
|
||||||
while (http->headerAvailable())
|
while (http->headerAvailable())
|
||||||
{
|
{
|
||||||
if(times_try > 1000)
|
|
||||||
|
if(times_try > 100)
|
||||||
{
|
{
|
||||||
write_log(log_path,100,"http->headerAvailable failed ...");
|
write_log(log_path,100,"http->headerAvailable failed ...");
|
||||||
return "-1";
|
return "-1";
|
||||||
}
|
}
|
||||||
|
write_log(log_path,100,"http->readHeaderName");
|
||||||
String headerName = http->readHeaderName();
|
String headerName = http->readHeaderName();
|
||||||
|
write_log(log_path,100,"http->readHeaderValue");
|
||||||
String headerValue = http->readHeaderValue();
|
String headerValue = http->readHeaderValue();
|
||||||
|
write_log(log_path,100,String(times_try)+"http->headerName "+headerName);
|
||||||
|
write_log(log_path,100,String(times_try)+"http->headerValue "+headerValue);
|
||||||
// SerialMon.println("Date: " + headerName + " : " + headerValue);
|
// SerialMon.println("Date: " + headerName + " : " + headerValue);
|
||||||
vTaskDelay(100);
|
vTaskDelay(100);
|
||||||
times_try++;
|
times_try++;
|
||||||
@ -242,7 +247,6 @@ void Reuploaddata() //重新上传数据
|
|||||||
ReuploadData("/down", "/weather/php/SpectralDataUp.php");
|
ReuploadData("/down", "/weather/php/SpectralDataUp.php");
|
||||||
ReuploadData("/up", "/weather/php/SpectralDataUp.php");
|
ReuploadData("/up", "/weather/php/SpectralDataUp.php");
|
||||||
ReuploadData("/other", "/weather/php/WindsensorUp.php", "application/json");
|
ReuploadData("/other", "/weather/php/WindsensorUp.php", "application/json");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String Datenow="";
|
String Datenow="";
|
||||||
|
Reference in New Issue
Block a user