Add Loop::setSilent
This commit is contained in:
+5
-2
@@ -82,9 +82,12 @@ private:
|
|||||||
|
|
||||||
/* Called only once per request */
|
/* Called only once per request */
|
||||||
void writeMark() {
|
void writeMark() {
|
||||||
|
/* You can disable this altogether */
|
||||||
#ifndef UWS_HTTPRESPONSE_NO_WRITEMARK
|
#ifndef UWS_HTTPRESPONSE_NO_WRITEMARK
|
||||||
/* We only expose major version */
|
if (!Super::getLoopData()->noMark) {
|
||||||
writeHeader("uWebSockets", "18");
|
/* We only expose major version */
|
||||||
|
writeHeader("uWebSockets", "18");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -164,6 +164,11 @@ public:
|
|||||||
void integrate() {
|
void integrate() {
|
||||||
us_loop_integrate((us_loop_t *) this);
|
us_loop_integrate((us_loop_t *) this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Dynamically change this */
|
||||||
|
void setSilent(bool silent) {
|
||||||
|
((LoopData *) us_loop_ext((us_loop_t *) this))->noMark = silent;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Can be called from any thread to run the thread local loop */
|
/* Can be called from any thread to run the thread local loop */
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ public:
|
|||||||
delete [] corkBuffer;
|
delete [] corkBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Be silent */
|
||||||
|
bool noMark = false;
|
||||||
|
|
||||||
/* Good 16k for SSL perf. */
|
/* Good 16k for SSL perf. */
|
||||||
static const int CORK_BUFFER_SIZE = 16 * 1024;
|
static const int CORK_BUFFER_SIZE = 16 * 1024;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user