Skip to content

Commit

Permalink
removed test crash routines
Browse files Browse the repository at this point in the history
  • Loading branch information
netmaniac committed May 18, 2020
1 parent 42fe895 commit 46cb5fc
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,22 +505,6 @@ void webserver_prometheus_endpoint() {
server.send(200, FPSTR(TXT_CONTENT_TYPE_TEXT_PLAIN), data_4_prometheus);
}

void crashme(){
int* i = NULL;
*i = 80;
}

void crashme2(){
char *svptr = NULL;
static char* str_input = NULL;
const char delim[] = " ";
char input[] = "bla";
size_t malloc_amount = (sizeof(char) * 0) & (~3);
str_input = (char *)malloc(malloc_amount);
memset(str_input, '\0', 0);
strcpy(str_input, input);
}

/*****************************************************************
* Webserver setup *
*****************************************************************/
Expand All @@ -539,35 +523,6 @@ void setup_webserver() {
server.on("/metrics", webserver_prometheus_endpoint);
server.on("/images", webserver_images);
server.on("/stack_dump", webserver_dump_stack);
server.on("/crash", [](){
server.send(200, "text/plain", "ESP8266 is going to crash with EXCEPTION..");
char linea[]="0x123456",**ap;
int num;
num=strtol(linea,ap,0);
printf("%d\n%s",num,*ap);
int k;
});
server.on("/crash2", [](){
server.send(200, "text/plain", "ESP8266 is going to crash with SOFT_WDT..");
while (true){
Serial.println("Crashing...");
}
});
server.on("/crash3", [](){
server.send(200, "text/plain", "ESP8266 is goign to crash with WDT..");
ESP.wdtDisable();
while (true){
Serial.println("Crashing...");
}
});
server.on("/crash4", [](){
server.send(200, "text/plain", "ESP8266 is going to crash with EXCEPTION..");
crashme();
});
server.on("/crash5", [](){
server.send(200, "text/plain", "ESP8266 is going to crash with EXCEPTION..");
crashme2();
});
server.onNotFound(webserver_not_found);

debug_out(F("Starting Webserver... "), DEBUG_MIN_INFO, 0);
Expand Down

0 comments on commit 46cb5fc

Please sign in to comment.