Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #36890 > unrolled thread

Re: Python-list Digest, Vol 112, Issue 114

Started byLevi Nie <levinie001@gmail.com>
First post2013-01-16 17:57 +0800
Last post2013-01-16 17:57 +0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Python-list Digest, Vol 112, Issue 114 Levi Nie <levinie001@gmail.com> - 2013-01-16 17:57 +0800

#36890 — Re: Python-list Digest, Vol 112, Issue 114

FromLevi Nie <levinie001@gmail.com>
Date2013-01-16 17:57 +0800
SubjectRe: Python-list Digest, Vol 112, Issue 114
Message-ID<mailman.566.1358330272.2939.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

TKS, Ulrich.
    I finally write some back (self.transport.write()), and shutdown the
connections.

>
> ---------- 已转发邮件 ----------
> From: Ulrich Eckhardt <ulrich.eckhardt@dominolaser.com>
> To: python-list@python.org
> Cc:
> Date: Tue, 15 Jan 2013 13:46:52 +0100
> Subject: Re: interrupt the file sending if the file size over the
> quota...some errors here...
> Am 15.01.2013 10:46, schrieb Levi Nie:
>
>> i want to interrupt the file sending. but i can't change the client. so i
>> need change the server.
>> All things go well, but the message i wanna response seem not work.
>>
>
> Ahem, what? It doesn't work, so does it sit on the couch all day?
>
>
>  is the self.transport.loseConnection(**) (the last line) blocking the
>> messages?
>> in fact, i work on Cumulus(nimbus project) which based on twisted. And i
>> use s3cmd as the client.
>>
>
> I'm wondering if questions concerning twisted don't have a better forum.
> In any case, I can only comment on the general approach. For that, there
> are two things you can do:
>
> 1. When receiving the the request header, you have a content length. If
> that exceeds the allowed amount, shutdown() receiving and send an according
> HTTP response before closing the connection.
> 2. If the data exceeds the amount advertised by the content length, close
> the connection and discard the request. If you want to be nice, send an
> according response before closing, but I personally wouldn't go to that
> effort for broken HTTP clients.
>
> Concerning the question why your client hangs, it could also be the
> sending. If you try to send something before receiving the full request,
> client and server could enter a deadlock where each side waits for the
> other to receive some data. For that reason, you should shutdown()
> receiving in such a case.
>
> HTH
>
> Uli
>
>
>
>

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web