C++에서 native-host를 사용하고 있습니다. native64에서 base64를 chrome extension (기본 메시징)으로 base64 크기 base64 < 1M으로 보내면 프로그램이 실행 중입니다. 내가 크기 base64로> 1M와 크롬 확장 (기본 메시징)에 네이티브 응용 프로그램에서 64 기수를 보낼 때 Native Messaging 호스트가 1MB의 데이터를 전송할 수 없습니다.
int _tmain(int argc, _TCHAR* argv[])
{
std::cout.setf(std::ios_base::unitbuf);
unsigned int c, t=0;
inp="";
t=0;
// Sum the first 4 chars from stdin (the length of the message passed).
for (int i = 0; i <= 3; i++) {
//t += getchar();
t += std::pow(256.0f, i) * getchar();
}
// Loop getchar to pull in the message until we reach the total
// length provided.
for (int i=0; i < t; i++) {
c = getchar();
inp += c;
}
unsigned int len = inp.length();
// We need to send the 4 btyes of length information
std::cout << char(((len>>0) & 0xFF))
<< char(((len>>8) & 0xFF))
<< char(((len>>16) & 0xFF))
<< char(((len>>24) & 0xFF));
// Now we can output our message
std::cout << inp;
return 0;
}
그래서 질문은 어디에 있습니까? 너는 무엇을 알고 싶니? –
예, 이것은 의도적으로 1M 이상인 메시지를 허용하지 않습니다. 일련의 작은 메시지로 나누고 확장에서 데이터를 다시 어셈블해야합니다. – donaddon
@donaddon 귀하의 청구 원인이 있습니까? – Xan