fue algo mágico de todas maneras:
Código que funciona:
Código
void filtrar_pregunta_http(u_char* _datos, int _tamaño) { string paquete = string(reinterpret_cast<char*>(_datos), _tamaño); int tamaño = _tamaño; int pos = 0; while ((pos = paquete.find("https://", pos)) != string::npos){ paquete.replace(pos, 5, "http"); tamaño--; } cout << "pos: " << pos << endl; if ((pos = paquete.find("Accept-Encoding: ")) != string::npos){ int pas = pos; while (paquete[pas] != '\n'){ printf("%c", paquete[pas]); pas++; } paquete.erase(pos, pas - pos + 1); } cout << paquete.c_str() << endl; }