Changeset 1094
- Timestamp:
- 06/10/09 08:25:38 (3 years ago)
- Location:
- trunk/libtorrent/src
- Files:
-
- 4 modified
-
download/download_constructor.cc (modified) (1 diff)
-
torrent/object.h (modified) (2 diffs)
-
torrent/object_stream.cc (modified) (3 diffs)
-
torrent/poll_kqueue.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtorrent/src/download/download_constructor.cc
r1072 r1094 133 133 throw internal_error("parse_info received an already initialized Content object."); 134 134 135 if (b.flags() & Object::flag_unordered) 136 throw input_error("Download has unordered info dictionary."); 137 135 138 uint32_t chunkSize = b.get_key_value("piece length"); 136 139 -
trunk/libtorrent/src/torrent/object.h
r1080 r1094 76 76 static const uint32_t mask_public = ~mask_internal; 77 77 78 static const uint32_t flag_unordered = 0x100; // bencode dictionary was not sorted 79 78 80 enum type_type { 79 81 TYPE_NONE, … … 109 111 void set_flags(uint32_t f) { m_flags |= f & mask_public; } 110 112 void unset_flags(uint32_t f) { m_flags &= ~(f & mask_public); } 113 114 void set_internal_flags(uint32_t f) { m_flags |= f & (mask_internal & ~mask_type); } 115 void unset_internal_flags(uint32_t f) { m_flags &= ~(f & (mask_internal & ~mask_type)); } 111 116 112 117 // Add functions for setting/clearing the public flags. -
trunk/libtorrent/src/torrent/object_stream.cc
r1093 r1094 97 97 Object::list_iterator itr = object->as_list().insert(object->as_list().end(), Object()); 98 98 object_read_bencode(input, &*itr, depth); 99 100 if (itr->flags() & Object::flag_unordered) 101 object->set_internal_flags(Object::flag_unordered); 99 102 } 100 103 … … 108 111 break; 109 112 110 //Object::string_type last;113 Object::string_type last; 111 114 112 115 while (input->good()) { … … 121 124 break; 122 125 123 // if (last >= str) 124 // break; 125 126 object_read_bencode(input, &object->as_map()[str], depth); 127 128 // str.swap(last); 126 if (last >= str) 127 object->set_internal_flags(Object::flag_unordered); 128 129 Object* value = &object->as_map()[str]; 130 object_read_bencode(input, value, depth); 131 132 if (value->flags() & Object::flag_unordered) 133 object->set_internal_flags(Object::flag_unordered); 134 135 str.swap(last); 129 136 } 130 137 -
trunk/libtorrent/src/torrent/poll_kqueue.cc
r1074 r1094 55 55 #endif 56 56 57 #include <assert.h> 58 57 59 namespace torrent { 58 60 … … 89 91 PollKQueue::modify(Event* event, unsigned short op, short mask) { 90 92 // Flush the changed filters to the kernel if the buffer is full. 91 if (m_changedEvents == m_table.size())92 flush_events();93 94 93 if (m_changedEvents == m_maxEvents) { 95 94 if (kevent(m_fd, m_changes, m_changedEvents, NULL, 0, NULL) == -1)
