Changeset 13625 for trunk/libtransmission/tr-lpd.c
- Timestamp:
- Dec 5, 2012, 5:29:46 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/tr-lpd.c
r12229 r13625 24 24 #include <errno.h> 25 25 #include <stdio.h> 26 #include <string.h> /* strlen (), strncpy(), strstr(), memset() */26 #include <string.h> /* strlen (), strncpy (), strstr (), memset () */ 27 27 28 28 /* posix */ 29 29 #include <signal.h> /* sig_atomic_t */ 30 30 #include <sys/time.h> 31 #include <unistd.h> /* close () */32 #include <ctype.h> /* toupper () */31 #include <unistd.h> /* close () */ 32 #include <ctype.h> /* toupper () */ 33 33 #ifdef WIN32 34 34 #include <w32api.h> 35 #define WINDOWS WindowsXP /* freeaddrinfo (),getaddrinfo(),getnameinfo() */35 #define WINDOWS WindowsXP /* freeaddrinfo (),getaddrinfo (),getnameinfo () */ 36 36 #include <inttypes.h> 37 37 #include <ws2tcpip.h> … … 39 39 #else 40 40 #include <sys/types.h> 41 #include <sys/socket.h> /* socket (), bind() */41 #include <sys/socket.h> /* socket (), bind () */ 42 42 #include <netinet/in.h> /* sockaddr_in */ 43 43 #endif … … 50 50 #include "transmission.h" 51 51 #include "net.h" 52 #include "peer-mgr.h" /* tr_peerMgrAddPex () */52 #include "peer-mgr.h" /* tr_peerMgrAddPex () */ 53 53 #include "session.h" 54 #include "torrent.h" /* tr_torrentFindFromHash () */54 #include "torrent.h" /* tr_torrentFindFromHash () */ 55 55 #include "tr-lpd.h" 56 56 #include "utils.h" … … 67 67 */ 68 68 69 static void event_callback ( int, short, void*);69 static void event_callback (int, short, void*); 70 70 71 71 enum { … … 160 160 * the lpd_protocolVersion structure. 161 161 */ 162 static const char* lpd_extractHeader ( const char* s, struct lpd_protocolVersion* const ver)162 static const char* lpd_extractHeader (const char* s, struct lpd_protocolVersion* const ver) 163 163 { 164 164 int major = -1, minor = -1; 165 165 size_t len; 166 166 167 assert ( s != NULL);168 len = strlen ( s);167 assert (s != NULL); 168 len = strlen (s); 169 169 170 170 /* something might be rotten with this chunk of data */ 171 if ( len == 0 || len > lpd_maxDatagramLength)171 if (len == 0 || len > lpd_maxDatagramLength) 172 172 return NULL; 173 173 174 174 /* now we can attempt to look up the BT-SEARCH header */ 175 if ( sscanf( s, "BT-SEARCH * HTTP/%d.%d" CRLF, &major, &minor ) != 2)175 if (sscanf (s, "BT-SEARCH * HTTP/%d.%d" CRLF, &major, &minor) != 2) 176 176 return NULL; 177 177 178 if ( major < 0 || minor < 0)178 if (major < 0 || minor < 0) 179 179 return NULL; 180 180 … … 182 182 /* a pair of blank lines at the end of the string, no place else */ 183 183 const char* const two_blank = CRLF CRLF CRLF; 184 const char* const end = strstr ( s, two_blank);185 186 if ( end == NULL || strlen( end ) > strlen( two_blank ))184 const char* const end = strstr (s, two_blank); 185 186 if (end == NULL || strlen (end) > strlen (two_blank)) 187 187 return NULL; 188 188 } 189 189 190 if ( ver != NULL)190 if (ver != NULL) 191 191 { 192 192 ver->major = major; … … 195 195 196 196 /* separate the header, begins with CRLF */ 197 return strstr ( s, CRLF);197 return strstr (s, CRLF); 198 198 } 199 199 … … 212 212 * - copy back value from end to next "\r\n" 213 213 */ 214 static int lpd_extractParam ( const char* const str, const char* const name, int n, char* const val)214 static int lpd_extractParam (const char* const str, const char* const name, int n, char* const val) 215 215 { 216 216 /* configure maximum length of search string here */ … … 219 219 const char* pos; 220 220 221 assert ( str != NULL && name != NULL);222 assert ( val != NULL);223 224 if ( strlen( name ) > maxLength - strlen( CRLF ": " ))221 assert (str != NULL && name != NULL); 222 assert (val != NULL); 223 224 if (strlen (name) > maxLength - strlen (CRLF ": ")) 225 225 return 0; 226 226 227 227 /* compose the string token to search for */ 228 snprintf ( sstr, maxLength, CRLF "%s: ", name);229 230 pos = strstr ( str, sstr);231 if ( pos == NULL)228 snprintf (sstr, maxLength, CRLF "%s: ", name); 229 230 pos = strstr (str, sstr); 231 if (pos == NULL) 232 232 return 0; /* search was not successful */ 233 233 234 234 { 235 const char* const beg = pos + strlen ( sstr);236 const char* const new_line = strstr ( beg, CRLF);235 const char* const beg = pos + strlen (sstr); 236 const char* const new_line = strstr (beg, CRLF); 237 237 238 238 /* the value is delimited by the next CRLF */ … … 241 241 /* if value string hits the length limit n, 242 242 * leave space for a trailing '\0' character */ 243 if ( len < n--)243 if (len < n--) 244 244 n = len; 245 245 246 strncpy ( val, beg, n);246 strncpy (val, beg, n); 247 247 val[n] = 0; 248 248 } … … 255 255 * @} */ 256 256 257 static void on_upkeep_timer ( int, short, void *);257 static void on_upkeep_timer (int, short, void *); 258 258 259 259 /** … … 266 266 * IPv4 only for the time being. 267 267 */ 268 int tr_lpdInit ( tr_session* ss, tr_address* tr_addr UNUSED)268 int tr_lpdInit (tr_session* ss, tr_address* tr_addr UNUSED) 269 269 { 270 270 struct ip_mreq mcastReq; 271 271 const int opt_on = 1, opt_off = 0; 272 272 273 if ( session) /* already initialized */273 if (session) /* already initialized */ 274 274 return -1; 275 275 276 assert ( lpd_announceInterval > 0);277 assert ( lpd_announceScope > 0);278 279 lpd_port = tr_sessionGetPeerPort ( ss);280 if ( lpd_port <= 0)276 assert (lpd_announceInterval > 0); 277 assert (lpd_announceScope > 0); 278 279 lpd_port = tr_sessionGetPeerPort (ss); 280 if (lpd_port <= 0) 281 281 return -1; 282 282 283 tr_ndbg ( "LPD", "Initialising Local Peer Discovery");283 tr_ndbg ("LPD", "Initialising Local Peer Discovery"); 284 284 285 285 /* setup datagram socket (receive) */ 286 286 { 287 lpd_socket = socket ( PF_INET, SOCK_DGRAM, 0);288 if ( lpd_socket < 0)289 goto fail; 290 291 if ( evutil_make_socket_nonblocking( lpd_socket ) < 0)292 goto fail; 293 294 if ( setsockopt(lpd_socket, SOL_SOCKET, SO_REUSEADDR,295 &opt_on, sizeof opt_on ) < 0)296 goto fail; 297 298 memset ( &lpd_mcastAddr, 0, sizeof lpd_mcastAddr);287 lpd_socket = socket (PF_INET, SOCK_DGRAM, 0); 288 if (lpd_socket < 0) 289 goto fail; 290 291 if (evutil_make_socket_nonblocking (lpd_socket) < 0) 292 goto fail; 293 294 if (setsockopt (lpd_socket, SOL_SOCKET, SO_REUSEADDR, 295 &opt_on, sizeof opt_on) < 0) 296 goto fail; 297 298 memset (&lpd_mcastAddr, 0, sizeof lpd_mcastAddr); 299 299 lpd_mcastAddr.sin_family = AF_INET; 300 lpd_mcastAddr.sin_port = htons ( lpd_mcastPort);301 if ( evutil_inet_pton(lpd_mcastAddr.sin_family, lpd_mcastGroup,302 &lpd_mcastAddr.sin_addr ) < 0)303 goto fail; 304 305 if ( bind(lpd_socket, (struct sockaddr*) &lpd_mcastAddr,306 sizeof lpd_mcastAddr ) < 0)300 lpd_mcastAddr.sin_port = htons (lpd_mcastPort); 301 if (evutil_inet_pton (lpd_mcastAddr.sin_family, lpd_mcastGroup, 302 &lpd_mcastAddr.sin_addr) < 0) 303 goto fail; 304 305 if (bind (lpd_socket, (struct sockaddr*) &lpd_mcastAddr, 306 sizeof lpd_mcastAddr) < 0) 307 307 goto fail; 308 308 309 309 /* we want to join that LPD multicast group */ 310 memset ( &mcastReq, 0, sizeof mcastReq);310 memset (&mcastReq, 0, sizeof mcastReq); 311 311 mcastReq.imr_multiaddr = lpd_mcastAddr.sin_addr; 312 mcastReq.imr_interface.s_addr = htonl ( INADDR_ANY);313 if ( setsockopt(lpd_socket, IPPROTO_IP, IP_ADD_MEMBERSHIP,314 &mcastReq, sizeof mcastReq ) < 0)315 goto fail; 316 317 if ( setsockopt(lpd_socket, IPPROTO_IP, IP_MULTICAST_LOOP,318 &opt_off, sizeof opt_off ) < 0)312 mcastReq.imr_interface.s_addr = htonl (INADDR_ANY); 313 if (setsockopt (lpd_socket, IPPROTO_IP, IP_ADD_MEMBERSHIP, 314 &mcastReq, sizeof mcastReq) < 0) 315 goto fail; 316 317 if (setsockopt (lpd_socket, IPPROTO_IP, IP_MULTICAST_LOOP, 318 &opt_off, sizeof opt_off) < 0) 319 319 goto fail; 320 320 } … … 324 324 const unsigned char scope = lpd_announceScope; 325 325 326 lpd_socket2 = socket ( PF_INET, SOCK_DGRAM, 0);327 if ( lpd_socket2 < 0)328 goto fail; 329 330 if ( evutil_make_socket_nonblocking( lpd_socket2 ) < 0)326 lpd_socket2 = socket (PF_INET, SOCK_DGRAM, 0); 327 if (lpd_socket2 < 0) 328 goto fail; 329 330 if (evutil_make_socket_nonblocking (lpd_socket2) < 0) 331 331 goto fail; 332 332 333 333 /* configure outbound multicast TTL */ 334 if ( setsockopt(lpd_socket2, IPPROTO_IP, IP_MULTICAST_TTL,335 &scope, sizeof scope ) < 0)336 goto fail; 337 338 if ( setsockopt(lpd_socket2, IPPROTO_IP, IP_MULTICAST_LOOP,339 &opt_off, sizeof opt_off ) < 0)334 if (setsockopt (lpd_socket2, IPPROTO_IP, IP_MULTICAST_TTL, 335 &scope, sizeof scope) < 0) 336 goto fail; 337 338 if (setsockopt (lpd_socket2, IPPROTO_IP, IP_MULTICAST_LOOP, 339 &opt_off, sizeof opt_off) < 0) 340 340 goto fail; 341 341 } … … 346 346 * any announcement received during the initial interval will be discarded. */ 347 347 348 lpd_event = event_new ( ss->event_base, lpd_socket, EV_READ | EV_PERSIST, event_callback, NULL);349 event_add ( lpd_event, NULL);350 351 upkeep_timer = evtimer_new ( ss->event_base, on_upkeep_timer, ss);352 tr_timerAdd ( upkeep_timer, UPKEEP_INTERVAL_SECS, 0);353 354 tr_ndbg ( "LPD", "Local Peer Discovery initialised");348 lpd_event = event_new (ss->event_base, lpd_socket, EV_READ | EV_PERSIST, event_callback, NULL); 349 event_add (lpd_event, NULL); 350 351 upkeep_timer = evtimer_new (ss->event_base, on_upkeep_timer, ss); 352 tr_timerAdd (upkeep_timer, UPKEEP_INTERVAL_SECS, 0); 353 354 tr_ndbg ("LPD", "Local Peer Discovery initialised"); 355 355 356 356 return 1; … … 359 359 { 360 360 const int save = errno; 361 close ( lpd_socket);362 close ( lpd_socket2);361 close (lpd_socket); 362 close (lpd_socket2); 363 363 lpd_socket = lpd_socket2 = -1; 364 364 session = NULL; 365 tr_ndbg ( "LPD", "LPD initialisation failed (errno = %d)", save);365 tr_ndbg ("LPD", "LPD initialisation failed (errno = %d)", save); 366 366 errno = save; 367 367 } … … 371 371 } 372 372 373 void tr_lpdUninit ( tr_session* ss)374 { 375 if ( session != ss)373 void tr_lpdUninit (tr_session* ss) 374 { 375 if (session != ss) 376 376 return; 377 377 378 tr_ndbg ( "LPD", "Uninitialising Local Peer Discovery");379 380 event_free ( lpd_event);378 tr_ndbg ("LPD", "Uninitialising Local Peer Discovery"); 379 380 event_free (lpd_event); 381 381 lpd_event = NULL; 382 382 383 evtimer_del ( upkeep_timer);383 evtimer_del (upkeep_timer); 384 384 upkeep_timer = NULL; 385 385 386 386 /* just shut down, we won't remember any former nodes */ 387 evutil_closesocket ( lpd_socket);388 evutil_closesocket ( lpd_socket2);389 tr_ndbg ( "LPD", "Done uninitialising Local Peer Discovery");387 evutil_closesocket (lpd_socket); 388 evutil_closesocket (lpd_socket2); 389 tr_ndbg ("LPD", "Done uninitialising Local Peer Discovery"); 390 390 391 391 session = NULL; … … 393 393 394 394 bool 395 tr_lpdEnabled ( const tr_session* ss)396 { 397 return ss && ( ss == session);395 tr_lpdEnabled (const tr_session* ss) 396 { 397 return ss && (ss == session); 398 398 } 399 399 … … 405 405 * functions. In any other respect, lpd_consistencyCheck is an orphaned function. 406 406 */ 407 static inline void lpd_consistencyCheck ( void)407 static inline void lpd_consistencyCheck (void) 408 408 { 409 409 /* if the following check fails, the definition of a hash string has changed … … 411 411 * and tr_lpdConsiderAnnounce. However, the code is designed to function as long 412 412 * as interfaces to the rest of the lib remain compatible with char* strings. */ 413 STATIC_ASSERT ( sizeof(lpd_torStaticType->info.hashString[0]) == sizeof(char));413 STATIC_ASSERT (sizeof (lpd_torStaticType->info.hashString[0]) == sizeof (char)); 414 414 } 415 415 /** … … 433 433 */ 434 434 bool 435 tr_lpdSendAnnounce ( const tr_torrent* t)435 tr_lpdSendAnnounce (const tr_torrent* t) 436 436 { 437 437 size_t i; … … 444 444 CRLF; 445 445 446 char hashString[lengthof ( t->info.hashString)];446 char hashString[lengthof (t->info.hashString)]; 447 447 char query[lpd_maxDatagramLength + 1] = { }; 448 448 449 if ( t == NULL)449 if (t == NULL) 450 450 return false; 451 451 452 452 /* make sure the hash string is normalized, just in case */ 453 for ( i = 0; i < sizeof hashString; i++)454 hashString[i] = toupper ( t->info.hashString[i]);453 for (i = 0; i < sizeof hashString; i++) 454 hashString[i] = toupper (t->info.hashString[i]); 455 455 456 456 /* prepare a zero-terminated announce message */ 457 snprintf (query, lpd_maxDatagramLength + 1, fmt, 1, 1,458 lpd_mcastGroup, lpd_mcastPort, lpd_port, hashString 457 snprintf (query, lpd_maxDatagramLength + 1, fmt, 1, 1, 458 lpd_mcastGroup, lpd_mcastPort, lpd_port, hashString); 459 459 460 460 /* actually send the query out using [lpd_socket2] */ 461 461 { 462 const int len = strlen ( query);463 464 /* destination address info has already been set up in tr_lpdInit (),462 const int len = strlen (query); 463 464 /* destination address info has already been set up in tr_lpdInit (), 465 465 * so we refrain from preparing another sockaddr_in here */ 466 int res = sendto (lpd_socket2, query, len, 0,467 (const struct sockaddr*) &lpd_mcastAddr, sizeof lpd_mcastAddr);468 469 if ( res != len)466 int res = sendto (lpd_socket2, query, len, 0, 467 (const struct sockaddr*) &lpd_mcastAddr, sizeof lpd_mcastAddr); 468 469 if (res != len) 470 470 return false; 471 471 } 472 472 473 tr_tordbg ( t, "LPD announce message away");473 tr_tordbg (t, "LPD announce message away"); 474 474 475 475 return true; … … 490 490 * return != 0, the caller may retrieve the value from the passed structure. 491 491 */ 492 static int tr_lpdConsiderAnnounce ( tr_pex* peer, const char* const msg)492 static int tr_lpdConsiderAnnounce (tr_pex* peer, const char* const msg) 493 493 { 494 494 enum 495 495 { 496 496 maxValueLen = 25, 497 maxHashLen = lengthof (lpd_torStaticType->info.hashString)497 maxHashLen = lengthof (lpd_torStaticType->info.hashString) 498 498 }; 499 499 … … 503 503 int res = 0, peerPort = 0; 504 504 505 if ( peer != NULL && msg != NULL)505 if (peer != NULL && msg != NULL) 506 506 { 507 507 tr_torrent* tor = NULL; 508 508 509 const char* params = lpd_extractHeader ( msg, &ver);510 if ( params == NULL || ver.major != 1) /* allow messages of protocol v1 */509 const char* params = lpd_extractHeader (msg, &ver); 510 if (params == NULL || ver.major != 1) /* allow messages of protocol v1 */ 511 511 return 0; 512 512 513 513 /* save the effort to check Host, which seems to be optional anyway */ 514 514 515 if ( lpd_extractParam( params, "Port", maxValueLen, value ) == 0)515 if (lpd_extractParam (params, "Port", maxValueLen, value) == 0) 516 516 return 0; 517 517 518 518 /* determine announced peer port, refuse if value too large */ 519 if ( sscanf( value, "%d", &peerPort ) != 1 || peerPort > (in_port_t)-1)519 if (sscanf (value, "%d", &peerPort) != 1 || peerPort > (in_port_t)-1) 520 520 return 0; 521 521 522 peer->port = htons ( peerPort);522 peer->port = htons (peerPort); 523 523 res = -1; /* signal caller side-effect to peer->port via return != 0 */ 524 524 525 if ( lpd_extractParam( params, "Infohash", maxHashLen, hashString ) == 0)525 if (lpd_extractParam (params, "Infohash", maxHashLen, hashString) == 0) 526 526 return res; 527 527 528 tor = tr_torrentFindFromHashString ( session, hashString);529 530 if ( tr_isTorrent( tor ) && tr_torrentAllowsLPD( tor ))528 tor = tr_torrentFindFromHashString (session, hashString); 529 530 if (tr_isTorrent (tor) && tr_torrentAllowsLPD (tor)) 531 531 { 532 532 /* we found a suitable peer, add it to the torrent */ 533 tr_peerMgrAddPex ( tor, TR_PEER_FROM_LPD, peer, -1);534 tr_tordbg (tor, "Learned %d local peer from LPD (%s:%u)",535 1, tr_address_to_string ( &peer->addr ), peerPort);536 537 /* periodic reconnectPulse () deals with the rest... */533 tr_peerMgrAddPex (tor, TR_PEER_FROM_LPD, peer, -1); 534 tr_tordbg (tor, "Learned %d local peer from LPD (%s:%u)", 535 1, tr_address_to_string (&peer->addr), peerPort); 536 537 /* periodic reconnectPulse () deals with the rest... */ 538 538 539 539 return 1; 540 540 } 541 541 else 542 tr_ndbg ( "LPD", "Cannot serve torrent #%s", hashString);542 tr_ndbg ("LPD", "Cannot serve torrent #%s", hashString); 543 543 } 544 544 … … 560 560 */ 561 561 static int 562 tr_lpdAnnounceMore ( const time_t now, const int interval)562 tr_lpdAnnounceMore (const time_t now, const int interval) 563 563 { 564 564 tr_torrent* tor = NULL; 565 565 int announcesSent = 0; 566 566 567 if ( !tr_isSession( session ))567 if (!tr_isSession (session)) 568 568 return -1; 569 569 570 while (( tor = tr_torrentNext( session, tor ))571 && tr_sessionAllowsLPD ( session ))572 { 573 if ( tr_isTorrent( tor ))570 while ((tor = tr_torrentNext (session, tor)) 571 && tr_sessionAllowsLPD (session)) 572 { 573 if (tr_isTorrent (tor)) 574 574 { 575 575 int announcePrio = 0; 576 576 577 if ( !tr_torrentAllowsLPD( tor ))577 if (!tr_torrentAllowsLPD (tor)) 578 578 continue; 579 579 580 580 /* issue #3208: prioritize downloads before seeds */ 581 switch ( tr_torrentGetActivity( tor ))581 switch (tr_torrentGetActivity (tor)) 582 582 { 583 583 case TR_STATUS_DOWNLOAD: … … 591 591 } 592 592 593 if ( announcePrio > 0 && tor->lpdAnnounceAt <= now)593 if (announcePrio > 0 && tor->lpdAnnounceAt <= now) 594 594 { 595 if ( tr_lpdSendAnnounce( tor ))595 if (tr_lpdSendAnnounce (tor)) 596 596 announcesSent++; 597 597 … … 608 608 const int maxAnnounceCap = interval * lpd_announceCapFactor; 609 609 610 if ( lpd_unsolicitedMsgCounter < 0)611 tr_ninf ("LPD", "Dropped %d announces in the last interval (max. %d "612 "allowed)", -lpd_unsolicitedMsgCounter, maxAnnounceCap 610 if (lpd_unsolicitedMsgCounter < 0) 611 tr_ninf ("LPD", "Dropped %d announces in the last interval (max. %d " 612 "allowed)", -lpd_unsolicitedMsgCounter, maxAnnounceCap); 613 613 614 614 lpd_unsolicitedMsgCounter = maxAnnounceCap; … … 619 619 620 620 static void 621 on_upkeep_timer ( int foo UNUSED, short bar UNUSED, void * vsession UNUSED)622 { 623 const time_t now = tr_time ();624 tr_lpdAnnounceMore ( now, UPKEEP_INTERVAL_SECS);625 tr_timerAdd ( upkeep_timer, UPKEEP_INTERVAL_SECS, 0);621 on_upkeep_timer (int foo UNUSED, short bar UNUSED, void * vsession UNUSED) 622 { 623 const time_t now = tr_time (); 624 tr_lpdAnnounceMore (now, UPKEEP_INTERVAL_SECS); 625 tr_timerAdd (upkeep_timer, UPKEEP_INTERVAL_SECS, 0); 626 626 } 627 627 … … 630 630 * @note maximum rate of read events is limited according to @a lpd_maxAnnounceCap 631 631 * @see DoS */ 632 static void event_callback ( int s UNUSED, short type, void* ignore UNUSED)633 { 634 assert ( tr_isSession( session ));632 static void event_callback (int s UNUSED, short type, void* ignore UNUSED) 633 { 634 assert (tr_isSession (session)); 635 635 636 636 /* do not allow announces to be processed if LPD is disabled */ 637 if ( !tr_sessionAllowsLPD( session ))637 if (!tr_sessionAllowsLPD (session)) 638 638 return; 639 639 640 if ( ( type & EV_READ ) != 0)640 if ((type & EV_READ) != 0) 641 641 { 642 642 struct sockaddr_in foreignAddr; … … 647 647 648 648 /* process local announcement from foreign peer */ 649 int res = recvfrom (lpd_socket, foreignMsg, lpd_maxDatagramLength,650 0, (struct sockaddr*) &foreignAddr, (socklen_t*) &addrLen 649 int res = recvfrom (lpd_socket, foreignMsg, lpd_maxDatagramLength, 650 0, (struct sockaddr*) &foreignAddr, (socklen_t*) &addrLen); 651 651 652 652 /* besides, do we get flooded? then bail out! */ 653 if ( --lpd_unsolicitedMsgCounter < 0)653 if (--lpd_unsolicitedMsgCounter < 0) 654 654 return; 655 655 656 if ( res > 0 && res <= lpd_maxDatagramLength)656 if (res > 0 && res <= lpd_maxDatagramLength) 657 657 { 658 658 struct tr_pex foreignPeer = … … 663 663 664 664 foreignPeer.addr.addr.addr4 = foreignAddr.sin_addr; 665 if ( tr_lpdConsiderAnnounce( &foreignPeer, foreignMsg ) != 0)665 if (tr_lpdConsiderAnnounce (&foreignPeer, foreignMsg) != 0) 666 666 return; /* OK so far, no log message */ 667 667 } 668 668 669 tr_ndbg ( "LPD", "Discarded invalid multicast message");670 } 671 } 672 669 tr_ndbg ("LPD", "Discarded invalid multicast message"); 670 } 671 } 672
Note: See TracChangeset
for help on using the changeset viewer.