You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c86b6d5
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: PythonCodeCompletion/xmlrpc_embedder.cpp
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -139,22 +139,22 @@ class XmlRpcPipeClient
139
139
std::cout<<"bad request value"<<std::endl;
140
140
returnfalse;
141
141
}
142
-
uint32_t r_size=msg.size();
142
+
uint32_t r_size=msg.size();//TODO: Is it safer to use uint64_t (would need to use long long on the python side)
143
143
m_ostream->Write(&r_size,sizeof(uint32_t));
144
-
m_ostream->Write(msg.c_str(),msg.size());
144
+
for(uint32_t i=0;i<msg.size();++i)
145
+
m_ostream->PutC(msg[i]);
146
+
// m_ostream->Write(msg.c_str(),msg.size()); //On windows, this will frequently result in an incomplete write becasue the buffer gets full so better to use the blocking PutC instead
145
147
std::cout<<"wrote "<<msg<<std::endl;
146
-
std::cout<<"wrote"<<r_size<<std::endl;
148
+
std::cout<<"with size"<<r_size<<std::endl;
147
149
char ch=m_istream->GetC();
148
150
std::cout<<"read ch "<<ch<<std::endl;
149
-
for(int i=0;i<sizeof(uint32_t);i++)
151
+
for(uint32_t i=0;i<sizeof(uint32_t);i++)
150
152
((char*)(&r_size))[i]=m_istream->GetC();
151
153
std::cout<<"response size is "<<r_size<<std::endl;
152
154
char *buf = newchar[r_size+1];
153
-
for(int i=0;i<r_size;i++)
155
+
for(uint32_t i=0;i<r_size;i++)
154
156
buf[i]=m_istream->GetC();
155
-
//// m_istream->Read(buf,r_size);
156
157
buf[r_size]=0;
157
-
int offset=0;
158
158
std::cout<<"response was "<<std::string(buf)<<std::endl;
159
159
if(parseResponse(std::string(buf), result))
160
160
{
@@ -321,7 +321,7 @@ long XmlRpcInstance::LaunchProcess(const wxString &processcmd)
321
321
#ifdef __WXMSW__
322
322
//by default wxExecute shows the terminal window on MSW (redirecting would hide it, but that breaks the process if buffers are not flushed periodically)
0 commit comments