Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content-Length variable we use for sending update file needs to be case insensitive #27731

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Tools/AP_Bootloader/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,14 @@ void BL_Network::handle_request(SocketAPM *sock)
sock->send(header, strlen(header));

if (strncmp(headers, "POST / ", 7) == 0) {
const char *clen = "\r\nContent-Length:";
const char *p = strstr(headers, clen);
const char *clen1 = "\r\nContent-Length:";
const char *clen2 = "\r\ncontent-length:";
const char *p = strstr(headers, clen1);
if (p == nullptr) {
p = strstr(headers, clen2);
}
if (p != nullptr) {
p += strlen(clen);
p += strlen(clen1);
const uint32_t content_length = atoi(p);
handle_post(sock, content_length);
delete headers;
Expand Down
Binary file modified Tools/bootloaders/CubePilot-PPPGW_bl.bin
Binary file not shown.
Binary file modified Tools/bootloaders/CubeRedPrimary-PPPGW_bl.bin
Binary file not shown.
Binary file modified Tools/bootloaders/Pixhawk6X-PPPGW_bl.bin
Binary file not shown.
3 changes: 0 additions & 3 deletions libraries/AP_HAL_ChibiOS/hwdef/CubePilot-PPPGW/hwdef-bl.dat
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,3 @@ define BOARD_PHY_ID MII_LAN8720_ID
define BOARD_PHY_RMII

include ../include/network_bootloader.inc

# allow USB bootloader too
SERIAL_ORDER OTG1
Loading