Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commandserver.py @ 14719:c19de7f32961 stable
cmdserver: write the hello message as one chunk on the 'o' channel
This is a guaranteed by the protocol: clients know they need to read one chunk
off of the 'o' channel and treat that as the hello message.
They should ignore fields they don't recognize so they stay compatible with
new versions of the server in case we decide to add something.
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Wed, 22 Jun 2011 17:13:04 +0300 |
parents | 964a72038bb0 |
children | 350dcd481410 |
comparison
equal
deleted
inserted
replaced
14718:0c81948636f3 | 14719:c19de7f32961 |
---|---|
203 | 203 |
204 capabilities = {'runcommand' : runcommand, | 204 capabilities = {'runcommand' : runcommand, |
205 'getencoding' : getencoding} | 205 'getencoding' : getencoding} |
206 | 206 |
207 def serve(self): | 207 def serve(self): |
208 self.cout.write('capabilities: %s' % ' '.join(self.capabilities.keys())) | 208 hellomsg = 'capabilities: ' + ' '.join(self.capabilities.keys()) |
209 self.cout.write('encoding: %s' % encoding.encoding) | 209 hellomsg += '\n' |
210 hellomsg += 'encoding: ' + encoding.encoding | |
211 | |
212 # write the hello msg in -one- chunk | |
213 self.cout.write(hellomsg) | |
210 | 214 |
211 try: | 215 try: |
212 while self.serveone(): | 216 while self.serveone(): |
213 pass | 217 pass |
214 except EOFError: | 218 except EOFError: |