1
0

thesis: Add performance for manipulating

This commit is contained in:
2025-09-02 14:17:11 +02:00
parent 3e55faa4bd
commit 5fa52a198b
8 changed files with 325 additions and 59 deletions

View File

@@ -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);

View File

@@ -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' &