rhosync 2.1.12 → 2.1.13

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ ## 2.1.13
2
+ * #20910767 - fix for cud params modification in before filter (support requests #1802, #1804)
3
+ * #20917129 - add Cache-Control:no-cache and Pragma:no-cache headers into response
4
+
1
5
  ## 2.1.12
2
6
  * #19304885 - fixing race condition in get_lock (lock is released between setnx and get calls)
3
7
  * #18508155 - on failed syncs allow the user to retry it up to pre-defined number of times (another approach)
@@ -170,19 +170,9 @@ module Rhosync
170
170
  Rhosync.log "Rhosync Server v#{Rhosync::VERSION} started..."
171
171
 
172
172
  before do
173
- begin
174
- if params["cud"]
175
- cud = JSON.parse(params["cud"])
176
- params.delete("cud")
177
- params.merge!(cud)
178
- end
179
- rescue JSON::ParserError => jpe
180
- log jpe.message + jpe.backtrace.join("\n")
181
- throw :halt, [500, "Server error while processing client data"]
182
- rescue Exception => e
183
- log e.message + e.backtrace.join("\n")
184
- throw :halt, [500, "Internal server error"]
185
- end
173
+ cache_control :no_cache
174
+ headers({'pragma'=>'no-cache'})
175
+
186
176
  if params[:version] and params[:version].to_i < 3
187
177
  throw :halt, [404, "Server supports version 3 or higher of the protocol."]
188
178
  end
@@ -247,6 +237,19 @@ module Rhosync
247
237
  end
248
238
 
249
239
  post '/application' do
240
+ begin
241
+ if params["cud"]
242
+ cud = JSON.parse(params["cud"])
243
+ params.delete("cud")
244
+ params.merge!(cud)
245
+ end
246
+ rescue JSON::ParserError => jpe
247
+ log jpe.message + jpe.backtrace.join("\n")
248
+ throw :halt, [500, "Server error while processing client data"]
249
+ rescue Exception => e
250
+ log e.message + e.backtrace.join("\n")
251
+ throw :halt, [500, "Internal server error"]
252
+ end
250
253
  catch_all do
251
254
  current_client_sync.receive_cud(params)
252
255
  status 200
@@ -1,3 +1,3 @@
1
1
  module Rhosync
2
- VERSION = '2.1.12'
2
+ VERSION = '2.1.13'
3
3
  end
@@ -9,6 +9,12 @@ describe "RhosyncApiGetApiToken" do
9
9
  last_response.body.should == @api_token
10
10
  end
11
11
 
12
+ it "response should have cache-control and pragma headers set to no-cache" do
13
+ post "/login", :login => 'rhoadmin',:password => ''
14
+ last_response.headers['Cache-Control'].should == 'no-cache'
15
+ last_response.headers['Pragma'].should == 'no-cache'
16
+ end
17
+
12
18
  it "should fail to get token if user is not rhoadmin" do
13
19
  post "/login", :login => @u_fields[:login],:password => 'testpass'
14
20
  post "/api/get_api_token"
@@ -0,0 +1,4 @@
1
+ x�T;��@�#���!�X�(�SU�"B:(���.q���Rb�Mw�ҧ���s%%�J��7�Y?"
2
+ F��cg盙]��t��XB#�D�����&"����~9���VVB/O6
3
+ �;�d�WE��!8!�8�F��>����8�}e'f)D<��:�S� PZ����rR�lު �N��e���dr>���>���A]�Xy嚚��UOݷ��ۑ��"n�*sW�z"��Z8��1��4Ou��U4bU]���B���ۼ ��}���{���c���Ͼ�*V�D�)΁� ��=�o������+����J��:� �t�A�}�u= �� ��$�_l]��=tp���8��o8���X�R���Bxv�ݨ�j�R�d�&�Ni��á��*
4
+ �.&�LCD�Y�8���s4�t����2>����*�2p�W����'
@@ -0,0 +1,19 @@
1
+ #HSQL Database Engine 1.8.0.10
2
+ #Fri Nov 11 14:20:30 PST 2011
3
+ hsqldb.script_format=0
4
+ runtime.gc_interval=0
5
+ hsqldb.incremental_backup=false
6
+ sql.enforce_strict_size=false
7
+ hsqldb.cache_size_scale=8
8
+ readonly=false
9
+ hsqldb.nio_data_file=false
10
+ hsqldb.cache_scale=14
11
+ version=1.8.1
12
+ hsqldb.default_table_type=cached
13
+ hsqldb.cache_file_scale=1
14
+ hsqldb.lock_file=true
15
+ hsqldb.log_size=200
16
+ modified=no
17
+ hsqldb.cache_version=1.7.0
18
+ hsqldb.original_version=1.8.1
19
+ hsqldb.compatible_version=1.8.0
@@ -0,0 +1,17 @@
1
+ CREATE SCHEMA PUBLIC AUTHORIZATION DBA
2
+ CREATE CACHED TABLE CLIENT_INFO("client_id" VARCHAR(255) DEFAULT NULL,"session" VARCHAR(255) DEFAULT NULL,"token" VARCHAR(255) DEFAULT NULL,"token_sent" BIGINT DEFAULT 0,"reset" BIGINT DEFAULT 0,"port" VARCHAR(10) DEFAULT NULL,"last_sync_success" VARCHAR(100) DEFAULT NULL)
3
+ CREATE CACHED TABLE OBJECT_VALUES("source_id" BIGINT DEFAULT NULL,"attrib" VARCHAR(255) DEFAULT NULL,"object" VARCHAR(255) DEFAULT NULL,"value" VARCHAR DEFAULT NULL)
4
+ CREATE INDEX BY_SRC_ID ON OBJECT_VALUES("source_id")
5
+ CREATE INDEX BY_SRC_VALUE ON OBJECT_VALUES("attrib","source_id","value")
6
+ CREATE UNIQUE INDEX BY_SRC_OBJECT ON OBJECT_VALUES("object","attrib","source_id")
7
+ CREATE CACHED TABLE CHANGED_VALUES("source_id" BIGINT DEFAULT NULL,"attrib" VARCHAR(255) DEFAULT NULL,"object" VARCHAR(255) DEFAULT NULL,"value" VARCHAR DEFAULT NULL,"attrib_type" VARCHAR(255) DEFAULT NULL,"update_type" VARCHAR(255) DEFAULT NULL,"sent" BIGINT DEFAULT 0)
8
+ CREATE CACHED TABLE SOURCES("source_id" BIGINT NOT NULL PRIMARY KEY,"name" VARCHAR(255) DEFAULT NULL,"token" BIGINT DEFAULT NULL,"sync_priority" BIGINT,"partition" VARCHAR(255),"sync_type" VARCHAR(255),"metadata" VARCHAR DEFAULT NULL,"last_updated" BIGINT DEFAULT 0,"last_inserted_size" BIGINT DEFAULT 0,"last_deleted_size" BIGINT DEFAULT 0,"last_sync_duration" BIGINT DEFAULT 0,"last_sync_success" BIGINT DEFAULT 0,"backend_refresh_time" BIGINT DEFAULT 0,"source_attribs" VARCHAR DEFAULT NULL,"schema" VARCHAR DEFAULT NULL,"schema_version" VARCHAR DEFAULT NULL,"associations" VARCHAR DEFAULT NULL,"blob_attribs" VARCHAR DEFAULT NULL)
9
+ CREATE CACHED TABLE FIXEDSCHEMAADAPTER("object" VARCHAR(255) NOT NULL PRIMARY KEY,"name" VARCHAR DEFAULT NULL,"brand" VARCHAR DEFAULT NULL,"price" VARCHAR DEFAULT NULL,"image_url_cropped" VARCHAR DEFAULT NULL,"image_url" VARCHAR DEFAULT NULL)
10
+ CREATE INDEX BY_NAME_BRAND ON FIXEDSCHEMAADAPTER("name","brand")
11
+ CREATE UNIQUE INDEX BY_PRICE ON FIXEDSCHEMAADAPTER("price")
12
+ SET TABLE OBJECT_VALUES INDEX'344 344 32 448 0'
13
+ SET TABLE SOURCES INDEX'976 0'
14
+ SET TABLE FIXEDSCHEMAADAPTER INDEX'1672 1672 1768 0'
15
+ CREATE USER SA PASSWORD ""
16
+ GRANT DBA TO SA
17
+ SET WRITE_DELAY 10
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhosync
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 1
9
- - 12
10
- version: 2.1.12
9
+ - 13
10
+ version: 2.1.13
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rhomobile
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-14 00:00:00 Z
18
+ date: 2011-11-11 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: sinatra
@@ -492,6 +492,15 @@ files:
492
492
  - spec/apps/rhotestapp/Rakefile
493
493
  - spec/apps/rhotestapp/application.rb
494
494
  - spec/apps/rhotestapp/config.ru
495
+ - spec/apps/rhotestapp/data/application/testuser/testuser_1321050029.data
496
+ - spec/apps/rhotestapp/data/application/testuser/testuser_1321050029.data.gzip
497
+ - spec/apps/rhotestapp/data/application/testuser/testuser_1321050029.data.hsqldb.backup
498
+ - spec/apps/rhotestapp/data/application/testuser/testuser_1321050029.data.hsqldb.data
499
+ - spec/apps/rhotestapp/data/application/testuser/testuser_1321050029.data.hsqldb.data.gzip
500
+ - spec/apps/rhotestapp/data/application/testuser/testuser_1321050029.data.hsqldb.properties
501
+ - spec/apps/rhotestapp/data/application/testuser/testuser_1321050029.data.hsqldb.script
502
+ - spec/apps/rhotestapp/data/application/testuser/testuser_1321050029.data.rzip
503
+ - spec/apps/rhotestapp/data/application/testuser/tmp/testuser_1321050029.data
495
504
  - spec/apps/rhotestapp/settings/apple_fake_cert.pem
496
505
  - spec/apps/rhotestapp/settings/license.key
497
506
  - spec/apps/rhotestapp/settings/settings.yml