Changeset 1027
- Timestamp:
- 01/12/08 13:39:19 (4 years ago)
- Location:
- trunk
- Files:
-
- 3 modified
-
libtorrent/scripts/checks.m4 (modified) (1 diff)
-
libtorrent/src/protocol/handshake.cc (modified) (5 diffs)
-
rtorrent/scripts/checks.m4 (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtorrent/scripts/checks.m4
r1013 r1027 370 370 371 371 else 372 if eval xmlrpc-c-config --version 2>/dev/null >/dev/null; then 373 CXXFLAGS="$CXXFLAGS `xmlrpc-c-config --cflags server-util`" 374 LIBS="$LIBS `xmlrpc-c-config server-util --libs`" 372 if test "$withval" = "yes"; then 373 xmlrpc_cc_prg="xmlrpc-c-config" 374 else 375 xmlrpc_cc_prg="$withval" 376 fi 377 378 if eval $xmlrpc_cc_prg --version 2>/dev/null >/dev/null; then 379 CXXFLAGS="$CXXFLAGS `$xmlrpc_cc_prg --cflags server-util`" 380 LIBS="$LIBS `$xmlrpc_cc_prg server-util --libs`" 375 381 376 382 AC_TRY_LINK( -
trunk/libtorrent/src/protocol/handshake.cc
r1013 r1027 526 526 527 527 // The download is just starting so we're not sending any 528 // bitfield. 528 // bitfield. Pretend we wrote it already. 529 529 if (m_download->file_list()->bitfield()->is_all_unset()) 530 prepare_post_handshake(true);530 m_writePos = m_download->file_list()->bitfield()->size_bytes(); 531 531 else 532 532 prepare_bitfield(); … … 618 618 } 619 619 620 // Should've started to write post handshake data already, but we were 621 // still reading the bitfield/extension and postponed it. If we had no 622 // bitfield to send, we need to send a keep-alive now. 623 if (m_writePos == m_download->file_list()->bitfield()->size_bytes()) 624 prepare_post_handshake(m_download->file_list()->bitfield()->is_all_unset()); 625 620 626 if (m_writeDone) 621 627 throw handshake_succeeded(); … … 1021 1027 void 1022 1028 Handshake::prepare_post_handshake(bool must_write) { 1029 if (m_writePos != m_download->file_list()->bitfield()->size_bytes()) 1030 throw internal_error("Handshake::prepare_post_handshake called while bitfield not written completely."); 1031 1023 1032 m_state = POST_HANDSHAKE; 1024 1033 … … 1042 1051 if (!m_writeBuffer.remaining()) 1043 1052 write_done(); 1044 1045 // Skip writting the bitfield.1046 m_writePos = m_download->file_list()->bitfield()->size_bytes();1047 1053 } 1048 1054 … … 1122 1128 } 1123 1129 1124 if (m_writePos == bitfield->size_bytes()) 1125 prepare_post_handshake(false); 1130 // We can't call prepare_post_handshake until the read code is done reading 1131 // the bitfield, so if we get here before then, postpone the post handshake 1132 // data until reading is done. Since we're done writing, remove us from the 1133 // poll in that case. 1134 if (m_writePos == bitfield->size_bytes()) { 1135 if (!m_readDone) 1136 manager->poll()->remove_write(this); 1137 else 1138 prepare_post_handshake(false); 1139 } 1126 1140 } 1127 1141 -
trunk/rtorrent/scripts/checks.m4
r987 r1027 292 292 ]) 293 293 294 AC_DEFUN([TORRENT_CHECK_TR1], [ 295 AC_LANG_PUSH(C++) 296 AC_MSG_CHECKING(for TR1 support) 297 298 AC_COMPILE_IFELSE( 299 [[#include <tr1/unordered_map> 300 class Foo; 301 typedef std::tr1::unordered_map<Foo*, int> Bar; 302 ]], 303 [ 304 AC_MSG_RESULT(yes) 305 AC_DEFINE(HAVE_TR1, 1, Define to 1 if your C++ library supports the extensions from Technical Report 1) 306 ], 307 [ 308 AC_MSG_RESULT(no) 309 ] 310 ) 311 312 AC_LANG_POP(C++) 313 ]) 294 314 295 315 AC_DEFUN([TORRENT_WITH_FASTCGI], [ … … 350 370 351 371 else 352 if eval xmlrpc-c-config --version 2>/dev/null >/dev/null; then 353 CXXFLAGS="$CXXFLAGS `xmlrpc-c-config --cflags server-util`" 354 LIBS="$LIBS `xmlrpc-c-config server-util --libs`" 372 if test "$withval" = "yes"; then 373 xmlrpc_cc_prg="xmlrpc-c-config" 374 else 375 xmlrpc_cc_prg="$withval" 376 fi 377 378 if eval $xmlrpc_cc_prg --version 2>/dev/null >/dev/null; then 379 CXXFLAGS="$CXXFLAGS `$xmlrpc_cc_prg --cflags server-util`" 380 LIBS="$LIBS `$xmlrpc_cc_prg server-util --libs`" 355 381 356 382 AC_TRY_LINK(
