MCPcopy Create free account
hub / github.com/SIPp/sipp / process_set

Function process_set

src/socket.cpp:119–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119static void process_set(char* what)
120{
121 char *rest = strchr(what, ' ');
122 if (rest) {
123 *rest++ = '\0';
124 trim(rest);
125 } else {
126 WARNING("The set command requires two arguments (attribute and value)");
127 return;
128 }
129
130 if (!strcmp(what, "rate")) {
131 char *end;
132 double drest = strtod(rest, &end);
133
134 if (users >= 0) {
135 WARNING("Rates can not be set in a user-based benchmark.");
136 } else if (*end) {
137 WARNING("Invalid rate value: \"%s\"", rest);
138 } else {
139 CallGenerationTask::set_rate(drest);
140 }
141 } else if (!strcmp(what, "rate-scale")) {
142 char *end;
143 double drest = strtod(rest, &end);
144 if (*end) {
145 WARNING("Invalid rate-scale value: \"%s\"", rest);
146 } else {
147 rate_scale = drest;
148 }
149 } else if (!strcmp(what, "users")) {
150 char *end;
151 int urest = strtol(rest, &end, 0);
152
153 if (users < 0) {
154 WARNING("Users can not be changed at run time for a rate-based benchmark.");
155 } else if (*end) {
156 WARNING("Invalid users value: \"%s\"", rest);
157 } else if (urest < 0) {
158 WARNING("Invalid users value: \"%s\"", rest);
159 } else {
160 CallGenerationTask::set_users(urest);
161 }
162 } else if (!strcmp(what, "limit")) {
163 char *end;
164 unsigned long lrest = strtoul(rest, &end, 0);
165 if (users >= 0) {
166 WARNING("Can not set call limit for a user-based benchmark.");
167 } else if (*end) {
168 WARNING("Invalid limit value: \"%s\"", rest);
169 } else {
170 open_calls_allowed = lrest;
171 open_calls_user_setting = 1;
172 }
173 } else if (!strcmp(what, "display")) {
174 if (!strcmp(rest, "main")) {
175 display_scenario = main_scenario;
176 } else if (!strcmp(rest, "ooc") && ooc_scenario) {

Callers 1

process_commandFunction · 0.85

Calls 2

WARNINGFunction · 0.85
trimFunction · 0.70

Tested by

no test coverage detected