Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lmj010308 fixed /http/server/HttpResponseWriter.cpp 使用SSEvent时,当event 为空指针时,不加event参数 #542

Merged
merged 2 commits into from
May 29, 2024

Conversation

lmj010308
Copy link
Contributor

int HttpResponseWriter::SSEvent(const std::string& data, const char* event /* = "message" */) {
if (state == SEND_BEGIN) {
EndHeaders("Content-Type", "text/event-stream");
}
std::string msg="";
if(event != nullptr){
msg = "event: "; msg += event; msg += "\n";
}
msg += "data: "; msg += data; msg += "\n\n";
state = SEND_BODY;
return write(msg);
}

@ithewei ithewei merged commit 336e748 into ithewei:master May 29, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants