|
@@ -147,6 +147,7 @@ static err_t http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t er
|
|
|
char *data;
|
|
|
struct http_state *hs;
|
|
|
struct fs_file file = {0, 0};
|
|
|
+ char buf[150];
|
|
|
|
|
|
hs = arg;
|
|
|
|
|
@@ -166,7 +167,7 @@ static err_t http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t er
|
|
|
memcpy(receiveBuf, p->payload , receivedBufLen);
|
|
|
|
|
|
// На производстве
|
|
|
- if (strncmp(data, "GET /setProdate.cgi", 19) == 0)
|
|
|
+ if (strncmp(data, "GET /setProdate.cgi", 19) == 0 && strncmp(sSettings.sFlags.testState, "T2OK", 4) == 0)
|
|
|
{
|
|
|
HTTP_Prodate(receiveBuf, sendBuf, receivedBufLen, &sendBufLoadLen);
|
|
|
|
|
@@ -175,6 +176,27 @@ static err_t http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t er
|
|
|
send_data(pcb, hs);
|
|
|
tcp_sent(pcb, http_sent);
|
|
|
}
|
|
|
+ else {
|
|
|
+ strcpy(sendBuf, "HTTP/1.1 200 OK\r\n");
|
|
|
+ strcat(sendBuf, "\r\n\r\n");
|
|
|
+ memset(buf, 0, 100);
|
|
|
+ // strcat(sendBuf,"<!DOCTYPE html><html lang=""><head><meta http-equiv=\"refresh\" content=\"0;url=https://192.168.14.35\"/></head></html>\r\n\r\n");
|
|
|
+ if (sSettings.sFlags.netsettingsChanged == true)
|
|
|
+ sprintf(buf, "<!DOCTYPE html><html lang=""><head><meta http-equiv=\"refresh\" content=\"0;url=https://%s\"/></head></html>\r\n\r\n", sSettings.sWebTempParams.ip);
|
|
|
+ else
|
|
|
+ sprintf(buf, "<!DOCTYPE html><html lang=""><head><meta http-equiv=\"refresh\" content=\"0;url=https://%s\"/></head></html>\r\n\r\n", sSettings.sWebParams.ip);
|
|
|
+ strcat(sendBuf,buf);
|
|
|
+ // strcat(sendBuf,"1");
|
|
|
+
|
|
|
+ sendBufLoadLen = strlen(sendBuf);
|
|
|
+ hs->file = sendBuf;
|
|
|
+ hs->left = sendBufLoadLen;
|
|
|
+ send_data(pcb, hs);
|
|
|
+
|
|
|
+ /* Tell TCP that we wish be to informed of data that has been
|
|
|
+ successfully sent by a call to the http_sent() function. */
|
|
|
+ tcp_sent(pcb, http_sent);
|
|
|
+ }
|
|
|
}
|
|
|
pbuf_free(p);
|
|
|
close_conn(pcb,hs);
|