mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
- yWeb: try to fix empty pages
This commit is contained in:
@@ -96,8 +96,10 @@ void CWebserverConnection::HandleConnection() {
|
||||
if(string_tolower(Request.HeaderList["Connection"]) == "close"
|
||||
|| (httprotocol != "HTTP/1.1" && string_tolower(Request.HeaderList["Connection"]) != "keep-alive")
|
||||
|| !Webserver->CheckKeepAliveAllowedByIP(sock->get_client_ip()))
|
||||
#endif
|
||||
keep_alive = false;
|
||||
#else
|
||||
keep_alive = false;
|
||||
#endif
|
||||
|
||||
// Send a response
|
||||
Response.SendResponse();
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include "ysocket.h"
|
||||
#include "yconnection.h"
|
||||
#include "yrequest.h"
|
||||
#include <system/set_threadname.h>
|
||||
|
||||
//=============================================================================
|
||||
// Initialization of static variables
|
||||
@@ -117,6 +118,7 @@ CWebserver::~CWebserver() {
|
||||
#define MAX_TIMEOUTS_TO_CLOSE 10
|
||||
#define MAX_TIMEOUTS_TO_TEST 100
|
||||
bool CWebserver::run(void) {
|
||||
set_threadname(__func__);
|
||||
if (!listenSocket.listen(port, HTTPD_MAX_CONNECTIONS)) {
|
||||
if (port != 80) {
|
||||
fprintf(stderr, "[yhttpd] Socket cannot bind and listen on port %d Abort.\n", port);
|
||||
@@ -226,6 +228,8 @@ bool CWebserver::run(void) {
|
||||
CySocket *newConnectionSock;
|
||||
if (!(newConnectionSock = listenSocket.accept())) //Now: Blocking wait
|
||||
{
|
||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||
pthread_testcancel();
|
||||
dperror("Socket accept error. Continue.\n");
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user