fix xr806

* Update http_tcp_server.c

* Update http_tcp_server.c

* better naming

* debug print

* TRY TO CLEAR UP A BIT

* Update http_tcp_server.c

* Update http_tcp_server.c

* Update http_tcp_server.c

* Update http_tcp_server.c

* Update new_http.c

* XR auth disabled

* clear log

* Update OpenXR806

* Update OpenXR806

* Update new_http.c
This commit is contained in:
openshwprojects
2025-04-19 20:33:08 +02:00
committed by GitHub
parent 5d09349b9d
commit 782d478b87
4 changed files with 31 additions and 140 deletions

View File

@ -595,12 +595,15 @@ int postany(http_request_t* request, const char* str, int len) {
int currentlen;
int addlen = len;
//ADDLOG_ERROR(LOG_FEATURE_HTTP, "postany: got %i", len);
if (NULL == str) {
// fd will be NULL for unit tests where HTTP packet is faked locally
if (request->fd == 0) {
return request->replylen;
}
if (request->replylen > 0) {
//ADDLOG_ERROR(LOG_FEATURE_HTTP, "postany: send %i", request->replylen);
send(request->fd, request->reply, request->replylen, 0);
}
request->reply[0] = 0;
@ -610,6 +613,7 @@ int postany(http_request_t* request, const char* str, int len) {
currentlen = request->replylen;
if (currentlen + addlen >= request->replymaxlen) {
//ADDLOG_ERROR(LOG_FEATURE_HTTP, "postany: send %i", request->replylen);
send(request->fd, request->reply, request->replylen, 0);
request->reply[0] = 0;
request->replylen = 0;
@ -617,9 +621,11 @@ int postany(http_request_t* request, const char* str, int len) {
}
while (addlen >= request->replymaxlen) {
if (request->replylen > 0) {
//ADDLOG_ERROR(LOG_FEATURE_HTTP, "postany: send %i", request->replylen);
send(request->fd, request->reply, request->replylen, 0);
request->replylen = 0;
}
//ADDLOG_ERROR(LOG_FEATURE_HTTP, "postany: send %i", (request->replymaxlen - 1));
send(request->fd, str, (request->replymaxlen - 1), 0);
addlen -= (request->replymaxlen - 1);
str += (request->replymaxlen - 1);
@ -807,6 +813,7 @@ int HTTP_ProcessPacket(http_request_t* request) {
}
if (http_basic_auth_run(request) == HTTP_BASIC_AUTH_FAIL) {
ADDLOG_ERROR(LOG_FEATURE_HTTP, "HTTP packet with auth fail\n");
return 0;
}