projects
/
NeonServV5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
89196fe
)
fixed small crash bug in ClientSocket.c:socket_loop
author
pk910
<philipp@zoelle1.de>
Fri, 23 Dec 2011 01:06:20 +0000
(
02:06
+0100)
committer
pk910
<philipp@zoelle1.de>
Fri, 23 Dec 2011 01:06:20 +0000
(
02:06
+0100)
src/ClientSocket.c
patch
|
blob
|
history
diff --git
a/src/ClientSocket.c
b/src/ClientSocket.c
index 16ad26d4b9a0d7979f3678826bfc239fe84684dd..6b8b4fb815d5f4728414e9cf30f14998ad1c73d5 100644
(file)
--- a/
src/ClientSocket.c
+++ b/
src/ClientSocket.c
@@
-353,7
+353,7
@@
void socket_loop(int timeout_seconds) {
if(sockets == NULL) return;
fd_set fds;
struct timeval timeout;
if(sockets == NULL) return;
fd_set fds;
struct timeval timeout;
- struct ClientSocket *sock;
+ struct ClientSocket *sock
, *next
;
int ret = 0, bytes, i;
FD_ZERO(&fds);
int ret = 0, bytes, i;
FD_ZERO(&fds);
@@
-367,7
+367,8
@@
void socket_loop(int timeout_seconds) {
timeout.tv_usec = 0;
ret = select(ret + 1, &fds, NULL, NULL, &timeout);
if(ret == 0) return;
timeout.tv_usec = 0;
ret = select(ret + 1, &fds, NULL, NULL, &timeout);
if(ret == 0) return;
- for (sock = sockets->data; sock; sock = sock->next) {
+ for (sock = sockets->data; sock; sock = next) {
+ next = sock->next;
if((sock->flags & SOCKET_FLAG_CONNECTED) && FD_ISSET(sock->sock, &fds)) {
if(sock->bufferpos != 0) {
if(!(sock->flags & SOCKET_FLAG_HAVE_SSL) || (bytes = ssl_read(sock, buffer, sizeof(buffer))) == -2) {
if((sock->flags & SOCKET_FLAG_CONNECTED) && FD_ISSET(sock->sock, &fds)) {
if(sock->bufferpos != 0) {
if(!(sock->flags & SOCKET_FLAG_HAVE_SSL) || (bytes = ssl_read(sock, buffer, sizeof(buffer))) == -2) {