plugins/ticket/lib/common.rb in rsence-2.1.6 vs plugins/ticket/lib/common.rb in rsence-2.1.7
- old
+ new
@@ -154,11 +154,11 @@
# re-map content_type and filename meta-data from format
(content_type, filename) = format
# content size for the header
- content_size = content.size.to_s
+ content_size = content.bytesize.to_s
storage_hash = @files
storage_arr = [content_type,content_size,content,msg.ses_id,filename]
uri = File.join(::RSence.config[:broker_urls][:f],ticket_id)
@@ -268,11 +268,11 @@
content = img_data.to_blob {
self.format = format
}
# content size for the header
- content_size = content.size.to_s
+ content_size = content.bytesize.to_s
# content type for the header
content_type = @content_types[format]
if req.header.has_key?('keep-alive') and req.header['keep-alive'].size > 0
@@ -333,15 +333,15 @@
puts "fileServe.fetch_blobobj: invalid blobobj_id (#{blobobj_id.inspect})" if RSence.args[:verbose]
blobobj_id = 'invalid.gif'
end
if @raw_uris.include?(blobobj_id)
content_type = @raw_uris[blobobj_id].mime
- content_size = @raw_uris[blobobj_id].size
+ content_size = @raw_uris[blobobj_id].bytesize
content = @raw_uris[blobobj_id].data
elsif @blob_objs[:by_id].include?(blobobj_id)
(ses_id, blobobj) = @blob_objs[:by_id][blobobj_id]
content_type = blobobj.mime
- content_size = blobobj.size
+ content_size = blobobj.bytesize
content = blobobj.data
if req.header.has_key?('keep-alive') and req.header['keep-alive'].size > 0
keep_alive = req.header['keep-alive'][0].to_i
keep_alive = 10 if keep_alive < 10
keep_alive = 600 if keep_alive > 600