{
int iarg1 = iargs.front();
iargs.pop_front();
- srand(time(0) + getpid());
+ srand(time(0) + getpid() + client->whoami);
sleep(rand() % iarg1);
}
break;
{
string prefix = get_sarg();
int iarg1 = iargs.front(); iargs.pop_front();
-
+
Trace t("traces/trace.openssh.lib");
client->mkdir(prefix.c_str(), 0755);
cr.append(buf, r);
}
close(fd);
-
+
// copy
tl->len = cr.length()+1;
- tl->data = new char[cr.length()];
+ tl->data = new char[tl->len];
memcpy(tl->data, cr.c_str(), cr.length());
tl->data[tl->len-1] = '\n';
-
+
// index!
int o = 0;
while (o < tl->len) {
dout(1) << "trace " << filename << " loaded with " << tl->tokens.size() << " tokens" << endl;
traces[filename] = tl;
}
+
tl->ref++;
trace_lock.Unlock();
#ifndef __CLIENT_TRACE_H
#define __CLIENT_TRACE_H
+#include <cassert>
#include <list>
#include <string>
using namespace std;
char strings[10][200];
int ns;
const char *get_string(const char *prefix = 0) {
+ assert(_cur != _end);
const char *s = *_cur;
_cur++;
if (prefix) {