@@ -31,18 +31,7 @@ struct hstcpcli : public hstcpcli_i, private noncopyable {
3131 virtual bool stable_point ();
3232 virtual void request_buf_open_index (size_t pst_id, const char *dbn,
3333 const char *tbl, const char *idx, const char *retflds, const char *filflds);
34- virtual void request_buf_auth (const char *secret);
35- #if 0
36- virtual void request_buf_find(size_t pst_id, const string_ref& op,
37- const string_ref *kvs, size_t kvslen, uint32_t limit, uint32_t skip);
38- virtual void request_buf_insert(size_t pst_id, const string_ref *fvs,
39- size_t fvslen);
40- virtual void request_buf_update(size_t pst_id, const string_ref& op,
41- const string_ref *kvs, size_t kvslen, uint32_t limit, uint32_t skip,
42- const string_ref *mvs, size_t mvslen);
43- virtual void request_buf_delete(size_t pst_id, const string_ref& op,
44- const string_ref *kvs, size_t kvslen, uint32_t limit, uint32_t skip);
45- #endif
34+ virtual void request_buf_auth (const char *secret, const char *typ);
4635 virtual void request_buf_exec_generic (size_t pst_id, const string_ref& op,
4736 const string_ref *kvs, size_t kvslen, uint32_t limit, uint32_t skip,
4837 const string_ref& mod_op, const string_ref *mvs, size_t mvslen,
@@ -199,15 +188,21 @@ hstcpcli::request_buf_open_index(size_t pst_id, const char *dbn,
199188}
200189
201190void
202- hstcpcli::request_buf_auth (const char *secret)
191+ hstcpcli::request_buf_auth (const char *secret, const char *typ )
203192{
204193 if (num_req_sent > 0 || num_req_rcvd > 0 ) {
205194 close ();
206195 set_error (-1 , " request_buf_auth: protocol out of sync" );
207196 return ;
208197 }
198+ if (typ == 0 ) {
199+ typ = " 1" ;
200+ }
201+ const string_ref typ_ref (typ, strlen (typ));
209202 const string_ref secret_ref (secret, strlen (secret));
210- writebuf.append_literal (" A\t 1\t " );
203+ writebuf.append_literal (" A\t " );
204+ writebuf.append (typ_ref.begin (), typ_ref.end ());
205+ writebuf.append_literal (" \t " );
211206 writebuf.append (secret_ref.begin (), secret_ref.end ());
212207 writebuf.append_literal (" \n " );
213208 ++num_req_bufd;
@@ -295,44 +290,6 @@ hstcpcli::request_buf_exec_generic(size_t pst_id, const string_ref& op,
295290 ++num_req_bufd;
296291}
297292
298- #if 0
299- void
300- hstcpcli::request_buf_find(size_t pst_id, const string_ref& op,
301- const string_ref *kvs, size_t kvslen, uint32_t limit, uint32_t skip)
302- {
303- return request_buf_exec_generic(pst_id, op, kvs, kvslen, limit, skip,
304- 0, 0, 0);
305- }
306-
307- void
308- hstcpcli::request_buf_insert(size_t pst_id, const string_ref *fvs,
309- size_t fvslen)
310- {
311- const string_ref insert_op("+", 1);
312- return request_buf_exec_generic(pst_id, insert_op, fvs, fvslen,
313- 0, 0, string_ref(), 0, 0);
314- }
315-
316- void
317- hstcpcli::request_buf_update(size_t pst_id, const string_ref& op,
318- const string_ref *kvs, size_t kvslen, uint32_t limit, uint32_t skip,
319- const string_ref *mvs, size_t mvslen)
320- {
321- const string_ref modop_update("U", 1);
322- return request_buf_exec_generic(pst_id, op, kvs, kvslen, limit, skip,
323- modop_update, mvs, mvslen);
324- }
325-
326- void
327- hstcpcli::request_buf_delete(size_t pst_id, const string_ref& op,
328- const string_ref *kvs, size_t kvslen, uint32_t limit, uint32_t skip)
329- {
330- const string_ref modop_delete("D", 1);
331- return request_buf_exec_generic(pst_id, op, kvs, kvslen, limit, skip,
332- modop_delete, 0, 0);
333- }
334- #endif
335-
336293int
337294hstcpcli::request_send ()
338295{
0 commit comments