mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-03-12 02:18:31 +00:00
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:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user