Commit ef7415be authored by Raptor Engineering Development Team's avatar Raptor Engineering Development Team
Browse files

Update for Zephyr 3.1.x

NOTE: Mulitple SPI Flash functionality currently broken in Zephyr.
DO NOT USE FOR PRODUCTION
parent e0c0b48b
/*
* Copyright (c) 2019 Antmicro Ltd
* Copyright (c) 2020 Alexander Kozhinov <AlexanderKozhinov@yandex.com>
* Copyright (c) 2022 Raptor Engineering <sales@raptorengineering.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
......@@ -9,6 +10,9 @@ static void log_access(const struct mg_connection *conn)
{
const struct mg_request_info *ri;
char src_addr[IP_ADDR_STR_LEN];
char assembled_uri[128];
int len;
int pos;
if (!conn || !conn->dom_ctx) {
return;
......@@ -18,12 +22,31 @@ static void log_access(const struct mg_connection *conn)
sockaddr_to_string(src_addr, sizeof(src_addr), &conn->client.rsa);
LOG_DBG("%s - \"%s %s%s%s HTTP/%s\" %d\n",
pos = 0;
len = strlen(ri->request_uri);
if ((pos + len) >= sizeof(assembled_uri)) {
len = (sizeof(assembled_uri) - pos) - 1;
}
memcpy(assembled_uri + pos, ri->request_uri, len);
pos += len;
if (ri->query_string != NULL) {
if ((pos + len) < sizeof(assembled_uri)) {
assembled_uri[pos] = '?';
pos++;
}
}
len = strlen(ri->query_string);
if ((pos + len) >= sizeof(assembled_uri)) {
len = (sizeof(assembled_uri) - pos) - 1;
}
memcpy(assembled_uri + pos, ri->query_string, len);
pos += len;
assembled_uri[pos] = 0;
LOG_DBG("%s - \"%s %s HTTP/%s\" %d\n",
STR_LOG_ALLOC(src_addr),
STR_LOG_ALLOC(ri->request_method),
STR_LOG_ALLOC(ri->request_uri),
(ri->query_string == NULL) ? log_strdup("?") : log_strdup(""),
STR_LOG_ALLOC(ri->query_string),
STR_LOG_ALLOC(assembled_uri),
STR_LOG_ALLOC(ri->http_version),
conn->status_code);
}
}
\ No newline at end of file
......@@ -171,12 +171,6 @@ double atof(const char *str)
return (double)atoi(str);
}
long long strtoll(const char *str, char **endptr, int base)
{
/* XXX good enough for civetweb uses */
return (long long)strtol(str, endptr, base);
}
/*
* Most of the wrappers below are copies of the wrappers in net/sockets.h,
* but they are available only if CONFIG_NET_SOCKETS_POSIX_NAMES is enabled
......
......@@ -252,7 +252,7 @@ static int configure_gpios(void)
void main(void)
{
// Set root command and prompt for all shells
Z_STRUCT_SECTION_FOREACH(shell, sh) {
STRUCT_SECTION_FOREACH(shell, sh) {
shell_prompt_change(sh, "FSP0>");
}
shell_set_root_cmd("kestrel");
......
......@@ -45,7 +45,7 @@ CONFIG_MINIMAL_LIBC_MALLOC_ARENA_SIZE=100663296
# Logging settings
#CONFIG_LOG_MODE_MINIMAL=y
#CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_LOG2_MODE_DEFERRED=y
#CONFIG_LOG2_MODE_DEFERRED=y
CONFIG_LOG_RUNTIME_FILTERING=y
CONFIG_LOG_BUFFER_SIZE=65536
CONFIG_LOG_PRINTK=n
......@@ -80,7 +80,7 @@ CONFIG_NET_STATISTICS=y
CONFIG_NET_CONNECTION_MANAGER=y
CONFIG_NET_MGMT=y
CONFIG_NET_MGMT_EVENT=y
CONFIG_NET_TCP_BACKLOG_SIZE=16
#CONFIG_NET_TCP_BACKLOG_SIZE=16
# Network buffers
CONFIG_NET_PKT_RX_COUNT=4096
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment