Mercurial > hg > quicktun
comparison src/common.c @ 59:2f4d333f7500
Fix SO_ERROR ouput type
According to POSIX, SO_ERROR expects an int, not a "long long", so use
that instead.
author | Andreas Rottmann <a.rottmann@gmx.at> |
---|---|
date | Sun, 26 Jun 2016 04:10:01 +0200 |
parents | 4c083d81f5a8 |
children | 66d9d80215f0 |
comparison
equal
deleted
inserted
replaced
58:732d45ab94ab | 59:2f4d333f7500 |
---|---|
371 len = read(sfd, buffer_enc + p->offset_enc, p->buffersize_enc); | 371 len = read(sfd, buffer_enc + p->offset_enc, p->buffersize_enc); |
372 } else { | 372 } else { |
373 len = recvfrom(sfd, buffer_enc + p->offset_enc, p->buffersize_enc, 0, (struct sockaddr*)&recvaddr, &recvaddr_len); | 373 len = recvfrom(sfd, buffer_enc + p->offset_enc, p->buffersize_enc, 0, (struct sockaddr*)&recvaddr, &recvaddr_len); |
374 } | 374 } |
375 if (len < 0) { | 375 if (len < 0) { |
376 long long out; | 376 int out; |
377 socklen_t slen = sizeof(out); | 377 socklen_t slen = sizeof(out); |
378 getsockopt(sfd, SOL_SOCKET, SO_ERROR, &out, &slen); | 378 getsockopt(sfd, SOL_SOCKET, SO_ERROR, &out, &slen); |
379 fprintf(stderr, "Received end of file on udp socket (error %lld)\n", out); | 379 fprintf(stderr, "Received end of file on udp socket (error %d)\n", out); |
380 } else { | 380 } else { |
381 len = p->decode(&session, buffer_enc, buffer_raw + pi_length, len); | 381 len = p->decode(&session, buffer_enc, buffer_raw + pi_length, len); |
382 if (len < 0) continue; | 382 if (len < 0) continue; |
383 if (session.remote_float != 0 && !sockaddr_equal(&session.remote_addr, &recvaddr)) { | 383 if (session.remote_float != 0 && !sockaddr_equal(&session.remote_addr, &recvaddr)) { |
384 char epname[INET6_ADDRSTRLEN + 1 + 2 + 1 + 5]; //addr%scope:port | 384 char epname[INET6_ADDRSTRLEN + 1 + 2 + 1 + 5]; //addr%scope:port |