~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to lib/inets/src/http_server/mod_range.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-08-05 20:54:29 UTC
  • mfrom: (6.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20090805205429-pm4pnwew8axraosl
Tags: 1:13.b.1-dfsg-5
* Fixed parentheses in Emacs mode (closes: #536891).
* Removed unnecessary conflicts with erlang-manpages package.
* Added workaround for #475459: disabled threads on sparc architecture.
  This breaks wxErlang, so it's only a temporary solution.

Show diffs side-by-side

added added

removed removed

Lines of Context:
161
161
    end.
162
162
   
163
163
send_multipart_start({{Start,End},{StartByte,EndByte,Size}},Info,
164
 
                     PartMimeType,FileDescriptor)when StartByte<Size->
 
164
                     PartMimeType,FileDescriptor)
 
165
  when StartByte < Size ->
165
166
    PartHeader=["\r\n--RangeBoundarySeparator\r\n","Content-type: ",
166
167
                PartMimeType,"\r\n",
167
168
                "Content-Range:bytes=",integer_to_list(StartByte),"-",
240
241
        from_start ->
241
242
            file:position(FileDescriptor,{bof,End}),
242
243
            send_body(SocketType,Socket,FileDescriptor);
243
 
        Byte when integer(Byte) ->
 
244
        Byte when is_integer(Byte) ->
244
245
            file:position(FileDescriptor,{bof,Start}),
245
246
            send_part(SocketType,Socket,FileDescriptor,End)
246
247
    end,
315
316
            false
316
317
    end;
317
318
 
318
 
valid_range(Start,End,FileInfo)when Start=<End->
 
319
valid_range(Start,End,FileInfo) when Start =< End ->
319
320
    case FileInfo#file_info.size of
320
321
        FileSize when Start< FileSize ->
321
322
            case FileInfo#file_info.size of
347
348
%Calculate the size of the chunk to read
348
349
        
349
350
get_file_chunk_size(Position, End, DefaultChunkSize) 
350
 
  when (Position+DefaultChunkSize) =< End->
 
351
  when (Position+DefaultChunkSize) =< End ->
351
352
    DefaultChunkSize;
352
 
get_file_chunk_size(Position, End, _DefaultChunkSize)->
 
353
get_file_chunk_size(Position, End, _DefaultChunkSize) ->
353
354
    (End-Position) +1.
354
355
 
355
356