thesis: Add performance for manipulating
This commit is contained in:
@@ -48,16 +48,17 @@ int main(const int argc, const char *argv[]) {
|
||||
FILE *client;
|
||||
if ((client = fdopen(client_fd, "w+")) == NULL) {
|
||||
fprintf(stderr, "unable open stream: %s\n", strerror(errno));
|
||||
break;
|
||||
close(client_fd);
|
||||
continue;
|
||||
}
|
||||
|
||||
int n = 0;
|
||||
while (getline(&line, &len, client) > 0) {
|
||||
for (int n = 0; getline(&line, &len, client) > 0; n++) {
|
||||
if (n % 2 == 1) {
|
||||
fprintf(client, "%s\n", mode);
|
||||
}
|
||||
n++;
|
||||
}
|
||||
|
||||
fclose(client);
|
||||
}
|
||||
|
||||
free(line);
|
||||
|
||||
@@ -14,7 +14,7 @@ function test() {
|
||||
done
|
||||
}
|
||||
|
||||
rm /tmp/test.ok.sock /tmp/test.return.sock /tmp/intercept.performance.ok.sock /tmp/intercept.performance.return.sock
|
||||
rm -f /tmp/test.ok.sock /tmp/test.return.sock /tmp/intercept.performance.ok.sock /tmp/intercept.performance.return.sock
|
||||
./server /tmp/test.ok.sock 'ok' &
|
||||
./server /tmp/test.return.sock 'return 0' &
|
||||
|
||||
|
||||
Reference in New Issue
Block a user