libstdc++ and libc++ both work now

This commit is contained in:
Peter Thorson
2012-01-31 09:14:00 -06:00
parent 23a2747e04
commit c4cab70702
2 changed files with 8 additions and 53 deletions

View File

@@ -65,43 +65,21 @@ public:
while(input.good() && i < size) {
c = input.get();
if (input.good()) {
if (!input.fail()) {
if (m_masking_index >= 0) {
c = c ^ m_masking_key[(m_masking_index++)%4];
}
m_payload.push_back(c);
i++;
} else if (input.eof()) {
break;
} else {
}
if (input.bad()) {
throw processor::exception("istream read error 2",
processor::error::FATAL_ERROR);
}
}
/*for (i = 0; i < size; ++i) {
if (input.good()) {
c = input.get();
if (input.fail()) {
throw processor::exception("istream read error",
processor::error::FATAL_ERROR);
}
if (m_masking_index >= 0) {
c = c ^ m_masking_key[(m_masking_index++)%4];
}
m_payload.push_back(c);
} else if (input.eof()) {
break;
} else {
throw processor::exception("istream read error",processor::error::FATAL_ERROR);
}
}*/
// successfully read all bytes
return i;
}

View File

@@ -62,44 +62,21 @@ uint64_t data::process_payload(std::istream& input,uint64_t size) {
));
}
// extract characters until size have been extracted or eof. return num ext
i = 0;
while(input.good() && i < size) {
c = input.get();
if (input.good()) {
if (!input.fail()) {
process_character(c);
i++;
} else if (input.eof()) {
break;
} else {
}
if (input.bad()) {
throw processor::exception("istream read error 2",
processor::error::FATAL_ERROR);
}
}
/*for (i = 0; i < size; ++i) {
if (input.good()) {
c = input.get();
process_character(c);
if (input.eof()) {
break;
}
if (input.fail()) {
throw processor::exception("istream read error 1",
processor::error::FATAL_ERROR);
}
} else if (input.eof()) {
break;
} else {
throw processor::exception("istream read error 2",
processor::error::FATAL_ERROR);
}
}*/
// successfully read all bytes
return i;
}