version 0.5.0_alpha

git-svn-id: svn://db.shs.com.ru/pip@8 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2015-03-10 10:13:18 +00:00
parent b1f651ab62
commit c11bc3b3b8
697 changed files with 18150 additions and 18839 deletions

View File

@@ -16,6 +16,22 @@ public:
enum ReplyCode {Unknown = 0, Success, Invalid, Break};
enum PacketType {pt_Data = 1, pt_Reply, pt_SendRequest};//, pt_SendResult};
struct EntryInfo {
EntryInfo() {
fstart = fsize = 0;
parts = part_index = 0;
}
PIFile::FileInfo entry;
llong fstart;
llong fsize;
uint parts;
uint part_index;
};
struct FilePart {
uint index;
PIByteArray data;
};
struct PacketHeader {
union {
@@ -34,25 +50,6 @@ public:
}
// uint crc;
};
struct PartHeader {
uint id;
uint total_size;
uint part_start;
uint part_size;
};
struct EntryInfo {
EntryInfo() {
fstart = fsize = 0;
parts = part_index = 0;
}
PIFile::FileInfo entry;
llong fstart;
llong fsize;
uint parts;
uint part_index;
};
//bool send(const PIFile & file);
bool send(const PIString & file);
@@ -126,8 +123,6 @@ private:
inline PIByteArray & operator <<(PIByteArray & s, const PIFileTransfer::PacketHeader & v) {s << v.raw_sig << v.type << v.session_id << v.id; return s;}
inline PIByteArray & operator >>(PIByteArray & s, PIFileTransfer::PacketHeader & v) {s >> v.raw_sig >> v.type >> v.session_id >> v.id; return s;}
inline PIByteArray & operator <<(PIByteArray & s, const PIFileTransfer::PartHeader & v) {s << v.id << v.total_size << v.part_start << v.part_size; return s;}
inline PIByteArray & operator >>(PIByteArray & s, PIFileTransfer::PartHeader & v) {s >> v.id >> v.total_size >> v.part_start >> v.part_size; return s;}
inline PIByteArray & operator <<(PIByteArray & s, const PIFileTransfer::EntryInfo & v) {s << v.entry.path << v.entry.size << v.entry.time_modification << v.entry.time_access << int(v.entry.flags)
<< v.entry.id_user << v.entry.id_group << v.fstart; return s;}