Skip to content

Commit 026a6c2

Browse files
committed
update web_server2.c to align with web_server.c
1 parent f1051b3 commit 026a6c2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

chap07/web_server2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void drop_client(struct client_info **client_list,
138138
free(client);
139139
return;
140140
}
141-
p = &client->next;
141+
p = &(*p)->next;
142142
}
143143

144144
fprintf(stderr, "drop_client not found.\n");
@@ -311,7 +311,7 @@ int main() {
311311

312312
struct client_info *client = client_list;
313313
while(client) {
314-
struct client_info *next = client;
314+
struct client_info *next = client->next;
315315

316316
if (FD_ISSET(client->socket, &reads)) {
317317

@@ -349,7 +349,7 @@ int main() {
349349
serve_resource(&client_list, client, path);
350350
}
351351
}
352-
}
352+
} //if (q)
353353
}
354354
}
355355

0 commit comments

Comments
 (0)