equal
deleted
inserted
replaced
112 |
112 |
113 public int getParameter(int paramID) { |
113 public int getParameter(int paramID) { |
114 if (paramID > MAX_PARAM) { |
114 if (paramID > MAX_PARAM) { |
115 throw new IllegalArgumentException("illegal parameter"); |
115 throw new IllegalArgumentException("illegal parameter"); |
116 } |
116 } |
117 return parameters[paramID-1]; |
117 return parameters[paramID - 1]; |
118 } |
118 } |
119 |
119 |
120 public SettingsFrame setParameter(int paramID, int value) { |
120 public SettingsFrame setParameter(int paramID, int value) { |
121 if (paramID > MAX_PARAM) { |
121 if (paramID > MAX_PARAM) { |
122 throw new IllegalArgumentException("illegal parameter"); |
122 throw new IllegalArgumentException("illegal parameter"); |
151 return bytes; |
151 return bytes; |
152 } |
152 } |
153 |
153 |
154 private static final int K = 1024; |
154 private static final int K = 1024; |
155 |
155 |
|
156 public synchronized void update(SettingsFrame updated) { |
|
157 for (int i = 0; i < MAX_PARAM; i++) { |
|
158 if (updated.parameters[i] != -1) { |
|
159 parameters[i] = updated.parameters[i]; |
|
160 } |
|
161 } |
|
162 } |
|
163 |
156 public static SettingsFrame getDefaultSettings() { |
164 public static SettingsFrame getDefaultSettings() { |
157 SettingsFrame f = new SettingsFrame(); |
165 SettingsFrame f = new SettingsFrame(); |
158 // TODO: check these values |
166 // TODO: check these values |
159 f.setParameter(ENABLE_PUSH, 1); |
167 f.setParameter(ENABLE_PUSH, 1); |
160 f.setParameter(HEADER_TABLE_SIZE, 4 * K); |
168 f.setParameter(HEADER_TABLE_SIZE, 4 * K); |