Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/shared/Communication.cpp

Issue 11443036: Call WriteFile even for empty messages (Closed)
Patch Set: Created Aug. 13, 2013, 10:07 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <Windows.h> 1 #include <Windows.h>
2 #include <Lmcons.h> 2 #include <Lmcons.h>
3 #include <Sddl.h> 3 #include <Sddl.h>
4 4
5 #include "Communication.h" 5 #include "Communication.h"
6 #include "Utils.h" 6 #include "Utils.h"
7 7
8 namespace 8 namespace
9 { 9 {
10 const int bufferSize = 1024; 10 const int bufferSize = 1024;
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } 150 }
151 stream << std::string(buffer.get(), bytesRead); 151 stream << std::string(buffer.get(), bytesRead);
152 } 152 }
153 return Communication::InputBuffer(stream.str()); 153 return Communication::InputBuffer(stream.str());
154 } 154 }
155 155
156 void Communication::Pipe::WriteMessage(Communication::OutputBuffer& message) 156 void Communication::Pipe::WriteMessage(Communication::OutputBuffer& message)
157 { 157 {
158 DWORD bytesWritten; 158 DWORD bytesWritten;
159 std::string data = message.Get(); 159 std::string data = message.Get();
160 if (!data.length())
161 return;
162 if (!WriteFile(pipe, data.c_str(), data.length(), &bytesWritten, 0)) 160 if (!WriteFile(pipe, data.c_str(), data.length(), &bytesWritten, 0))
163 throw std::runtime_error("Failed to write to pipe"); 161 throw std::runtime_error("Failed to write to pipe");
164 } 162 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld