MCPcopy Create free account
hub / github.com/acl-dev/acl / onMessage

Method onMessage

lib_acl_cpp/samples/http/webSocketServlet/WebsocketServlet_impl.cpp:87–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87bool WebsocketServlet_impl::onMessage(unsigned long long payload_len,
88 bool text, bool finish)
89{
90 (void) text;
91 (void) finish;
92
93 switch (step_) {
94 case 0:
95 step_++;
96 return getFilename(payload_len);
97 case 1:
98 step_++;
99 if (getFilesize(payload_len) == false) {
100 fp_.close();
101 return false;
102 }
103 return true;
104 case 2:
105 if (saveFile(payload_len) == false) {
106 fp_.close();
107 return false;
108 }
109 return true;
110 default:
111 return true;
112 }
113}
114
115bool WebsocketServlet_impl::getFilename(unsigned long long payload_len)
116{

Callers 1

olFunction · 0.45

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected