BUGFIX : Possible linked list bug
This commit is contained in:
parent
30ae45ec2b
commit
d200099244
5 changed files with 10 additions and 9 deletions
7
net_io.c
7
net_io.c
|
|
@ -178,7 +178,9 @@ void modesSendAllClients(int service, void *msg, int len) {
|
|||
struct client *c = Modes.clients;
|
||||
|
||||
while (c) {
|
||||
// Read next before servicing client incase the service routine deletes the client!
|
||||
struct client *next = c->next;
|
||||
|
||||
if (c->service == service) {
|
||||
#ifndef _WIN32
|
||||
int nwritten = write(c->fd, msg, len);
|
||||
|
|
@ -921,6 +923,9 @@ void modesReadFromClients(void) {
|
|||
struct client *c = modesAcceptClients();
|
||||
|
||||
while (c) {
|
||||
// Read next before servicing client incase the service routine deletes the client!
|
||||
struct client *next = c->next;
|
||||
|
||||
if (c->service == Modes.ris) {
|
||||
modesReadFromClient(c,"\n",decodeHexMessage);
|
||||
} else if (c->service == Modes.bis) {
|
||||
|
|
@ -928,7 +933,7 @@ void modesReadFromClients(void) {
|
|||
} else if (c->service == Modes.https) {
|
||||
modesReadFromClient(c,"\r\n\r\n",handleHTTPRequest);
|
||||
}
|
||||
c = c->next;
|
||||
c = next;
|
||||
}
|
||||
}
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue