use PtrToPtr64 for scatter/gather I/O operations

This commit is contained in:
Arvid Norberg 2010-11-22 00:54:39 +00:00
parent d98a8b04a5
commit d937716af0
3 changed files with 11 additions and 2 deletions

View File

@ -55,6 +55,7 @@
incoming connection incoming connection
* added more detailed instrumentation of the disk I/O thread * added more detailed instrumentation of the disk I/O thread
* potential WOW64 fix for unbuffered I/O (windows)
* expose set_alert_queue_size_limit to python binding * expose set_alert_queue_size_limit to python binding
* support dht nodes in magnet links * support dht nodes in magnet links
* support 100 Continue HTTP responses * support 100 Continue HTTP responses

View File

@ -1067,7 +1067,7 @@ namespace libtorrent
{ {
for (int k = 0; k < int(i->iov_len); k += m_page_size) for (int k = 0; k < int(i->iov_len); k += m_page_size)
{ {
cur_seg->Buffer = ((char*)i->iov_base) + k; cur_seg->Buffer = PtrToPtr64(((char*)i->iov_base) + k);
++cur_seg; ++cur_seg;
} }
} }
@ -1250,7 +1250,7 @@ namespace libtorrent
{ {
for (int k = 0; k < int(i->iov_len); k += m_page_size) for (int k = 0; k < int(i->iov_len); k += m_page_size)
{ {
cur_seg->Buffer = ((char*)i->iov_base) + k; cur_seg->Buffer = PtrToPtr64(((char*)i->iov_base) + k);
++cur_seg; ++cur_seg;
} }
} }
@ -1285,6 +1285,8 @@ namespace libtorrent
{ {
if (GetLastError() != ERROR_IO_PENDING) if (GetLastError() != ERROR_IO_PENDING)
{ {
TORRENT_ASSERT(GetLastError() != ERROR_BAD_ARGUMENTS);
TORRENT_ASSERT(GetLastError() != ERROR_BAD_ARGUMENTS);
ec.assign(GetLastError(), get_system_category()); ec.assign(GetLastError(), get_system_category());
CloseHandle(ol.hEvent); CloseHandle(ol.hEvent);
return -1; return -1;

View File

@ -415,12 +415,18 @@ void udp_socket::close()
// utp connections or NAT-PMP. We need to cancel the // utp connections or NAT-PMP. We need to cancel the
// outstanding operations // outstanding operations
m_ipv4_sock.cancel(ec); m_ipv4_sock.cancel(ec);
if (ec == error::operation_not_supported)
m_ipv4_sock.close(ec);
TORRENT_ASSERT_VAL(!ec || ec == error::bad_descriptor, ec); TORRENT_ASSERT_VAL(!ec || ec == error::bad_descriptor, ec);
#if TORRENT_USE_IPV6 #if TORRENT_USE_IPV6
m_ipv6_sock.cancel(ec); m_ipv6_sock.cancel(ec);
if (ec == error::operation_not_supported)
m_ipv6_sock.close(ec);
TORRENT_ASSERT_VAL(!ec || ec == error::bad_descriptor, ec); TORRENT_ASSERT_VAL(!ec || ec == error::bad_descriptor, ec);
#endif #endif
m_socks5_sock.cancel(ec); m_socks5_sock.cancel(ec);
if (ec == error::operation_not_supported)
m_socks5_sock.close(ec);
TORRENT_ASSERT_VAL(!ec || ec == error::bad_descriptor, ec); TORRENT_ASSERT_VAL(!ec || ec == error::bad_descriptor, ec);
m_resolver.cancel(); m_resolver.cancel();
m_abort = true; m_abort = true;