Squashed commit of the following: commit 5f16309f629b9928d2134b85ae64af69bc3ebbcd Author: kuwoyuki <kuwoyuki@cock.li> Date: Sun Nov 24 22:55:15 2024 +0600 fix: Makefile, improve onewire retries commit 55496a3bda941b52ff349dc75c9c06eb5a37c07d Author: kuwoyuki <kuwoyuki@cock.li> Date: Mon Nov 18 00:41:18 2024 +0600 fix: make onewire validity less strict commit 3428a9bc9792508972ce3e7e4e35a64f047bca10 Author: kuwoyuki <kuwoyuki@cock.li> Date: Sun Nov 17 23:57:55 2024 +0600 chore: rm bins commit 1594e5ed430522b15466c8afa62ff7fb1b28947c Author: kuwoyuki <kuwoyuki@cock.li> Date: Sun Nov 17 23:32:01 2024 +0600 chore: unplatformiofy
76 lines
1.4 KiB
C
76 lines
1.4 KiB
C
/**
|
|
* @file httpUtil.c
|
|
* @brief HTTP Server Utilities
|
|
* @version 1.0
|
|
* @date 2014/07/15
|
|
* @par Revision
|
|
* 2014/07/15 - 1.0 Release
|
|
* @author
|
|
* \n\n @par Copyright (C) 1998 - 2014 WIZnet. All rights reserved.
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#include "httpUtil.h"
|
|
|
|
uint8_t http_get_cgi_handler(uint8_t * uri_name, uint8_t * buf, uint32_t * file_len)
|
|
{
|
|
uint8_t ret = HTTP_OK;
|
|
uint16_t len = 0;
|
|
|
|
if(predefined_get_cgi_processor(uri_name, buf, &len))
|
|
{
|
|
;
|
|
}
|
|
else if(strcmp((const char *)uri_name, "example.cgi") == 0)
|
|
{
|
|
// To do
|
|
;
|
|
}
|
|
else
|
|
{
|
|
// CGI file not found
|
|
ret = HTTP_FAILED;
|
|
}
|
|
|
|
if(ret) *file_len = len;
|
|
return ret;
|
|
}
|
|
|
|
uint8_t http_post_cgi_handler(uint8_t * uri_name, st_http_request * p_http_request, uint8_t * buf, uint32_t * file_len)
|
|
{
|
|
uint8_t ret = HTTP_OK;
|
|
uint16_t len = 0;
|
|
uint8_t val = 0;
|
|
|
|
if(predefined_set_cgi_processor(uri_name, p_http_request->URI, buf, &len))
|
|
{
|
|
;
|
|
}
|
|
else if(strcmp((const char *)uri_name, "example.cgi") == 0)
|
|
{
|
|
// To do
|
|
val = 1;
|
|
len = sprintf((char *)buf, "%d", val);
|
|
}
|
|
else
|
|
{
|
|
// CGI file not found
|
|
ret = HTTP_FAILED;
|
|
}
|
|
|
|
if(ret) *file_len = len;
|
|
return ret;
|
|
}
|
|
|
|
uint8_t predefined_get_cgi_processor(uint8_t * uri_name, uint8_t * buf, uint16_t * len)
|
|
{
|
|
;
|
|
}
|
|
|
|
uint8_t predefined_set_cgi_processor(uint8_t * uri_name, uint8_t * uri, uint8_t * buf, uint16_t * en)
|
|
{
|
|
;
|
|
}
|