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

Method build_request

lib_acl_cpp/src/hsocket/hsproto.cpp:182–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182void hsproto::build_request(string& buf, int id, const char* oper,
183 const char* values[], int num,
184 const char* limit_offset, char mop,
185 const char* to_values[], int to_num)
186{
187 char idbuf[32], numbuf[32];
188
189 buf.clear();
190
191 safe_snprintf(idbuf, sizeof(idbuf), "%d", id);
192 safe_snprintf(numbuf, sizeof(numbuf), "%d", num);
193 buf << idbuf << "\t" << oper << "\t" << numbuf;
194
195 int i;
196 for (i = 0; i < num; i++) {
197 buf << "\t";
198 escape(values[i], strlen(values[i]), buf);
199 }
200
201 if (limit_offset) {
202 buf << "\t" << limit_offset;
203 }
204
205 if (mop) {
206 buf << "\t" << mop;
207 }
208
209 if (to_values && to_num > 0) {
210 for (i = 0; i < to_num; i++) {
211 buf << "\t";
212 escape(to_values[i], strlen(to_values[i]), buf);
213 }
214 }
215
216 buf << "\n";
217}
218
219static const char* dummy_ok = "ok";
220

Callers 15

startFunction · 0.45
http_clientFunction · 0.45
onUrlGetMethod · 0.45
runMethod · 0.45
ws_handshake_beforeMethod · 0.45
test_websocket_mainFunction · 0.45
rpc_runMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45
get_urlFunction · 0.45
rpc_runMethod · 0.45
test1Function · 0.45

Calls 3

safe_snprintfFunction · 0.85
escapeFunction · 0.50
clearMethod · 0.45

Tested by 1

test_websocket_mainFunction · 0.36