Skip to content

Commit

Permalink
Move mark from WebSockets down to HTTP
Browse files Browse the repository at this point in the history
  • Loading branch information
uNetworkingAB committed Jan 26, 2019
1 parent 92fb74b commit 4d06180
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/App.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ struct TemplatedApp {
httpContext->filter(std::move(filterHandler));
}

void registerTag() {

}

~TemplatedApp() {
/* Let's just put everything here */
if (httpContext) {
Expand Down Expand Up @@ -179,8 +175,8 @@ struct TemplatedApp {
}
}

/* Add mark, we don't want to end anything */
res->writeHeader("WebSocket-Server", "uWebSockets")->end();
/* This will add our mark */
res->end();

/* Move any backpressure */
std::string backpressure(std::move(((AsyncSocketData<SSL> *) res->getHttpResponseData())->buffer));
Expand Down
3 changes: 3 additions & 0 deletions src/HttpResponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ struct HttpResponse : public AsyncSocket<SSL> {
/* Write status if not already done */
writeStatus(HTTP_200_OK);

/* Write mark, this propagates to WebSockets too */
writeHeader("Web-Server", "uWebSockets v0.15");

/* If no total size given then assume this chunk is everything */
if (!totalSize) {
totalSize = data.length();
Expand Down

0 comments on commit 4d06180

Please sign in to comment.