why does the sftp stub server only allow one connection?

Robey Pointer robey at lag.net
Fri Feb 10 19:58:52 GMT 2006


On 10 Feb 2006, at 6:31, John A Meinel wrote:

> Robert Collins wrote:
>> Its getting quite frustrating now :[
>>
>> Rob
>
> Actually, the stub server doesn't only allow 1 connection. It is the
> bzrlib.transport.sftp.SingleListener which is doing this.
>
> Specifically you have the lines:
>
>     def run(self):
>         s, _ = self._socket.accept()
>         # now close the listen socket
>         self._socket.close()
>         self._callback(s, self.stop_event)
>
> Now, I believe the self.stop_event is supposed to be called by the
> callback to indicate the server should stop. (Which is why we only
> support a single connection).
>
> I'm not sure how it should be refactored. But we need some way to tell
> the server to stop running.

Yeah, we chatted about this briefly on IRC yesterday, and it was only  
limited to one accept for simplicity.  It should be fairly simple to  
make it do multiple accepts.  Attached is a small patch that does it  
by handling each request in series, in case that's sufficient.

robey
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: listen-patch.txt
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20060210/223a4bd8/attachment.txt 


More information about the bazaar mailing list