Mercurial > hg > quicktun
comparison src/common.c @ 3:27632fe319bd
Fix segfault?
author | ivo <ivo@UFO-Net.nl> |
---|---|
date | Thu, 07 Oct 2010 16:04:53 +0200 |
parents | b2c7c83a1dda |
children | a989ecbd5f53 |
comparison
equal
deleted
inserted
replaced
2:b2c7c83a1dda | 3:27632fe319bd |
---|---|
217 getsockopt(sfd, SOL_SOCKET, SO_ERROR, &out, &len); | 217 getsockopt(sfd, SOL_SOCKET, SO_ERROR, &out, &len); |
218 fprintf(stderr, "End of file on udp socket"); | 218 fprintf(stderr, "End of file on udp socket"); |
219 } else { | 219 } else { |
220 len = p->decode(&session, buffer_enc, buffer_raw, len); | 220 len = p->decode(&session, buffer_enc, buffer_raw, len); |
221 if (len != 0 && session.remote_float != 0 && (session.remote_addr.sin_addr.s_addr != recvaddr.sin_addr.s_addr || session.remote_addr.sin_port != recvaddr.sin_port)) { | 221 if (len != 0 && session.remote_float != 0 && (session.remote_addr.sin_addr.s_addr != recvaddr.sin_addr.s_addr || session.remote_addr.sin_port != recvaddr.sin_port)) { |
222 fprintf(stderr, "Remote endpoint has changed to %s:%d", inet_ntoa(recvaddr.sin_addr), ntohs(recvaddr.sin_port)); | 222 //fprintf(stderr, "Remote endpoint has changed to %s:%d", inet_ntoa(recvaddr.sin_addr), ntohs(recvaddr.sin_port)); |
223 fprintf(stderr, "Remote endpoint has changed to %s:%d", 0, 0); | |
223 session.remote_addr = recvaddr; | 224 session.remote_addr = recvaddr; |
224 session.remote_float = 2; | 225 session.remote_float = 2; |
225 } | 226 } |
226 if (len < 0) return len; | 227 if (len < 0) return len; |
227 write(ttfd, buffer_raw + p->offset_raw, len); | 228 write(ttfd, buffer_raw + p->offset_raw, len); |