1
|
<!DOCTYPE html>
|
2
|
<html>
|
3
|
<head>
|
4
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
5
|
<title>NameError at /service/17/action</title>
|
6
|
|
7
|
<script type="text/javascript">
|
8
|
|
9
|
function toggle(id) {
|
10
|
var pre = document.getElementById("pre-" + id);
|
11
|
var post = document.getElementById("post-" + id);
|
12
|
var context = document.getElementById("context-" + id);
|
13
|
|
14
|
if (pre.style.display == 'block') {
|
15
|
pre.style.display = 'none';
|
16
|
post.style.display = 'none';
|
17
|
context.style.background = "none";
|
18
|
} else {
|
19
|
pre.style.display = 'block';
|
20
|
post.style.display = 'block';
|
21
|
context.style.background = "#fffed9";
|
22
|
}
|
23
|
}
|
24
|
|
25
|
function toggleBacktrace(){
|
26
|
var bt = document.getElementById("backtrace");
|
27
|
var toggler = document.getElementById("expando");
|
28
|
|
29
|
if (bt.className == 'condensed') {
|
30
|
bt.className = 'expanded';
|
31
|
toggler.innerHTML = "(condense)";
|
32
|
} else {
|
33
|
bt.className = 'condensed';
|
34
|
toggler.innerHTML = "(expand)";
|
35
|
}
|
36
|
}
|
37
|
|
38
|
</script>
|
39
|
|
40
|
<style type="text/css" media="screen">
|
41
|
* {margin: 0; padding: 0; border: 0; outline: 0;}
|
42
|
div.clear {clear: both;}
|
43
|
body {background: #EEEEEE; margin: 0; padding: 0;
|
44
|
font-family: 'Lucida Grande', 'Lucida Sans Unicode',
|
45
|
'Garuda';}
|
46
|
code {font-family: 'Lucida Console', monospace;
|
47
|
font-size: 12px;}
|
48
|
li {height: 18px;}
|
49
|
ul {list-style: none; margin: 0; padding: 0;}
|
50
|
ol:hover {cursor: pointer;}
|
51
|
ol li {white-space: pre;}
|
52
|
#explanation {font-size: 12px; color: #666666;
|
53
|
margin: 20px 0 0 100px;}
|
54
|
|
55
|
#wrap {width: 1000px; background: #FFFFFF; margin: 0 auto;
|
56
|
padding: 30px 50px 20px 50px;
|
57
|
border-left: 1px solid #DDDDDD;
|
58
|
border-right: 1px solid #DDDDDD;}
|
59
|
|
60
|
#header {margin: 0 auto 25px auto;}
|
61
|
#header img {float: left;}
|
62
|
#header #summary {float: left; margin: 12px 0 0 20px; width:660px;
|
63
|
font-family: 'Lucida Grande', 'Lucida Sans Unicode';}
|
64
|
h1 {margin: 0; font-size: 36px; color: #981919;}
|
65
|
h2 {margin: 0; font-size: 22px; color: #333333;}
|
66
|
#header ul {margin: 0; font-size: 12px; color: #666666;}
|
67
|
#header ul li strong{color: #444444;}
|
68
|
#header ul li {display: inline; padding: 0 10px;}
|
69
|
#header ul li.first {padding-left: 0;}
|
70
|
#header ul li.last {border: 0; padding-right: 0;}
|
71
|
|
72
|
#backtrace,
|
73
|
#get,
|
74
|
#post,
|
75
|
#cookies,
|
76
|
#rack {width: 980px; margin: 0 auto 10px auto;}
|
77
|
p#nav {float: right; font-size: 14px;}
|
78
|
|
79
|
a#expando {float: left; padding-left: 5px; color: #666666;
|
80
|
font-size: 14px; text-decoration: none; cursor: pointer;}
|
81
|
a#expando:hover {text-decoration: underline;}
|
82
|
h3 {float: left; width: 100px; margin-bottom: 10px;
|
83
|
color: #981919; font-size: 14px; font-weight: bold;}
|
84
|
#nav a {color: #666666; text-decoration: none; padding: 0 5px;}
|
85
|
#backtrace li.frame-info {background: #f7f7f7; padding-left: 10px;
|
86
|
font-size: 12px; color: #333333;}
|
87
|
#backtrace ul {list-style-position: outside; border: 1px solid #E9E9E9;
|
88
|
border-bottom: 0;}
|
89
|
#backtrace ol {width: 920px; margin-left: 50px;
|
90
|
font: 10px 'Lucida Console', monospace; color: #666666;}
|
91
|
#backtrace ol li {border: 0; border-left: 1px solid #E9E9E9;
|
92
|
padding: 2px 0;}
|
93
|
#backtrace ol code {font-size: 10px; color: #555555; padding-left: 5px;}
|
94
|
#backtrace-ul li {border-bottom: 1px solid #E9E9E9; height: auto;
|
95
|
padding: 3px 0;}
|
96
|
#backtrace-ul .code {padding: 6px 0 4px 0;}
|
97
|
#backtrace.condensed .system,
|
98
|
#backtrace.condensed .framework {display:none;}
|
99
|
|
100
|
p.no-data {padding-top: 2px; font-size: 12px; color: #666666;}
|
101
|
table.req {width: 980px; text-align: left; font-size: 12px;
|
102
|
color: #666666; padding: 0; border-spacing: 0;
|
103
|
border: 1px solid #EEEEEE; border-bottom: 0;
|
104
|
border-left: 0;
|
105
|
clear:both}
|
106
|
table.req tr th {padding: 2px 10px; font-weight: bold;
|
107
|
background: #F7F7F7; border-bottom: 1px solid #EEEEEE;
|
108
|
border-left: 1px solid #EEEEEE;}
|
109
|
table.req tr td {padding: 2px 20px 2px 10px;
|
110
|
border-bottom: 1px solid #EEEEEE;
|
111
|
border-left: 1px solid #EEEEEE;}
|
112
|
|
113
|
.pre-context,
|
114
|
.post-context {display: none;}
|
115
|
|
116
|
table td.code {width:750px}
|
117
|
table td.code div {width:750px;overflow:hidden}
|
118
|
</style>
|
119
|
</head>
|
120
|
<body>
|
121
|
<div id="wrap">
|
122
|
<div id="header">
|
123
|
<img src="/__sinatra__/500.png" alt="application error" height="161" width="313" />
|
124
|
<div id="summary">
|
125
|
<h1><strong>NameError</strong> at <strong>/service/17/action
|
126
|
</strong></h1>
|
127
|
<h2>undefined local variable or method `n_dispose' for #<OpenNebula::Role:0x7f4fad11d588></h2>
|
128
|
<ul>
|
129
|
<li class="first"><strong>file:</strong> <code>
|
130
|
role.rb</code></li>
|
131
|
<li><strong>location:</strong> <code>retry_scale
|
132
|
</code></li>
|
133
|
<li class="last"><strong>line:
|
134
|
</strong> 798</li>
|
135
|
</ul>
|
136
|
</div>
|
137
|
<div class="clear"></div>
|
138
|
</div>
|
139
|
|
140
|
<div id="backtrace" class='condensed'>
|
141
|
<h3>BACKTRACE</h3>
|
142
|
<p><a href="#" id="expando"
|
143
|
onclick="toggleBacktrace(); return false">(expand)</a></p>
|
144
|
<p id="nav"><strong>JUMP TO:</strong>
|
145
|
<a href="#get-info">GET</a>
|
146
|
<a href="#post-info">POST</a>
|
147
|
<a href="#cookie-info">COOKIES</a>
|
148
|
<a href="#env-info">ENV</a>
|
149
|
</p>
|
150
|
<div class="clear"></div>
|
151
|
|
152
|
<ul id="backtrace-ul">
|
153
|
|
154
|
|
155
|
|
156
|
|
157
|
|
158
|
<li class="frame-info app">
|
159
|
<code>/usr/lib/one/oneflow/lib/models/role.rb</code> in
|
160
|
<code><strong>retry_scale</strong></code>
|
161
|
</li>
|
162
|
|
163
|
<li class="code app">
|
164
|
|
165
|
<ol start="791"
|
166
|
class="pre-context" id="pre-1"
|
167
|
onclick="toggle(1);">
|
168
|
|
169
|
<li class="pre-context-line"><code> def retry_scale()
|
170
|
</code></li>
|
171
|
|
172
|
<li class="pre-context-line"><code> nodes_dispose = get_nodes.select { |node|
|
173
|
</code></li>
|
174
|
|
175
|
<li class="pre-context-line"><code> node['disposed'] == "1"
|
176
|
</code></li>
|
177
|
|
178
|
<li class="pre-context-line"><code> }
|
179
|
</code></li>
|
180
|
|
181
|
<li class="pre-context-line"><code>
|
182
|
</code></li>
|
183
|
|
184
|
<li class="pre-context-line"><code> shutdown_nodes(nodes_dispose, true)
|
185
|
</code></li>
|
186
|
|
187
|
<li class="pre-context-line"><code>
|
188
|
</code></li>
|
189
|
|
190
|
</ol>
|
191
|
|
192
|
|
193
|
<ol start="798" class="context" id="1"
|
194
|
onclick="toggle(1);">
|
195
|
<li class="context-line" id="context-1"><code> set_cardinality( get_nodes.size() - n_dispose.size() )</code></li>
|
196
|
</ol>
|
197
|
|
198
|
|
199
|
<ol start="799" class="post-context"
|
200
|
id="post-1" onclick="toggle(1);">
|
201
|
|
202
|
<li class="post-context-line"><code> end
|
203
|
</code></li>
|
204
|
|
205
|
<li class="post-context-line"><code>
|
206
|
</code></li>
|
207
|
|
208
|
<li class="post-context-line"><code> # Deletes VMs in DONE or FAILED, and sends a boot action to VMs in UNKNOWN
|
209
|
</code></li>
|
210
|
|
211
|
<li class="post-context-line"><code> def recover()
|
212
|
</code></li>
|
213
|
|
214
|
<li class="post-context-line"><code>
|
215
|
</code></li>
|
216
|
|
217
|
<li class="post-context-line"><code> nodes = @body['nodes']
|
218
|
</code></li>
|
219
|
|
220
|
<li class="post-context-line"><code> new_nodes = []
|
221
|
</code></li>
|
222
|
|
223
|
</ol>
|
224
|
|
225
|
<div class="clear"></div>
|
226
|
</li>
|
227
|
|
228
|
|
229
|
|
230
|
|
231
|
|
232
|
|
233
|
|
234
|
<li class="frame-info app">
|
235
|
<code>/usr/lib/one/oneflow/lib/models/role.rb</code> in
|
236
|
<code><strong>recover_scale</strong></code>
|
237
|
</li>
|
238
|
|
239
|
<li class="code app">
|
240
|
|
241
|
<ol start="586"
|
242
|
class="pre-context" id="pre-2"
|
243
|
onclick="toggle(2);">
|
244
|
|
245
|
<li class="pre-context-line"><code> def recover_warning()
|
246
|
</code></li>
|
247
|
|
248
|
<li class="pre-context-line"><code> recover()
|
249
|
</code></li>
|
250
|
|
251
|
<li class="pre-context-line"><code> deploy()
|
252
|
</code></li>
|
253
|
|
254
|
<li class="pre-context-line"><code> end
|
255
|
</code></li>
|
256
|
|
257
|
<li class="pre-context-line"><code>
|
258
|
</code></li>
|
259
|
|
260
|
<li class="pre-context-line"><code> def recover_scale()
|
261
|
</code></li>
|
262
|
|
263
|
<li class="pre-context-line"><code> recover()
|
264
|
</code></li>
|
265
|
|
266
|
</ol>
|
267
|
|
268
|
|
269
|
<ol start="593" class="context" id="2"
|
270
|
onclick="toggle(2);">
|
271
|
<li class="context-line" id="context-2"><code> retry_scale()</code></li>
|
272
|
</ol>
|
273
|
|
274
|
|
275
|
<ol start="594" class="post-context"
|
276
|
id="post-2" onclick="toggle(2);">
|
277
|
|
278
|
<li class="post-context-line"><code> end
|
279
|
</code></li>
|
280
|
|
281
|
<li class="post-context-line"><code>
|
282
|
</code></li>
|
283
|
|
284
|
<li class="post-context-line"><code>
|
285
|
</code></li>
|
286
|
|
287
|
<li class="post-context-line"><code> ########################################################################
|
288
|
</code></li>
|
289
|
|
290
|
<li class="post-context-line"><code> ########################################################################
|
291
|
</code></li>
|
292
|
|
293
|
<li class="post-context-line"><code>
|
294
|
</code></li>
|
295
|
|
296
|
<li class="post-context-line"><code>
|
297
|
</code></li>
|
298
|
|
299
|
</ol>
|
300
|
|
301
|
<div class="clear"></div>
|
302
|
</li>
|
303
|
|
304
|
|
305
|
|
306
|
|
307
|
|
308
|
|
309
|
|
310
|
<li class="frame-info app">
|
311
|
<code>/usr/lib/one/oneflow/lib/models/service.rb</code> in
|
312
|
<code><strong>recover</strong></code>
|
313
|
</li>
|
314
|
|
315
|
<li class="code app">
|
316
|
|
317
|
<ol start="211"
|
318
|
class="pre-context" id="pre-3"
|
319
|
onclick="toggle(3);">
|
320
|
|
321
|
<li class="pre-context-line"><code> end
|
322
|
</code></li>
|
323
|
|
324
|
<li class="pre-context-line"><code>
|
325
|
</code></li>
|
326
|
|
327
|
<li class="pre-context-line"><code> self.set_state(Service::STATE['DEPLOYING'])
|
328
|
</code></li>
|
329
|
|
330
|
<li class="pre-context-line"><code>
|
331
|
</code></li>
|
332
|
|
333
|
<li class="pre-context-line"><code> elsif self.state == Service::STATE['FAILED_SCALING']
|
334
|
</code></li>
|
335
|
|
336
|
<li class="pre-context-line"><code> @roles.each do |name, role|
|
337
|
</code></li>
|
338
|
|
339
|
<li class="pre-context-line"><code> if role.state == Role::STATE['FAILED_SCALING']
|
340
|
</code></li>
|
341
|
|
342
|
</ol>
|
343
|
|
344
|
|
345
|
<ol start="218" class="context" id="3"
|
346
|
onclick="toggle(3);">
|
347
|
<li class="context-line" id="context-3"><code> role.recover_scale()</code></li>
|
348
|
</ol>
|
349
|
|
350
|
|
351
|
<ol start="219" class="post-context"
|
352
|
id="post-3" onclick="toggle(3);">
|
353
|
|
354
|
<li class="post-context-line"><code> role.set_state(Role::STATE['SCALING'])
|
355
|
</code></li>
|
356
|
|
357
|
<li class="post-context-line"><code> end
|
358
|
</code></li>
|
359
|
|
360
|
<li class="post-context-line"><code> end
|
361
|
</code></li>
|
362
|
|
363
|
<li class="post-context-line"><code>
|
364
|
</code></li>
|
365
|
|
366
|
<li class="post-context-line"><code> self.set_state(Service::STATE['SCALING'])
|
367
|
</code></li>
|
368
|
|
369
|
<li class="post-context-line"><code>
|
370
|
</code></li>
|
371
|
|
372
|
<li class="post-context-line"><code> elsif self.state == Service::STATE['FAILED_UNDEPLOYING']
|
373
|
</code></li>
|
374
|
|
375
|
</ol>
|
376
|
|
377
|
<div class="clear"></div>
|
378
|
</li>
|
379
|
|
380
|
|
381
|
|
382
|
|
383
|
|
384
|
|
385
|
|
386
|
<li class="frame-info app">
|
387
|
<code>/usr/lib/one/oneflow/lib/models/service.rb</code> in
|
388
|
<code><strong>each</strong></code>
|
389
|
</li>
|
390
|
|
391
|
<li class="code app">
|
392
|
|
393
|
<ol start="209"
|
394
|
class="pre-context" id="pre-4"
|
395
|
onclick="toggle(4);">
|
396
|
|
397
|
<li class="pre-context-line"><code> role.recover_deployment()
|
398
|
</code></li>
|
399
|
|
400
|
<li class="pre-context-line"><code> end
|
401
|
</code></li>
|
402
|
|
403
|
<li class="pre-context-line"><code> end
|
404
|
</code></li>
|
405
|
|
406
|
<li class="pre-context-line"><code>
|
407
|
</code></li>
|
408
|
|
409
|
<li class="pre-context-line"><code> self.set_state(Service::STATE['DEPLOYING'])
|
410
|
</code></li>
|
411
|
|
412
|
<li class="pre-context-line"><code>
|
413
|
</code></li>
|
414
|
|
415
|
<li class="pre-context-line"><code> elsif self.state == Service::STATE['FAILED_SCALING']
|
416
|
</code></li>
|
417
|
|
418
|
</ol>
|
419
|
|
420
|
|
421
|
<ol start="216" class="context" id="4"
|
422
|
onclick="toggle(4);">
|
423
|
<li class="context-line" id="context-4"><code> @roles.each do |name, role|</code></li>
|
424
|
</ol>
|
425
|
|
426
|
|
427
|
<ol start="217" class="post-context"
|
428
|
id="post-4" onclick="toggle(4);">
|
429
|
|
430
|
<li class="post-context-line"><code> if role.state == Role::STATE['FAILED_SCALING']
|
431
|
</code></li>
|
432
|
|
433
|
<li class="post-context-line"><code> role.recover_scale()
|
434
|
</code></li>
|
435
|
|
436
|
<li class="post-context-line"><code> role.set_state(Role::STATE['SCALING'])
|
437
|
</code></li>
|
438
|
|
439
|
<li class="post-context-line"><code> end
|
440
|
</code></li>
|
441
|
|
442
|
<li class="post-context-line"><code> end
|
443
|
</code></li>
|
444
|
|
445
|
<li class="post-context-line"><code>
|
446
|
</code></li>
|
447
|
|
448
|
<li class="post-context-line"><code> self.set_state(Service::STATE['SCALING'])
|
449
|
</code></li>
|
450
|
|
451
|
</ol>
|
452
|
|
453
|
<div class="clear"></div>
|
454
|
</li>
|
455
|
|
456
|
|
457
|
|
458
|
|
459
|
|
460
|
|
461
|
|
462
|
<li class="frame-info app">
|
463
|
<code>/usr/lib/one/oneflow/lib/models/service.rb</code> in
|
464
|
<code><strong>recover</strong></code>
|
465
|
</li>
|
466
|
|
467
|
<li class="code app">
|
468
|
|
469
|
<ol start="209"
|
470
|
class="pre-context" id="pre-5"
|
471
|
onclick="toggle(5);">
|
472
|
|
473
|
<li class="pre-context-line"><code> role.recover_deployment()
|
474
|
</code></li>
|
475
|
|
476
|
<li class="pre-context-line"><code> end
|
477
|
</code></li>
|
478
|
|
479
|
<li class="pre-context-line"><code> end
|
480
|
</code></li>
|
481
|
|
482
|
<li class="pre-context-line"><code>
|
483
|
</code></li>
|
484
|
|
485
|
<li class="pre-context-line"><code> self.set_state(Service::STATE['DEPLOYING'])
|
486
|
</code></li>
|
487
|
|
488
|
<li class="pre-context-line"><code>
|
489
|
</code></li>
|
490
|
|
491
|
<li class="pre-context-line"><code> elsif self.state == Service::STATE['FAILED_SCALING']
|
492
|
</code></li>
|
493
|
|
494
|
</ol>
|
495
|
|
496
|
|
497
|
<ol start="216" class="context" id="5"
|
498
|
onclick="toggle(5);">
|
499
|
<li class="context-line" id="context-5"><code> @roles.each do |name, role|</code></li>
|
500
|
</ol>
|
501
|
|
502
|
|
503
|
<ol start="217" class="post-context"
|
504
|
id="post-5" onclick="toggle(5);">
|
505
|
|
506
|
<li class="post-context-line"><code> if role.state == Role::STATE['FAILED_SCALING']
|
507
|
</code></li>
|
508
|
|
509
|
<li class="post-context-line"><code> role.recover_scale()
|
510
|
</code></li>
|
511
|
|
512
|
<li class="post-context-line"><code> role.set_state(Role::STATE['SCALING'])
|
513
|
</code></li>
|
514
|
|
515
|
<li class="post-context-line"><code> end
|
516
|
</code></li>
|
517
|
|
518
|
<li class="post-context-line"><code> end
|
519
|
</code></li>
|
520
|
|
521
|
<li class="post-context-line"><code>
|
522
|
</code></li>
|
523
|
|
524
|
<li class="post-context-line"><code> self.set_state(Service::STATE['SCALING'])
|
525
|
</code></li>
|
526
|
|
527
|
</ol>
|
528
|
|
529
|
<div class="clear"></div>
|
530
|
</li>
|
531
|
|
532
|
|
533
|
|
534
|
|
535
|
|
536
|
|
537
|
|
538
|
<li class="frame-info app">
|
539
|
<code>/usr/lib/one/oneflow/oneflow-server.rb</code> in
|
540
|
<code><strong>POST /service/:id/action</strong></code>
|
541
|
</li>
|
542
|
|
543
|
<li class="code app">
|
544
|
|
545
|
<ol start="192"
|
546
|
class="pre-context" id="pre-6"
|
547
|
onclick="toggle(6);">
|
548
|
|
549
|
<li class="pre-context-line"><code>
|
550
|
</code></li>
|
551
|
|
552
|
<li class="pre-context-line"><code> rc = nil
|
553
|
</code></li>
|
554
|
|
555
|
<li class="pre-context-line"><code> service = service_pool.get(params[:id]) { |service|
|
556
|
</code></li>
|
557
|
|
558
|
<li class="pre-context-line"><code> rc = case action['perform']
|
559
|
</code></li>
|
560
|
|
561
|
<li class="pre-context-line"><code> when 'shutdown'
|
562
|
</code></li>
|
563
|
|
564
|
<li class="pre-context-line"><code> service.shutdown
|
565
|
</code></li>
|
566
|
|
567
|
<li class="pre-context-line"><code> when 'recover', 'deploy'
|
568
|
</code></li>
|
569
|
|
570
|
</ol>
|
571
|
|
572
|
|
573
|
<ol start="199" class="context" id="6"
|
574
|
onclick="toggle(6);">
|
575
|
<li class="context-line" id="context-6"><code> service.recover</code></li>
|
576
|
</ol>
|
577
|
|
578
|
|
579
|
<ol start="200" class="post-context"
|
580
|
id="post-6" onclick="toggle(6);">
|
581
|
|
582
|
<li class="post-context-line"><code> when 'chown'
|
583
|
</code></li>
|
584
|
|
585
|
<li class="post-context-line"><code> if opts && opts['owner_id']
|
586
|
</code></li>
|
587
|
|
588
|
<li class="post-context-line"><code> args = Array.new
|
589
|
</code></li>
|
590
|
|
591
|
<li class="post-context-line"><code> args << opts['owner_id'].to_i
|
592
|
</code></li>
|
593
|
|
594
|
<li class="post-context-line"><code> args << (opts['group_id'] || -1).to_i
|
595
|
</code></li>
|
596
|
|
597
|
<li class="post-context-line"><code>
|
598
|
</code></li>
|
599
|
|
600
|
<li class="post-context-line"><code> ret = service.chown(*args)
|
601
|
</code></li>
|
602
|
|
603
|
</ol>
|
604
|
|
605
|
<div class="clear"></div>
|
606
|
</li>
|
607
|
|
608
|
|
609
|
|
610
|
|
611
|
|
612
|
|
613
|
|
614
|
<li class="frame-info app">
|
615
|
<code>/usr/lib/one/oneflow/lib/models/service_pool.rb</code> in
|
616
|
<code><strong>call</strong></code>
|
617
|
</li>
|
618
|
|
619
|
<li class="code app">
|
620
|
|
621
|
<ol start="77"
|
622
|
class="pre-context" id="pre-7"
|
623
|
onclick="toggle(7);">
|
624
|
|
625
|
<li class="pre-context-line"><code> @@mutex_hash.delete_if { |s_id, entry|
|
626
|
</code></li>
|
627
|
|
628
|
<li class="pre-context-line"><code> entry[1] == 0
|
629
|
</code></li>
|
630
|
|
631
|
<li class="pre-context-line"><code> }
|
632
|
</code></li>
|
633
|
|
634
|
<li class="pre-context-line"><code> end
|
635
|
</code></li>
|
636
|
|
637
|
<li class="pre-context-line"><code> }
|
638
|
</code></li>
|
639
|
|
640
|
<li class="pre-context-line"><code>
|
641
|
</code></li>
|
642
|
|
643
|
<li class="pre-context-line"><code> obj_mutex.synchronize {
|
644
|
</code></li>
|
645
|
|
646
|
</ol>
|
647
|
|
648
|
|
649
|
<ol start="84" class="context" id="7"
|
650
|
onclick="toggle(7);">
|
651
|
<li class="context-line" id="context-7"><code> block.call(service)</code></li>
|
652
|
</ol>
|
653
|
|
654
|
|
655
|
<ol start="85" class="post-context"
|
656
|
id="post-7" onclick="toggle(7);">
|
657
|
|
658
|
<li class="post-context-line"><code> }
|
659
|
</code></li>
|
660
|
|
661
|
<li class="post-context-line"><code>
|
662
|
</code></li>
|
663
|
|
664
|
<li class="post-context-line"><code> @@mutex.synchronize {
|
665
|
</code></li>
|
666
|
|
667
|
<li class="post-context-line"><code> entry[1] = entry[1] - 1
|
668
|
</code></li>
|
669
|
|
670
|
<li class="post-context-line"><code> }
|
671
|
</code></li>
|
672
|
|
673
|
<li class="post-context-line"><code> end
|
674
|
</code></li>
|
675
|
|
676
|
<li class="post-context-line"><code>
|
677
|
</code></li>
|
678
|
|
679
|
</ol>
|
680
|
|
681
|
<div class="clear"></div>
|
682
|
</li>
|
683
|
|
684
|
|
685
|
|
686
|
|
687
|
|
688
|
|
689
|
|
690
|
<li class="frame-info app">
|
691
|
<code>/usr/lib/one/oneflow/lib/models/service_pool.rb</code> in
|
692
|
<code><strong>get</strong></code>
|
693
|
</li>
|
694
|
|
695
|
<li class="code app">
|
696
|
|
697
|
<ol start="77"
|
698
|
class="pre-context" id="pre-8"
|
699
|
onclick="toggle(8);">
|
700
|
|
701
|
<li class="pre-context-line"><code> @@mutex_hash.delete_if { |s_id, entry|
|
702
|
</code></li>
|
703
|
|
704
|
<li class="pre-context-line"><code> entry[1] == 0
|
705
|
</code></li>
|
706
|
|
707
|
<li class="pre-context-line"><code> }
|
708
|
</code></li>
|
709
|
|
710
|
<li class="pre-context-line"><code> end
|
711
|
</code></li>
|
712
|
|
713
|
<li class="pre-context-line"><code> }
|
714
|
</code></li>
|
715
|
|
716
|
<li class="pre-context-line"><code>
|
717
|
</code></li>
|
718
|
|
719
|
<li class="pre-context-line"><code> obj_mutex.synchronize {
|
720
|
</code></li>
|
721
|
|
722
|
</ol>
|
723
|
|
724
|
|
725
|
<ol start="84" class="context" id="8"
|
726
|
onclick="toggle(8);">
|
727
|
<li class="context-line" id="context-8"><code> block.call(service)</code></li>
|
728
|
</ol>
|
729
|
|
730
|
|
731
|
<ol start="85" class="post-context"
|
732
|
id="post-8" onclick="toggle(8);">
|
733
|
|
734
|
<li class="post-context-line"><code> }
|
735
|
</code></li>
|
736
|
|
737
|
<li class="post-context-line"><code>
|
738
|
</code></li>
|
739
|
|
740
|
<li class="post-context-line"><code> @@mutex.synchronize {
|
741
|
</code></li>
|
742
|
|
743
|
<li class="post-context-line"><code> entry[1] = entry[1] - 1
|
744
|
</code></li>
|
745
|
|
746
|
<li class="post-context-line"><code> }
|
747
|
</code></li>
|
748
|
|
749
|
<li class="post-context-line"><code> end
|
750
|
</code></li>
|
751
|
|
752
|
<li class="post-context-line"><code>
|
753
|
</code></li>
|
754
|
|
755
|
</ol>
|
756
|
|
757
|
<div class="clear"></div>
|
758
|
</li>
|
759
|
|
760
|
|
761
|
|
762
|
|
763
|
|
764
|
|
765
|
|
766
|
<li class="frame-info app">
|
767
|
<code>/usr/lib/one/oneflow/lib/models/service_pool.rb</code> in
|
768
|
<code><strong>synchronize</strong></code>
|
769
|
</li>
|
770
|
|
771
|
<li class="code app">
|
772
|
|
773
|
<ol start="76"
|
774
|
class="pre-context" id="pre-9"
|
775
|
onclick="toggle(9);">
|
776
|
|
777
|
<li class="pre-context-line"><code> if @@mutex_hash.size > 10000
|
778
|
</code></li>
|
779
|
|
780
|
<li class="pre-context-line"><code> @@mutex_hash.delete_if { |s_id, entry|
|
781
|
</code></li>
|
782
|
|
783
|
<li class="pre-context-line"><code> entry[1] == 0
|
784
|
</code></li>
|
785
|
|
786
|
<li class="pre-context-line"><code> }
|
787
|
</code></li>
|
788
|
|
789
|
<li class="pre-context-line"><code> end
|
790
|
</code></li>
|
791
|
|
792
|
<li class="pre-context-line"><code> }
|
793
|
</code></li>
|
794
|
|
795
|
<li class="pre-context-line"><code>
|
796
|
</code></li>
|
797
|
|
798
|
</ol>
|
799
|
|
800
|
|
801
|
<ol start="83" class="context" id="9"
|
802
|
onclick="toggle(9);">
|
803
|
<li class="context-line" id="context-9"><code> obj_mutex.synchronize {</code></li>
|
804
|
</ol>
|
805
|
|
806
|
|
807
|
<ol start="84" class="post-context"
|
808
|
id="post-9" onclick="toggle(9);">
|
809
|
|
810
|
<li class="post-context-line"><code> block.call(service)
|
811
|
</code></li>
|
812
|
|
813
|
<li class="post-context-line"><code> }
|
814
|
</code></li>
|
815
|
|
816
|
<li class="post-context-line"><code>
|
817
|
</code></li>
|
818
|
|
819
|
<li class="post-context-line"><code> @@mutex.synchronize {
|
820
|
</code></li>
|
821
|
|
822
|
<li class="post-context-line"><code> entry[1] = entry[1] - 1
|
823
|
</code></li>
|
824
|
|
825
|
<li class="post-context-line"><code> }
|
826
|
</code></li>
|
827
|
|
828
|
<li class="post-context-line"><code> end
|
829
|
</code></li>
|
830
|
|
831
|
</ol>
|
832
|
|
833
|
<div class="clear"></div>
|
834
|
</li>
|
835
|
|
836
|
|
837
|
|
838
|
|
839
|
|
840
|
|
841
|
|
842
|
<li class="frame-info app">
|
843
|
<code>/usr/lib/one/oneflow/lib/models/service_pool.rb</code> in
|
844
|
<code><strong>get</strong></code>
|
845
|
</li>
|
846
|
|
847
|
<li class="code app">
|
848
|
|
849
|
<ol start="76"
|
850
|
class="pre-context" id="pre-10"
|
851
|
onclick="toggle(10);">
|
852
|
|
853
|
<li class="pre-context-line"><code> if @@mutex_hash.size > 10000
|
854
|
</code></li>
|
855
|
|
856
|
<li class="pre-context-line"><code> @@mutex_hash.delete_if { |s_id, entry|
|
857
|
</code></li>
|
858
|
|
859
|
<li class="pre-context-line"><code> entry[1] == 0
|
860
|
</code></li>
|
861
|
|
862
|
<li class="pre-context-line"><code> }
|
863
|
</code></li>
|
864
|
|
865
|
<li class="pre-context-line"><code> end
|
866
|
</code></li>
|
867
|
|
868
|
<li class="pre-context-line"><code> }
|
869
|
</code></li>
|
870
|
|
871
|
<li class="pre-context-line"><code>
|
872
|
</code></li>
|
873
|
|
874
|
</ol>
|
875
|
|
876
|
|
877
|
<ol start="83" class="context" id="10"
|
878
|
onclick="toggle(10);">
|
879
|
<li class="context-line" id="context-10"><code> obj_mutex.synchronize {</code></li>
|
880
|
</ol>
|
881
|
|
882
|
|
883
|
<ol start="84" class="post-context"
|
884
|
id="post-10" onclick="toggle(10);">
|
885
|
|
886
|
<li class="post-context-line"><code> block.call(service)
|
887
|
</code></li>
|
888
|
|
889
|
<li class="post-context-line"><code> }
|
890
|
</code></li>
|
891
|
|
892
|
<li class="post-context-line"><code>
|
893
|
</code></li>
|
894
|
|
895
|
<li class="post-context-line"><code> @@mutex.synchronize {
|
896
|
</code></li>
|
897
|
|
898
|
<li class="post-context-line"><code> entry[1] = entry[1] - 1
|
899
|
</code></li>
|
900
|
|
901
|
<li class="post-context-line"><code> }
|
902
|
</code></li>
|
903
|
|
904
|
<li class="post-context-line"><code> end
|
905
|
</code></li>
|
906
|
|
907
|
</ol>
|
908
|
|
909
|
<div class="clear"></div>
|
910
|
</li>
|
911
|
|
912
|
|
913
|
|
914
|
|
915
|
|
916
|
|
917
|
|
918
|
<li class="frame-info app">
|
919
|
<code>/usr/lib/one/oneflow/oneflow-server.rb</code> in
|
920
|
<code><strong>POST /service/:id/action</strong></code>
|
921
|
</li>
|
922
|
|
923
|
<li class="code app">
|
924
|
|
925
|
<ol start="187"
|
926
|
class="pre-context" id="pre-11"
|
927
|
onclick="toggle(11);">
|
928
|
|
929
|
<li class="pre-context-line"><code>
|
930
|
</code></li>
|
931
|
|
932
|
<li class="pre-context-line"><code>post '/service/:id/action' do
|
933
|
</code></li>
|
934
|
|
935
|
<li class="pre-context-line"><code> service_pool = OpenNebula::ServicePool.new(@client)
|
936
|
</code></li>
|
937
|
|
938
|
<li class="pre-context-line"><code> action = JSON.parse(request.body.read)['action']
|
939
|
</code></li>
|
940
|
|
941
|
<li class="pre-context-line"><code> opts = action['params']
|
942
|
</code></li>
|
943
|
|
944
|
<li class="pre-context-line"><code>
|
945
|
</code></li>
|
946
|
|
947
|
<li class="pre-context-line"><code> rc = nil
|
948
|
</code></li>
|
949
|
|
950
|
</ol>
|
951
|
|
952
|
|
953
|
<ol start="194" class="context" id="11"
|
954
|
onclick="toggle(11);">
|
955
|
<li class="context-line" id="context-11"><code> service = service_pool.get(params[:id]) { |service|</code></li>
|
956
|
</ol>
|
957
|
|
958
|
|
959
|
<ol start="195" class="post-context"
|
960
|
id="post-11" onclick="toggle(11);">
|
961
|
|
962
|
<li class="post-context-line"><code> rc = case action['perform']
|
963
|
</code></li>
|
964
|
|
965
|
<li class="post-context-line"><code> when 'shutdown'
|
966
|
</code></li>
|
967
|
|
968
|
<li class="post-context-line"><code> service.shutdown
|
969
|
</code></li>
|
970
|
|
971
|
<li class="post-context-line"><code> when 'recover', 'deploy'
|
972
|
</code></li>
|
973
|
|
974
|
<li class="post-context-line"><code> service.recover
|
975
|
</code></li>
|
976
|
|
977
|
<li class="post-context-line"><code> when 'chown'
|
978
|
</code></li>
|
979
|
|
980
|
<li class="post-context-line"><code> if opts && opts['owner_id']
|
981
|
</code></li>
|
982
|
|
983
|
</ol>
|
984
|
|
985
|
<div class="clear"></div>
|
986
|
</li>
|
987
|
|
988
|
|
989
|
|
990
|
|
991
|
|
992
|
|
993
|
|
994
|
<li class="frame-info framework">
|
995
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
996
|
<code><strong>call</strong></code>
|
997
|
</li>
|
998
|
|
999
|
<li class="code framework">
|
1000
|
|
1001
|
<ol start="1533"
|
1002
|
class="pre-context" id="pre-12"
|
1003
|
onclick="toggle(12);">
|
1004
|
|
1005
|
<li class="pre-context-line"><code> options.each_pair { |option, args| send(option, *args) }
|
1006
|
</code></li>
|
1007
|
|
1008
|
<li class="pre-context-line"><code> method_name = "#{verb} #{path}"
|
1009
|
</code></li>
|
1010
|
|
1011
|
<li class="pre-context-line"><code> unbound_method = generate_method(method_name, &block)
|
1012
|
</code></li>
|
1013
|
|
1014
|
<li class="pre-context-line"><code> pattern, keys = compile path
|
1015
|
</code></li>
|
1016
|
|
1017
|
<li class="pre-context-line"><code> conditions, @conditions = @conditions, []
|
1018
|
</code></li>
|
1019
|
|
1020
|
<li class="pre-context-line"><code>
|
1021
|
</code></li>
|
1022
|
|
1023
|
<li class="pre-context-line"><code> wrapper = block.arity != 0 ?
|
1024
|
</code></li>
|
1025
|
|
1026
|
</ol>
|
1027
|
|
1028
|
|
1029
|
<ol start="1540" class="context" id="12"
|
1030
|
onclick="toggle(12);">
|
1031
|
<li class="context-line" id="context-12"><code> proc { |a,p| unbound_method.bind(a).call(*p) } :</code></li>
|
1032
|
</ol>
|
1033
|
|
1034
|
|
1035
|
<ol start="1541" class="post-context"
|
1036
|
id="post-12" onclick="toggle(12);">
|
1037
|
|
1038
|
<li class="post-context-line"><code> proc { |a,p| unbound_method.bind(a).call }
|
1039
|
</code></li>
|
1040
|
|
1041
|
<li class="post-context-line"><code> wrapper.instance_variable_set(:@route_name, method_name)
|
1042
|
</code></li>
|
1043
|
|
1044
|
<li class="post-context-line"><code>
|
1045
|
</code></li>
|
1046
|
|
1047
|
<li class="post-context-line"><code> [ pattern, keys, conditions, wrapper ]
|
1048
|
</code></li>
|
1049
|
|
1050
|
<li class="post-context-line"><code> end
|
1051
|
</code></li>
|
1052
|
|
1053
|
<li class="post-context-line"><code>
|
1054
|
</code></li>
|
1055
|
|
1056
|
<li class="post-context-line"><code> def compile(path)
|
1057
|
</code></li>
|
1058
|
|
1059
|
</ol>
|
1060
|
|
1061
|
<div class="clear"></div>
|
1062
|
</li>
|
1063
|
|
1064
|
|
1065
|
|
1066
|
|
1067
|
|
1068
|
|
1069
|
|
1070
|
<li class="frame-info framework">
|
1071
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
1072
|
<code><strong>compile!</strong></code>
|
1073
|
</li>
|
1074
|
|
1075
|
<li class="code framework">
|
1076
|
|
1077
|
<ol start="1533"
|
1078
|
class="pre-context" id="pre-13"
|
1079
|
onclick="toggle(13);">
|
1080
|
|
1081
|
<li class="pre-context-line"><code> options.each_pair { |option, args| send(option, *args) }
|
1082
|
</code></li>
|
1083
|
|
1084
|
<li class="pre-context-line"><code> method_name = "#{verb} #{path}"
|
1085
|
</code></li>
|
1086
|
|
1087
|
<li class="pre-context-line"><code> unbound_method = generate_method(method_name, &block)
|
1088
|
</code></li>
|
1089
|
|
1090
|
<li class="pre-context-line"><code> pattern, keys = compile path
|
1091
|
</code></li>
|
1092
|
|
1093
|
<li class="pre-context-line"><code> conditions, @conditions = @conditions, []
|
1094
|
</code></li>
|
1095
|
|
1096
|
<li class="pre-context-line"><code>
|
1097
|
</code></li>
|
1098
|
|
1099
|
<li class="pre-context-line"><code> wrapper = block.arity != 0 ?
|
1100
|
</code></li>
|
1101
|
|
1102
|
</ol>
|
1103
|
|
1104
|
|
1105
|
<ol start="1540" class="context" id="13"
|
1106
|
onclick="toggle(13);">
|
1107
|
<li class="context-line" id="context-13"><code> proc { |a,p| unbound_method.bind(a).call(*p) } :</code></li>
|
1108
|
</ol>
|
1109
|
|
1110
|
|
1111
|
<ol start="1541" class="post-context"
|
1112
|
id="post-13" onclick="toggle(13);">
|
1113
|
|
1114
|
<li class="post-context-line"><code> proc { |a,p| unbound_method.bind(a).call }
|
1115
|
</code></li>
|
1116
|
|
1117
|
<li class="post-context-line"><code> wrapper.instance_variable_set(:@route_name, method_name)
|
1118
|
</code></li>
|
1119
|
|
1120
|
<li class="post-context-line"><code>
|
1121
|
</code></li>
|
1122
|
|
1123
|
<li class="post-context-line"><code> [ pattern, keys, conditions, wrapper ]
|
1124
|
</code></li>
|
1125
|
|
1126
|
<li class="post-context-line"><code> end
|
1127
|
</code></li>
|
1128
|
|
1129
|
<li class="post-context-line"><code>
|
1130
|
</code></li>
|
1131
|
|
1132
|
<li class="post-context-line"><code> def compile(path)
|
1133
|
</code></li>
|
1134
|
|
1135
|
</ol>
|
1136
|
|
1137
|
<div class="clear"></div>
|
1138
|
</li>
|
1139
|
|
1140
|
|
1141
|
|
1142
|
|
1143
|
|
1144
|
|
1145
|
|
1146
|
<li class="frame-info framework">
|
1147
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
1148
|
<code><strong>[]</strong></code>
|
1149
|
</li>
|
1150
|
|
1151
|
<li class="code framework">
|
1152
|
|
1153
|
<ol start="943"
|
1154
|
class="pre-context" id="pre-14"
|
1155
|
onclick="toggle(14);">
|
1156
|
|
1157
|
<li class="pre-context-line"><code>
|
1158
|
</code></li>
|
1159
|
|
1160
|
<li class="pre-context-line"><code> # Run routes defined on the class and all superclasses.
|
1161
|
</code></li>
|
1162
|
|
1163
|
<li class="pre-context-line"><code> def route!(base = settings, pass_block = nil)
|
1164
|
</code></li>
|
1165
|
|
1166
|
<li class="pre-context-line"><code> if routes = base.routes[@request.request_method]
|
1167
|
</code></li>
|
1168
|
|
1169
|
<li class="pre-context-line"><code> routes.each do |pattern, keys, conditions, block|
|
1170
|
</code></li>
|
1171
|
|
1172
|
<li class="pre-context-line"><code> pass_block = process_route(pattern, keys, conditions) do |*args|
|
1173
|
</code></li>
|
1174
|
|
1175
|
<li class="pre-context-line"><code> env['sinatra.route'] = block.instance_variable_get(:@route_name)
|
1176
|
</code></li>
|
1177
|
|
1178
|
</ol>
|
1179
|
|
1180
|
|
1181
|
<ol start="950" class="context" id="14"
|
1182
|
onclick="toggle(14);">
|
1183
|
<li class="context-line" id="context-14"><code> route_eval { block[*args] }</code></li>
|
1184
|
</ol>
|
1185
|
|
1186
|
|
1187
|
<ol start="951" class="post-context"
|
1188
|
id="post-14" onclick="toggle(14);">
|
1189
|
|
1190
|
<li class="post-context-line"><code> end
|
1191
|
</code></li>
|
1192
|
|
1193
|
<li class="post-context-line"><code> end
|
1194
|
</code></li>
|
1195
|
|
1196
|
<li class="post-context-line"><code> end
|
1197
|
</code></li>
|
1198
|
|
1199
|
<li class="post-context-line"><code>
|
1200
|
</code></li>
|
1201
|
|
1202
|
<li class="post-context-line"><code> # Run routes defined in superclass.
|
1203
|
</code></li>
|
1204
|
|
1205
|
<li class="post-context-line"><code> if base.superclass.respond_to?(:routes)
|
1206
|
</code></li>
|
1207
|
|
1208
|
<li class="post-context-line"><code> return route!(base.superclass, pass_block)
|
1209
|
</code></li>
|
1210
|
|
1211
|
</ol>
|
1212
|
|
1213
|
<div class="clear"></div>
|
1214
|
</li>
|
1215
|
|
1216
|
|
1217
|
|
1218
|
|
1219
|
|
1220
|
|
1221
|
|
1222
|
<li class="frame-info framework">
|
1223
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
1224
|
<code><strong>route!</strong></code>
|
1225
|
</li>
|
1226
|
|
1227
|
<li class="code framework">
|
1228
|
|
1229
|
<ol start="943"
|
1230
|
class="pre-context" id="pre-15"
|
1231
|
onclick="toggle(15);">
|
1232
|
|
1233
|
<li class="pre-context-line"><code>
|
1234
|
</code></li>
|
1235
|
|
1236
|
<li class="pre-context-line"><code> # Run routes defined on the class and all superclasses.
|
1237
|
</code></li>
|
1238
|
|
1239
|
<li class="pre-context-line"><code> def route!(base = settings, pass_block = nil)
|
1240
|
</code></li>
|
1241
|
|
1242
|
<li class="pre-context-line"><code> if routes = base.routes[@request.request_method]
|
1243
|
</code></li>
|
1244
|
|
1245
|
<li class="pre-context-line"><code> routes.each do |pattern, keys, conditions, block|
|
1246
|
</code></li>
|
1247
|
|
1248
|
<li class="pre-context-line"><code> pass_block = process_route(pattern, keys, conditions) do |*args|
|
1249
|
</code></li>
|
1250
|
|
1251
|
<li class="pre-context-line"><code> env['sinatra.route'] = block.instance_variable_get(:@route_name)
|
1252
|
</code></li>
|
1253
|
|
1254
|
</ol>
|
1255
|
|
1256
|
|
1257
|
<ol start="950" class="context" id="15"
|
1258
|
onclick="toggle(15);">
|
1259
|
<li class="context-line" id="context-15"><code> route_eval { block[*args] }</code></li>
|
1260
|
</ol>
|
1261
|
|
1262
|
|
1263
|
<ol start="951" class="post-context"
|
1264
|
id="post-15" onclick="toggle(15);">
|
1265
|
|
1266
|
<li class="post-context-line"><code> end
|
1267
|
</code></li>
|
1268
|
|
1269
|
<li class="post-context-line"><code> end
|
1270
|
</code></li>
|
1271
|
|
1272
|
<li class="post-context-line"><code> end
|
1273
|
</code></li>
|
1274
|
|
1275
|
<li class="post-context-line"><code>
|
1276
|
</code></li>
|
1277
|
|
1278
|
<li class="post-context-line"><code> # Run routes defined in superclass.
|
1279
|
</code></li>
|
1280
|
|
1281
|
<li class="post-context-line"><code> if base.superclass.respond_to?(:routes)
|
1282
|
</code></li>
|
1283
|
|
1284
|
<li class="post-context-line"><code> return route!(base.superclass, pass_block)
|
1285
|
</code></li>
|
1286
|
|
1287
|
</ol>
|
1288
|
|
1289
|
<div class="clear"></div>
|
1290
|
</li>
|
1291
|
|
1292
|
|
1293
|
|
1294
|
|
1295
|
|
1296
|
|
1297
|
|
1298
|
<li class="frame-info framework">
|
1299
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
1300
|
<code><strong>route_eval</strong></code>
|
1301
|
</li>
|
1302
|
|
1303
|
<li class="code framework">
|
1304
|
|
1305
|
<ol start="959"
|
1306
|
class="pre-context" id="pre-16"
|
1307
|
onclick="toggle(16);">
|
1308
|
|
1309
|
<li class="pre-context-line"><code>
|
1310
|
</code></li>
|
1311
|
|
1312
|
<li class="pre-context-line"><code> route_eval(&pass_block) if pass_block
|
1313
|
</code></li>
|
1314
|
|
1315
|
<li class="pre-context-line"><code> route_missing
|
1316
|
</code></li>
|
1317
|
|
1318
|
<li class="pre-context-line"><code> end
|
1319
|
</code></li>
|
1320
|
|
1321
|
<li class="pre-context-line"><code>
|
1322
|
</code></li>
|
1323
|
|
1324
|
<li class="pre-context-line"><code> # Run a route block and throw :halt with the result.
|
1325
|
</code></li>
|
1326
|
|
1327
|
<li class="pre-context-line"><code> def route_eval
|
1328
|
</code></li>
|
1329
|
|
1330
|
</ol>
|
1331
|
|
1332
|
|
1333
|
<ol start="966" class="context" id="16"
|
1334
|
onclick="toggle(16);">
|
1335
|
<li class="context-line" id="context-16"><code> throw :halt, yield</code></li>
|
1336
|
</ol>
|
1337
|
|
1338
|
|
1339
|
<ol start="967" class="post-context"
|
1340
|
id="post-16" onclick="toggle(16);">
|
1341
|
|
1342
|
<li class="post-context-line"><code> end
|
1343
|
</code></li>
|
1344
|
|
1345
|
<li class="post-context-line"><code>
|
1346
|
</code></li>
|
1347
|
|
1348
|
<li class="post-context-line"><code> # If the current request matches pattern and conditions, fill params
|
1349
|
</code></li>
|
1350
|
|
1351
|
<li class="post-context-line"><code> # with keys and call the given block.
|
1352
|
</code></li>
|
1353
|
|
1354
|
<li class="post-context-line"><code> # Revert params afterwards.
|
1355
|
</code></li>
|
1356
|
|
1357
|
<li class="post-context-line"><code> #
|
1358
|
</code></li>
|
1359
|
|
1360
|
<li class="post-context-line"><code> # Returns pass block.
|
1361
|
</code></li>
|
1362
|
|
1363
|
</ol>
|
1364
|
|
1365
|
<div class="clear"></div>
|
1366
|
</li>
|
1367
|
|
1368
|
|
1369
|
|
1370
|
|
1371
|
|
1372
|
|
1373
|
|
1374
|
<li class="frame-info framework">
|
1375
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
1376
|
<code><strong>route!</strong></code>
|
1377
|
</li>
|
1378
|
|
1379
|
<li class="code framework">
|
1380
|
|
1381
|
<ol start="943"
|
1382
|
class="pre-context" id="pre-17"
|
1383
|
onclick="toggle(17);">
|
1384
|
|
1385
|
<li class="pre-context-line"><code>
|
1386
|
</code></li>
|
1387
|
|
1388
|
<li class="pre-context-line"><code> # Run routes defined on the class and all superclasses.
|
1389
|
</code></li>
|
1390
|
|
1391
|
<li class="pre-context-line"><code> def route!(base = settings, pass_block = nil)
|
1392
|
</code></li>
|
1393
|
|
1394
|
<li class="pre-context-line"><code> if routes = base.routes[@request.request_method]
|
1395
|
</code></li>
|
1396
|
|
1397
|
<li class="pre-context-line"><code> routes.each do |pattern, keys, conditions, block|
|
1398
|
</code></li>
|
1399
|
|
1400
|
<li class="pre-context-line"><code> pass_block = process_route(pattern, keys, conditions) do |*args|
|
1401
|
</code></li>
|
1402
|
|
1403
|
<li class="pre-context-line"><code> env['sinatra.route'] = block.instance_variable_get(:@route_name)
|
1404
|
</code></li>
|
1405
|
|
1406
|
</ol>
|
1407
|
|
1408
|
|
1409
|
<ol start="950" class="context" id="17"
|
1410
|
onclick="toggle(17);">
|
1411
|
<li class="context-line" id="context-17"><code> route_eval { block[*args] }</code></li>
|
1412
|
</ol>
|
1413
|
|
1414
|
|
1415
|
<ol start="951" class="post-context"
|
1416
|
id="post-17" onclick="toggle(17);">
|
1417
|
|
1418
|
<li class="post-context-line"><code> end
|
1419
|
</code></li>
|
1420
|
|
1421
|
<li class="post-context-line"><code> end
|
1422
|
</code></li>
|
1423
|
|
1424
|
<li class="post-context-line"><code> end
|
1425
|
</code></li>
|
1426
|
|
1427
|
<li class="post-context-line"><code>
|
1428
|
</code></li>
|
1429
|
|
1430
|
<li class="post-context-line"><code> # Run routes defined in superclass.
|
1431
|
</code></li>
|
1432
|
|
1433
|
<li class="post-context-line"><code> if base.superclass.respond_to?(:routes)
|
1434
|
</code></li>
|
1435
|
|
1436
|
<li class="post-context-line"><code> return route!(base.superclass, pass_block)
|
1437
|
</code></li>
|
1438
|
|
1439
|
</ol>
|
1440
|
|
1441
|
<div class="clear"></div>
|
1442
|
</li>
|
1443
|
|
1444
|
|
1445
|
|
1446
|
|
1447
|
|
1448
|
|
1449
|
|
1450
|
<li class="frame-info framework">
|
1451
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
1452
|
<code><strong>process_route</strong></code>
|
1453
|
</li>
|
1454
|
|
1455
|
<li class="code framework">
|
1456
|
|
1457
|
<ol start="980"
|
1458
|
class="pre-context" id="pre-18"
|
1459
|
onclick="toggle(18);">
|
1460
|
|
1461
|
<li class="pre-context-line"><code> if values.any?
|
1462
|
</code></li>
|
1463
|
|
1464
|
<li class="pre-context-line"><code> original, @params = params, params.merge('splat' => [], 'captures' => values)
|
1465
|
</code></li>
|
1466
|
|
1467
|
<li class="pre-context-line"><code> keys.zip(values) { |k,v| Array === @params[k] ? @params[k] << v : @params[k] = v if v }
|
1468
|
</code></li>
|
1469
|
|
1470
|
<li class="pre-context-line"><code> end
|
1471
|
</code></li>
|
1472
|
|
1473
|
<li class="pre-context-line"><code>
|
1474
|
</code></li>
|
1475
|
|
1476
|
<li class="pre-context-line"><code> catch(:pass) do
|
1477
|
</code></li>
|
1478
|
|
1479
|
<li class="pre-context-line"><code> conditions.each { |c| throw :pass if c.bind(self).call == false }
|
1480
|
</code></li>
|
1481
|
|
1482
|
</ol>
|
1483
|
|
1484
|
|
1485
|
<ol start="987" class="context" id="18"
|
1486
|
onclick="toggle(18);">
|
1487
|
<li class="context-line" id="context-18"><code> block ? block[self, values] : yield(self, values)</code></li>
|
1488
|
</ol>
|
1489
|
|
1490
|
|
1491
|
<ol start="988" class="post-context"
|
1492
|
id="post-18" onclick="toggle(18);">
|
1493
|
|
1494
|
<li class="post-context-line"><code> end
|
1495
|
</code></li>
|
1496
|
|
1497
|
<li class="post-context-line"><code> ensure
|
1498
|
</code></li>
|
1499
|
|
1500
|
<li class="post-context-line"><code> @params = original if original
|
1501
|
</code></li>
|
1502
|
|
1503
|
<li class="post-context-line"><code> end
|
1504
|
</code></li>
|
1505
|
|
1506
|
<li class="post-context-line"><code>
|
1507
|
</code></li>
|
1508
|
|
1509
|
<li class="post-context-line"><code> # No matching route was found or all routes passed. The default
|
1510
|
</code></li>
|
1511
|
|
1512
|
<li class="post-context-line"><code> # implementation is to forward the request downstream when running
|
1513
|
</code></li>
|
1514
|
|
1515
|
</ol>
|
1516
|
|
1517
|
<div class="clear"></div>
|
1518
|
</li>
|
1519
|
|
1520
|
|
1521
|
|
1522
|
|
1523
|
|
1524
|
|
1525
|
|
1526
|
<li class="frame-info framework">
|
1527
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
1528
|
<code><strong>catch</strong></code>
|
1529
|
</li>
|
1530
|
|
1531
|
<li class="code framework">
|
1532
|
|
1533
|
<ol start="978"
|
1534
|
class="pre-context" id="pre-19"
|
1535
|
onclick="toggle(19);">
|
1536
|
|
1537
|
<li class="pre-context-line"><code> values += match.captures.to_a.map { |v| force_encoding URI.unescape(v) if v }
|
1538
|
</code></li>
|
1539
|
|
1540
|
<li class="pre-context-line"><code>
|
1541
|
</code></li>
|
1542
|
|
1543
|
<li class="pre-context-line"><code> if values.any?
|
1544
|
</code></li>
|
1545
|
|
1546
|
<li class="pre-context-line"><code> original, @params = params, params.merge('splat' => [], 'captures' => values)
|
1547
|
</code></li>
|
1548
|
|
1549
|
<li class="pre-context-line"><code> keys.zip(values) { |k,v| Array === @params[k] ? @params[k] << v : @params[k] = v if v }
|
1550
|
</code></li>
|
1551
|
|
1552
|
<li class="pre-context-line"><code> end
|
1553
|
</code></li>
|
1554
|
|
1555
|
<li class="pre-context-line"><code>
|
1556
|
</code></li>
|
1557
|
|
1558
|
</ol>
|
1559
|
|
1560
|
|
1561
|
<ol start="985" class="context" id="19"
|
1562
|
onclick="toggle(19);">
|
1563
|
<li class="context-line" id="context-19"><code> catch(:pass) do</code></li>
|
1564
|
</ol>
|
1565
|
|
1566
|
|
1567
|
<ol start="986" class="post-context"
|
1568
|
id="post-19" onclick="toggle(19);">
|
1569
|
|
1570
|
<li class="post-context-line"><code> conditions.each { |c| throw :pass if c.bind(self).call == false }
|
1571
|
</code></li>
|
1572
|
|
1573
|
<li class="post-context-line"><code> block ? block[self, values] : yield(self, values)
|
1574
|
</code></li>
|
1575
|
|
1576
|
<li class="post-context-line"><code> end
|
1577
|
</code></li>
|
1578
|
|
1579
|
<li class="post-context-line"><code> ensure
|
1580
|
</code></li>
|
1581
|
|
1582
|
<li class="post-context-line"><code> @params = original if original
|
1583
|
</code></li>
|
1584
|
|
1585
|
<li class="post-context-line"><code> end
|
1586
|
</code></li>
|
1587
|
|
1588
|
<li class="post-context-line"><code>
|
1589
|
</code></li>
|
1590
|
|
1591
|
</ol>
|
1592
|
|
1593
|
<div class="clear"></div>
|
1594
|
</li>
|
1595
|
|
1596
|
|
1597
|
|
1598
|
|
1599
|
|
1600
|
|
1601
|
|
1602
|
<li class="frame-info framework">
|
1603
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
1604
|
<code><strong>process_route</strong></code>
|
1605
|
</li>
|
1606
|
|
1607
|
<li class="code framework">
|
1608
|
|
1609
|
<ol start="978"
|
1610
|
class="pre-context" id="pre-20"
|
1611
|
onclick="toggle(20);">
|
1612
|
|
1613
|
<li class="pre-context-line"><code> values += match.captures.to_a.map { |v| force_encoding URI.unescape(v) if v }
|
1614
|
</code></li>
|
1615
|
|
1616
|
<li class="pre-context-line"><code>
|
1617
|
</code></li>
|
1618
|
|
1619
|
<li class="pre-context-line"><code> if values.any?
|
1620
|
</code></li>
|
1621
|
|
1622
|
<li class="pre-context-line"><code> original, @params = params, params.merge('splat' => [], 'captures' => values)
|
1623
|
</code></li>
|
1624
|
|
1625
|
<li class="pre-context-line"><code> keys.zip(values) { |k,v| Array === @params[k] ? @params[k] << v : @params[k] = v if v }
|
1626
|
</code></li>
|
1627
|
|
1628
|
<li class="pre-context-line"><code> end
|
1629
|
</code></li>
|
1630
|
|
1631
|
<li class="pre-context-line"><code>
|
1632
|
</code></li>
|
1633
|
|
1634
|
</ol>
|
1635
|
|
1636
|
|
1637
|
<ol start="985" class="context" id="20"
|
1638
|
onclick="toggle(20);">
|
1639
|
<li class="context-line" id="context-20"><code> catch(:pass) do</code></li>
|
1640
|
</ol>
|
1641
|
|
1642
|
|
1643
|
<ol start="986" class="post-context"
|
1644
|
id="post-20" onclick="toggle(20);">
|
1645
|
|
1646
|
<li class="post-context-line"><code> conditions.each { |c| throw :pass if c.bind(self).call == false }
|
1647
|
</code></li>
|
1648
|
|
1649
|
<li class="post-context-line"><code> block ? block[self, values] : yield(self, values)
|
1650
|
</code></li>
|
1651
|
|
1652
|
<li class="post-context-line"><code> end
|
1653
|
</code></li>
|
1654
|
|
1655
|
<li class="post-context-line"><code> ensure
|
1656
|
</code></li>
|
1657
|
|
1658
|
<li class="post-context-line"><code> @params = original if original
|
1659
|
</code></li>
|
1660
|
|
1661
|
<li class="post-context-line"><code> end
|
1662
|
</code></li>
|
1663
|
|
1664
|
<li class="post-context-line"><code>
|
1665
|
</code></li>
|
1666
|
|
1667
|
</ol>
|
1668
|
|
1669
|
<div class="clear"></div>
|
1670
|
</li>
|
1671
|
|
1672
|
|
1673
|
|
1674
|
|
1675
|
|
1676
|
|
1677
|
|
1678
|
<li class="frame-info framework">
|
1679
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
1680
|
<code><strong>route!</strong></code>
|
1681
|
</li>
|
1682
|
|
1683
|
<li class="code framework">
|
1684
|
|
1685
|
<ol start="941"
|
1686
|
class="pre-context" id="pre-21"
|
1687
|
onclick="toggle(21);">
|
1688
|
|
1689
|
<li class="pre-context-line"><code> base.filters[type].each { |args| process_route(*args) }
|
1690
|
</code></li>
|
1691
|
|
1692
|
<li class="pre-context-line"><code> end
|
1693
|
</code></li>
|
1694
|
|
1695
|
<li class="pre-context-line"><code>
|
1696
|
</code></li>
|
1697
|
|
1698
|
<li class="pre-context-line"><code> # Run routes defined on the class and all superclasses.
|
1699
|
</code></li>
|
1700
|
|
1701
|
<li class="pre-context-line"><code> def route!(base = settings, pass_block = nil)
|
1702
|
</code></li>
|
1703
|
|
1704
|
<li class="pre-context-line"><code> if routes = base.routes[@request.request_method]
|
1705
|
</code></li>
|
1706
|
|
1707
|
<li class="pre-context-line"><code> routes.each do |pattern, keys, conditions, block|
|
1708
|
</code></li>
|
1709
|
|
1710
|
</ol>
|
1711
|
|
1712
|
|
1713
|
<ol start="948" class="context" id="21"
|
1714
|
onclick="toggle(21);">
|
1715
|
<li class="context-line" id="context-21"><code> pass_block = process_route(pattern, keys, conditions) do |*args|</code></li>
|
1716
|
</ol>
|
1717
|
|
1718
|
|
1719
|
<ol start="949" class="post-context"
|
1720
|
id="post-21" onclick="toggle(21);">
|
1721
|
|
1722
|
<li class="post-context-line"><code> env['sinatra.route'] = block.instance_variable_get(:@route_name)
|
1723
|
</code></li>
|
1724
|
|
1725
|
<li class="post-context-line"><code> route_eval { block[*args] }
|
1726
|
</code></li>
|
1727
|
|
1728
|
<li class="post-context-line"><code> end
|
1729
|
</code></li>
|
1730
|
|
1731
|
<li class="post-context-line"><code> end
|
1732
|
</code></li>
|
1733
|
|
1734
|
<li class="post-context-line"><code> end
|
1735
|
</code></li>
|
1736
|
|
1737
|
<li class="post-context-line"><code>
|
1738
|
</code></li>
|
1739
|
|
1740
|
<li class="post-context-line"><code> # Run routes defined in superclass.
|
1741
|
</code></li>
|
1742
|
|
1743
|
</ol>
|
1744
|
|
1745
|
<div class="clear"></div>
|
1746
|
</li>
|
1747
|
|
1748
|
|
1749
|
|
1750
|
|
1751
|
|
1752
|
|
1753
|
|
1754
|
<li class="frame-info framework">
|
1755
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
1756
|
<code><strong>each</strong></code>
|
1757
|
</li>
|
1758
|
|
1759
|
<li class="code framework">
|
1760
|
|
1761
|
<ol start="940"
|
1762
|
class="pre-context" id="pre-22"
|
1763
|
onclick="toggle(22);">
|
1764
|
|
1765
|
<li class="pre-context-line"><code> filter! type, base.superclass if base.superclass.respond_to?(:filters)
|
1766
|
</code></li>
|
1767
|
|
1768
|
<li class="pre-context-line"><code> base.filters[type].each { |args| process_route(*args) }
|
1769
|
</code></li>
|
1770
|
|
1771
|
<li class="pre-context-line"><code> end
|
1772
|
</code></li>
|
1773
|
|
1774
|
<li class="pre-context-line"><code>
|
1775
|
</code></li>
|
1776
|
|
1777
|
<li class="pre-context-line"><code> # Run routes defined on the class and all superclasses.
|
1778
|
</code></li>
|
1779
|
|
1780
|
<li class="pre-context-line"><code> def route!(base = settings, pass_block = nil)
|
1781
|
</code></li>
|
1782
|
|
1783
|
<li class="pre-context-line"><code> if routes = base.routes[@request.request_method]
|
1784
|
</code></li>
|
1785
|
|
1786
|
</ol>
|
1787
|
|
1788
|
|
1789
|
<ol start="947" class="context" id="22"
|
1790
|
onclick="toggle(22);">
|
1791
|
<li class="context-line" id="context-22"><code> routes.each do |pattern, keys, conditions, block|</code></li>
|
1792
|
</ol>
|
1793
|
|
1794
|
|
1795
|
<ol start="948" class="post-context"
|
1796
|
id="post-22" onclick="toggle(22);">
|
1797
|
|
1798
|
<li class="post-context-line"><code> pass_block = process_route(pattern, keys, conditions) do |*args|
|
1799
|
</code></li>
|
1800
|
|
1801
|
<li class="post-context-line"><code> env['sinatra.route'] = block.instance_variable_get(:@route_name)
|
1802
|
</code></li>
|
1803
|
|
1804
|
<li class="post-context-line"><code> route_eval { block[*args] }
|
1805
|
</code></li>
|
1806
|
|
1807
|
<li class="post-context-line"><code> end
|
1808
|
</code></li>
|
1809
|
|
1810
|
<li class="post-context-line"><code> end
|
1811
|
</code></li>
|
1812
|
|
1813
|
<li class="post-context-line"><code> end
|
1814
|
</code></li>
|
1815
|
|
1816
|
<li class="post-context-line"><code>
|
1817
|
</code></li>
|
1818
|
|
1819
|
</ol>
|
1820
|
|
1821
|
<div class="clear"></div>
|
1822
|
</li>
|
1823
|
|
1824
|
|
1825
|
|
1826
|
|
1827
|
|
1828
|
|
1829
|
|
1830
|
<li class="frame-info framework">
|
1831
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
1832
|
<code><strong>route!</strong></code>
|
1833
|
</li>
|
1834
|
|
1835
|
<li class="code framework">
|
1836
|
|
1837
|
<ol start="940"
|
1838
|
class="pre-context" id="pre-23"
|
1839
|
onclick="toggle(23);">
|
1840
|
|
1841
|
<li class="pre-context-line"><code> filter! type, base.superclass if base.superclass.respond_to?(:filters)
|
1842
|
</code></li>
|
1843
|
|
1844
|
<li class="pre-context-line"><code> base.filters[type].each { |args| process_route(*args) }
|
1845
|
</code></li>
|
1846
|
|
1847
|
<li class="pre-context-line"><code> end
|
1848
|
</code></li>
|
1849
|
|
1850
|
<li class="pre-context-line"><code>
|
1851
|
</code></li>
|
1852
|
|
1853
|
<li class="pre-context-line"><code> # Run routes defined on the class and all superclasses.
|
1854
|
</code></li>
|
1855
|
|
1856
|
<li class="pre-context-line"><code> def route!(base = settings, pass_block = nil)
|
1857
|
</code></li>
|
1858
|
|
1859
|
<li class="pre-context-line"><code> if routes = base.routes[@request.request_method]
|
1860
|
</code></li>
|
1861
|
|
1862
|
</ol>
|
1863
|
|
1864
|
|
1865
|
<ol start="947" class="context" id="23"
|
1866
|
onclick="toggle(23);">
|
1867
|
<li class="context-line" id="context-23"><code> routes.each do |pattern, keys, conditions, block|</code></li>
|
1868
|
</ol>
|
1869
|
|
1870
|
|
1871
|
<ol start="948" class="post-context"
|
1872
|
id="post-23" onclick="toggle(23);">
|
1873
|
|
1874
|
<li class="post-context-line"><code> pass_block = process_route(pattern, keys, conditions) do |*args|
|
1875
|
</code></li>
|
1876
|
|
1877
|
<li class="post-context-line"><code> env['sinatra.route'] = block.instance_variable_get(:@route_name)
|
1878
|
</code></li>
|
1879
|
|
1880
|
<li class="post-context-line"><code> route_eval { block[*args] }
|
1881
|
</code></li>
|
1882
|
|
1883
|
<li class="post-context-line"><code> end
|
1884
|
</code></li>
|
1885
|
|
1886
|
<li class="post-context-line"><code> end
|
1887
|
</code></li>
|
1888
|
|
1889
|
<li class="post-context-line"><code> end
|
1890
|
</code></li>
|
1891
|
|
1892
|
<li class="post-context-line"><code>
|
1893
|
</code></li>
|
1894
|
|
1895
|
</ol>
|
1896
|
|
1897
|
<div class="clear"></div>
|
1898
|
</li>
|
1899
|
|
1900
|
|
1901
|
|
1902
|
|
1903
|
|
1904
|
|
1905
|
|
1906
|
<li class="frame-info framework">
|
1907
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
1908
|
<code><strong>dispatch!</strong></code>
|
1909
|
</li>
|
1910
|
|
1911
|
<li class="code framework">
|
1912
|
|
1913
|
<ol start="1052"
|
1914
|
class="pre-context" id="pre-24"
|
1915
|
onclick="toggle(24);">
|
1916
|
|
1917
|
<li class="pre-context-line"><code> end
|
1918
|
</code></li>
|
1919
|
|
1920
|
<li class="pre-context-line"><code>
|
1921
|
</code></li>
|
1922
|
|
1923
|
<li class="pre-context-line"><code> # Dispatch a request with error handling.
|
1924
|
</code></li>
|
1925
|
|
1926
|
<li class="pre-context-line"><code> def dispatch!
|
1927
|
</code></li>
|
1928
|
|
1929
|
<li class="pre-context-line"><code> invoke do
|
1930
|
</code></li>
|
1931
|
|
1932
|
<li class="pre-context-line"><code> static! if settings.static? && (request.get? || request.head?)
|
1933
|
</code></li>
|
1934
|
|
1935
|
<li class="pre-context-line"><code> filter! :before
|
1936
|
</code></li>
|
1937
|
|
1938
|
</ol>
|
1939
|
|
1940
|
|
1941
|
<ol start="1059" class="context" id="24"
|
1942
|
onclick="toggle(24);">
|
1943
|
<li class="context-line" id="context-24"><code> route!</code></li>
|
1944
|
</ol>
|
1945
|
|
1946
|
|
1947
|
<ol start="1060" class="post-context"
|
1948
|
id="post-24" onclick="toggle(24);">
|
1949
|
|
1950
|
<li class="post-context-line"><code> end
|
1951
|
</code></li>
|
1952
|
|
1953
|
<li class="post-context-line"><code> rescue ::Exception => boom
|
1954
|
</code></li>
|
1955
|
|
1956
|
<li class="post-context-line"><code> invoke { handle_exception!(boom) }
|
1957
|
</code></li>
|
1958
|
|
1959
|
<li class="post-context-line"><code> ensure
|
1960
|
</code></li>
|
1961
|
|
1962
|
<li class="post-context-line"><code> begin
|
1963
|
</code></li>
|
1964
|
|
1965
|
<li class="post-context-line"><code> filter! :after unless env['sinatra.static_file']
|
1966
|
</code></li>
|
1967
|
|
1968
|
<li class="post-context-line"><code> rescue ::Exception => boom
|
1969
|
</code></li>
|
1970
|
|
1971
|
</ol>
|
1972
|
|
1973
|
<div class="clear"></div>
|
1974
|
</li>
|
1975
|
|
1976
|
|
1977
|
|
1978
|
|
1979
|
|
1980
|
|
1981
|
|
1982
|
<li class="frame-info framework">
|
1983
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
1984
|
<code><strong>invoke</strong></code>
|
1985
|
</li>
|
1986
|
|
1987
|
<li class="code framework">
|
1988
|
|
1989
|
<ol start="1034"
|
1990
|
class="pre-context" id="pre-25"
|
1991
|
onclick="toggle(25);">
|
1992
|
|
1993
|
<li class="pre-context-line"><code> # Creates a Hash with indifferent access.
|
1994
|
</code></li>
|
1995
|
|
1996
|
<li class="pre-context-line"><code> def indifferent_hash
|
1997
|
</code></li>
|
1998
|
|
1999
|
<li class="pre-context-line"><code> Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
|
2000
|
</code></li>
|
2001
|
|
2002
|
<li class="pre-context-line"><code> end
|
2003
|
</code></li>
|
2004
|
|
2005
|
<li class="pre-context-line"><code>
|
2006
|
</code></li>
|
2007
|
|
2008
|
<li class="pre-context-line"><code> # Run the block with 'throw :halt' support and apply result to the response.
|
2009
|
</code></li>
|
2010
|
|
2011
|
<li class="pre-context-line"><code> def invoke
|
2012
|
</code></li>
|
2013
|
|
2014
|
</ol>
|
2015
|
|
2016
|
|
2017
|
<ol start="1041" class="context" id="25"
|
2018
|
onclick="toggle(25);">
|
2019
|
<li class="context-line" id="context-25"><code> res = catch(:halt) { yield }</code></li>
|
2020
|
</ol>
|
2021
|
|
2022
|
|
2023
|
<ol start="1042" class="post-context"
|
2024
|
id="post-25" onclick="toggle(25);">
|
2025
|
|
2026
|
<li class="post-context-line"><code> res = [res] if Fixnum === res or String === res
|
2027
|
</code></li>
|
2028
|
|
2029
|
<li class="post-context-line"><code> if Array === res and Fixnum === res.first
|
2030
|
</code></li>
|
2031
|
|
2032
|
<li class="post-context-line"><code> res = res.dup
|
2033
|
</code></li>
|
2034
|
|
2035
|
<li class="post-context-line"><code> status(res.shift)
|
2036
|
</code></li>
|
2037
|
|
2038
|
<li class="post-context-line"><code> body(res.pop)
|
2039
|
</code></li>
|
2040
|
|
2041
|
<li class="post-context-line"><code> headers(*res)
|
2042
|
</code></li>
|
2043
|
|
2044
|
<li class="post-context-line"><code> elsif res.respond_to? :each
|
2045
|
</code></li>
|
2046
|
|
2047
|
</ol>
|
2048
|
|
2049
|
<div class="clear"></div>
|
2050
|
</li>
|
2051
|
|
2052
|
|
2053
|
|
2054
|
|
2055
|
|
2056
|
|
2057
|
|
2058
|
<li class="frame-info framework">
|
2059
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
2060
|
<code><strong>catch</strong></code>
|
2061
|
</li>
|
2062
|
|
2063
|
<li class="code framework">
|
2064
|
|
2065
|
<ol start="1034"
|
2066
|
class="pre-context" id="pre-26"
|
2067
|
onclick="toggle(26);">
|
2068
|
|
2069
|
<li class="pre-context-line"><code> # Creates a Hash with indifferent access.
|
2070
|
</code></li>
|
2071
|
|
2072
|
<li class="pre-context-line"><code> def indifferent_hash
|
2073
|
</code></li>
|
2074
|
|
2075
|
<li class="pre-context-line"><code> Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
|
2076
|
</code></li>
|
2077
|
|
2078
|
<li class="pre-context-line"><code> end
|
2079
|
</code></li>
|
2080
|
|
2081
|
<li class="pre-context-line"><code>
|
2082
|
</code></li>
|
2083
|
|
2084
|
<li class="pre-context-line"><code> # Run the block with 'throw :halt' support and apply result to the response.
|
2085
|
</code></li>
|
2086
|
|
2087
|
<li class="pre-context-line"><code> def invoke
|
2088
|
</code></li>
|
2089
|
|
2090
|
</ol>
|
2091
|
|
2092
|
|
2093
|
<ol start="1041" class="context" id="26"
|
2094
|
onclick="toggle(26);">
|
2095
|
<li class="context-line" id="context-26"><code> res = catch(:halt) { yield }</code></li>
|
2096
|
</ol>
|
2097
|
|
2098
|
|
2099
|
<ol start="1042" class="post-context"
|
2100
|
id="post-26" onclick="toggle(26);">
|
2101
|
|
2102
|
<li class="post-context-line"><code> res = [res] if Fixnum === res or String === res
|
2103
|
</code></li>
|
2104
|
|
2105
|
<li class="post-context-line"><code> if Array === res and Fixnum === res.first
|
2106
|
</code></li>
|
2107
|
|
2108
|
<li class="post-context-line"><code> res = res.dup
|
2109
|
</code></li>
|
2110
|
|
2111
|
<li class="post-context-line"><code> status(res.shift)
|
2112
|
</code></li>
|
2113
|
|
2114
|
<li class="post-context-line"><code> body(res.pop)
|
2115
|
</code></li>
|
2116
|
|
2117
|
<li class="post-context-line"><code> headers(*res)
|
2118
|
</code></li>
|
2119
|
|
2120
|
<li class="post-context-line"><code> elsif res.respond_to? :each
|
2121
|
</code></li>
|
2122
|
|
2123
|
</ol>
|
2124
|
|
2125
|
<div class="clear"></div>
|
2126
|
</li>
|
2127
|
|
2128
|
|
2129
|
|
2130
|
|
2131
|
|
2132
|
|
2133
|
|
2134
|
<li class="frame-info framework">
|
2135
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
2136
|
<code><strong>invoke</strong></code>
|
2137
|
</li>
|
2138
|
|
2139
|
<li class="code framework">
|
2140
|
|
2141
|
<ol start="1034"
|
2142
|
class="pre-context" id="pre-27"
|
2143
|
onclick="toggle(27);">
|
2144
|
|
2145
|
<li class="pre-context-line"><code> # Creates a Hash with indifferent access.
|
2146
|
</code></li>
|
2147
|
|
2148
|
<li class="pre-context-line"><code> def indifferent_hash
|
2149
|
</code></li>
|
2150
|
|
2151
|
<li class="pre-context-line"><code> Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
|
2152
|
</code></li>
|
2153
|
|
2154
|
<li class="pre-context-line"><code> end
|
2155
|
</code></li>
|
2156
|
|
2157
|
<li class="pre-context-line"><code>
|
2158
|
</code></li>
|
2159
|
|
2160
|
<li class="pre-context-line"><code> # Run the block with 'throw :halt' support and apply result to the response.
|
2161
|
</code></li>
|
2162
|
|
2163
|
<li class="pre-context-line"><code> def invoke
|
2164
|
</code></li>
|
2165
|
|
2166
|
</ol>
|
2167
|
|
2168
|
|
2169
|
<ol start="1041" class="context" id="27"
|
2170
|
onclick="toggle(27);">
|
2171
|
<li class="context-line" id="context-27"><code> res = catch(:halt) { yield }</code></li>
|
2172
|
</ol>
|
2173
|
|
2174
|
|
2175
|
<ol start="1042" class="post-context"
|
2176
|
id="post-27" onclick="toggle(27);">
|
2177
|
|
2178
|
<li class="post-context-line"><code> res = [res] if Fixnum === res or String === res
|
2179
|
</code></li>
|
2180
|
|
2181
|
<li class="post-context-line"><code> if Array === res and Fixnum === res.first
|
2182
|
</code></li>
|
2183
|
|
2184
|
<li class="post-context-line"><code> res = res.dup
|
2185
|
</code></li>
|
2186
|
|
2187
|
<li class="post-context-line"><code> status(res.shift)
|
2188
|
</code></li>
|
2189
|
|
2190
|
<li class="post-context-line"><code> body(res.pop)
|
2191
|
</code></li>
|
2192
|
|
2193
|
<li class="post-context-line"><code> headers(*res)
|
2194
|
</code></li>
|
2195
|
|
2196
|
<li class="post-context-line"><code> elsif res.respond_to? :each
|
2197
|
</code></li>
|
2198
|
|
2199
|
</ol>
|
2200
|
|
2201
|
<div class="clear"></div>
|
2202
|
</li>
|
2203
|
|
2204
|
|
2205
|
|
2206
|
|
2207
|
|
2208
|
|
2209
|
|
2210
|
<li class="frame-info framework">
|
2211
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
2212
|
<code><strong>dispatch!</strong></code>
|
2213
|
</li>
|
2214
|
|
2215
|
<li class="code framework">
|
2216
|
|
2217
|
<ol start="1049"
|
2218
|
class="pre-context" id="pre-28"
|
2219
|
onclick="toggle(28);">
|
2220
|
|
2221
|
<li class="pre-context-line"><code> body res
|
2222
|
</code></li>
|
2223
|
|
2224
|
<li class="pre-context-line"><code> end
|
2225
|
</code></li>
|
2226
|
|
2227
|
<li class="pre-context-line"><code> nil # avoid double setting the same response tuple twice
|
2228
|
</code></li>
|
2229
|
|
2230
|
<li class="pre-context-line"><code> end
|
2231
|
</code></li>
|
2232
|
|
2233
|
<li class="pre-context-line"><code>
|
2234
|
</code></li>
|
2235
|
|
2236
|
<li class="pre-context-line"><code> # Dispatch a request with error handling.
|
2237
|
</code></li>
|
2238
|
|
2239
|
<li class="pre-context-line"><code> def dispatch!
|
2240
|
</code></li>
|
2241
|
|
2242
|
</ol>
|
2243
|
|
2244
|
|
2245
|
<ol start="1056" class="context" id="28"
|
2246
|
onclick="toggle(28);">
|
2247
|
<li class="context-line" id="context-28"><code> invoke do</code></li>
|
2248
|
</ol>
|
2249
|
|
2250
|
|
2251
|
<ol start="1057" class="post-context"
|
2252
|
id="post-28" onclick="toggle(28);">
|
2253
|
|
2254
|
<li class="post-context-line"><code> static! if settings.static? && (request.get? || request.head?)
|
2255
|
</code></li>
|
2256
|
|
2257
|
<li class="post-context-line"><code> filter! :before
|
2258
|
</code></li>
|
2259
|
|
2260
|
<li class="post-context-line"><code> route!
|
2261
|
</code></li>
|
2262
|
|
2263
|
<li class="post-context-line"><code> end
|
2264
|
</code></li>
|
2265
|
|
2266
|
<li class="post-context-line"><code> rescue ::Exception => boom
|
2267
|
</code></li>
|
2268
|
|
2269
|
<li class="post-context-line"><code> invoke { handle_exception!(boom) }
|
2270
|
</code></li>
|
2271
|
|
2272
|
<li class="post-context-line"><code> ensure
|
2273
|
</code></li>
|
2274
|
|
2275
|
</ol>
|
2276
|
|
2277
|
<div class="clear"></div>
|
2278
|
</li>
|
2279
|
|
2280
|
|
2281
|
|
2282
|
|
2283
|
|
2284
|
|
2285
|
|
2286
|
<li class="frame-info framework">
|
2287
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
2288
|
<code><strong>call!</strong></code>
|
2289
|
</li>
|
2290
|
|
2291
|
<li class="code framework">
|
2292
|
|
2293
|
<ol start="875"
|
2294
|
class="pre-context" id="pre-29"
|
2295
|
onclick="toggle(29);">
|
2296
|
|
2297
|
<li class="pre-context-line"><code> @request = Request.new(env)
|
2298
|
</code></li>
|
2299
|
|
2300
|
<li class="pre-context-line"><code> @response = Response.new
|
2301
|
</code></li>
|
2302
|
|
2303
|
<li class="pre-context-line"><code> @params = indifferent_params(@request.params)
|
2304
|
</code></li>
|
2305
|
|
2306
|
<li class="pre-context-line"><code> template_cache.clear if settings.reload_templates
|
2307
|
</code></li>
|
2308
|
|
2309
|
<li class="pre-context-line"><code> force_encoding(@params)
|
2310
|
</code></li>
|
2311
|
|
2312
|
<li class="pre-context-line"><code>
|
2313
|
</code></li>
|
2314
|
|
2315
|
<li class="pre-context-line"><code> @response['Content-Type'] = nil
|
2316
|
</code></li>
|
2317
|
|
2318
|
</ol>
|
2319
|
|
2320
|
|
2321
|
<ol start="882" class="context" id="29"
|
2322
|
onclick="toggle(29);">
|
2323
|
<li class="context-line" id="context-29"><code> invoke { dispatch! }</code></li>
|
2324
|
</ol>
|
2325
|
|
2326
|
|
2327
|
<ol start="883" class="post-context"
|
2328
|
id="post-29" onclick="toggle(29);">
|
2329
|
|
2330
|
<li class="post-context-line"><code> invoke { error_block!(response.status) } unless @env['sinatra.error']
|
2331
|
</code></li>
|
2332
|
|
2333
|
<li class="post-context-line"><code>
|
2334
|
</code></li>
|
2335
|
|
2336
|
<li class="post-context-line"><code> unless @response['Content-Type']
|
2337
|
</code></li>
|
2338
|
|
2339
|
<li class="post-context-line"><code> if Array === body and body[0].respond_to? :content_type
|
2340
|
</code></li>
|
2341
|
|
2342
|
<li class="post-context-line"><code> content_type body[0].content_type
|
2343
|
</code></li>
|
2344
|
|
2345
|
<li class="post-context-line"><code> else
|
2346
|
</code></li>
|
2347
|
|
2348
|
<li class="post-context-line"><code> content_type :html
|
2349
|
</code></li>
|
2350
|
|
2351
|
</ol>
|
2352
|
|
2353
|
<div class="clear"></div>
|
2354
|
</li>
|
2355
|
|
2356
|
|
2357
|
|
2358
|
|
2359
|
|
2360
|
|
2361
|
|
2362
|
<li class="frame-info framework">
|
2363
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
2364
|
<code><strong>invoke</strong></code>
|
2365
|
</li>
|
2366
|
|
2367
|
<li class="code framework">
|
2368
|
|
2369
|
<ol start="1034"
|
2370
|
class="pre-context" id="pre-30"
|
2371
|
onclick="toggle(30);">
|
2372
|
|
2373
|
<li class="pre-context-line"><code> # Creates a Hash with indifferent access.
|
2374
|
</code></li>
|
2375
|
|
2376
|
<li class="pre-context-line"><code> def indifferent_hash
|
2377
|
</code></li>
|
2378
|
|
2379
|
<li class="pre-context-line"><code> Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
|
2380
|
</code></li>
|
2381
|
|
2382
|
<li class="pre-context-line"><code> end
|
2383
|
</code></li>
|
2384
|
|
2385
|
<li class="pre-context-line"><code>
|
2386
|
</code></li>
|
2387
|
|
2388
|
<li class="pre-context-line"><code> # Run the block with 'throw :halt' support and apply result to the response.
|
2389
|
</code></li>
|
2390
|
|
2391
|
<li class="pre-context-line"><code> def invoke
|
2392
|
</code></li>
|
2393
|
|
2394
|
</ol>
|
2395
|
|
2396
|
|
2397
|
<ol start="1041" class="context" id="30"
|
2398
|
onclick="toggle(30);">
|
2399
|
<li class="context-line" id="context-30"><code> res = catch(:halt) { yield }</code></li>
|
2400
|
</ol>
|
2401
|
|
2402
|
|
2403
|
<ol start="1042" class="post-context"
|
2404
|
id="post-30" onclick="toggle(30);">
|
2405
|
|
2406
|
<li class="post-context-line"><code> res = [res] if Fixnum === res or String === res
|
2407
|
</code></li>
|
2408
|
|
2409
|
<li class="post-context-line"><code> if Array === res and Fixnum === res.first
|
2410
|
</code></li>
|
2411
|
|
2412
|
<li class="post-context-line"><code> res = res.dup
|
2413
|
</code></li>
|
2414
|
|
2415
|
<li class="post-context-line"><code> status(res.shift)
|
2416
|
</code></li>
|
2417
|
|
2418
|
<li class="post-context-line"><code> body(res.pop)
|
2419
|
</code></li>
|
2420
|
|
2421
|
<li class="post-context-line"><code> headers(*res)
|
2422
|
</code></li>
|
2423
|
|
2424
|
<li class="post-context-line"><code> elsif res.respond_to? :each
|
2425
|
</code></li>
|
2426
|
|
2427
|
</ol>
|
2428
|
|
2429
|
<div class="clear"></div>
|
2430
|
</li>
|
2431
|
|
2432
|
|
2433
|
|
2434
|
|
2435
|
|
2436
|
|
2437
|
|
2438
|
<li class="frame-info framework">
|
2439
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
2440
|
<code><strong>catch</strong></code>
|
2441
|
</li>
|
2442
|
|
2443
|
<li class="code framework">
|
2444
|
|
2445
|
<ol start="1034"
|
2446
|
class="pre-context" id="pre-31"
|
2447
|
onclick="toggle(31);">
|
2448
|
|
2449
|
<li class="pre-context-line"><code> # Creates a Hash with indifferent access.
|
2450
|
</code></li>
|
2451
|
|
2452
|
<li class="pre-context-line"><code> def indifferent_hash
|
2453
|
</code></li>
|
2454
|
|
2455
|
<li class="pre-context-line"><code> Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
|
2456
|
</code></li>
|
2457
|
|
2458
|
<li class="pre-context-line"><code> end
|
2459
|
</code></li>
|
2460
|
|
2461
|
<li class="pre-context-line"><code>
|
2462
|
</code></li>
|
2463
|
|
2464
|
<li class="pre-context-line"><code> # Run the block with 'throw :halt' support and apply result to the response.
|
2465
|
</code></li>
|
2466
|
|
2467
|
<li class="pre-context-line"><code> def invoke
|
2468
|
</code></li>
|
2469
|
|
2470
|
</ol>
|
2471
|
|
2472
|
|
2473
|
<ol start="1041" class="context" id="31"
|
2474
|
onclick="toggle(31);">
|
2475
|
<li class="context-line" id="context-31"><code> res = catch(:halt) { yield }</code></li>
|
2476
|
</ol>
|
2477
|
|
2478
|
|
2479
|
<ol start="1042" class="post-context"
|
2480
|
id="post-31" onclick="toggle(31);">
|
2481
|
|
2482
|
<li class="post-context-line"><code> res = [res] if Fixnum === res or String === res
|
2483
|
</code></li>
|
2484
|
|
2485
|
<li class="post-context-line"><code> if Array === res and Fixnum === res.first
|
2486
|
</code></li>
|
2487
|
|
2488
|
<li class="post-context-line"><code> res = res.dup
|
2489
|
</code></li>
|
2490
|
|
2491
|
<li class="post-context-line"><code> status(res.shift)
|
2492
|
</code></li>
|
2493
|
|
2494
|
<li class="post-context-line"><code> body(res.pop)
|
2495
|
</code></li>
|
2496
|
|
2497
|
<li class="post-context-line"><code> headers(*res)
|
2498
|
</code></li>
|
2499
|
|
2500
|
<li class="post-context-line"><code> elsif res.respond_to? :each
|
2501
|
</code></li>
|
2502
|
|
2503
|
</ol>
|
2504
|
|
2505
|
<div class="clear"></div>
|
2506
|
</li>
|
2507
|
|
2508
|
|
2509
|
|
2510
|
|
2511
|
|
2512
|
|
2513
|
|
2514
|
<li class="frame-info framework">
|
2515
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
2516
|
<code><strong>invoke</strong></code>
|
2517
|
</li>
|
2518
|
|
2519
|
<li class="code framework">
|
2520
|
|
2521
|
<ol start="1034"
|
2522
|
class="pre-context" id="pre-32"
|
2523
|
onclick="toggle(32);">
|
2524
|
|
2525
|
<li class="pre-context-line"><code> # Creates a Hash with indifferent access.
|
2526
|
</code></li>
|
2527
|
|
2528
|
<li class="pre-context-line"><code> def indifferent_hash
|
2529
|
</code></li>
|
2530
|
|
2531
|
<li class="pre-context-line"><code> Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
|
2532
|
</code></li>
|
2533
|
|
2534
|
<li class="pre-context-line"><code> end
|
2535
|
</code></li>
|
2536
|
|
2537
|
<li class="pre-context-line"><code>
|
2538
|
</code></li>
|
2539
|
|
2540
|
<li class="pre-context-line"><code> # Run the block with 'throw :halt' support and apply result to the response.
|
2541
|
</code></li>
|
2542
|
|
2543
|
<li class="pre-context-line"><code> def invoke
|
2544
|
</code></li>
|
2545
|
|
2546
|
</ol>
|
2547
|
|
2548
|
|
2549
|
<ol start="1041" class="context" id="32"
|
2550
|
onclick="toggle(32);">
|
2551
|
<li class="context-line" id="context-32"><code> res = catch(:halt) { yield }</code></li>
|
2552
|
</ol>
|
2553
|
|
2554
|
|
2555
|
<ol start="1042" class="post-context"
|
2556
|
id="post-32" onclick="toggle(32);">
|
2557
|
|
2558
|
<li class="post-context-line"><code> res = [res] if Fixnum === res or String === res
|
2559
|
</code></li>
|
2560
|
|
2561
|
<li class="post-context-line"><code> if Array === res and Fixnum === res.first
|
2562
|
</code></li>
|
2563
|
|
2564
|
<li class="post-context-line"><code> res = res.dup
|
2565
|
</code></li>
|
2566
|
|
2567
|
<li class="post-context-line"><code> status(res.shift)
|
2568
|
</code></li>
|
2569
|
|
2570
|
<li class="post-context-line"><code> body(res.pop)
|
2571
|
</code></li>
|
2572
|
|
2573
|
<li class="post-context-line"><code> headers(*res)
|
2574
|
</code></li>
|
2575
|
|
2576
|
<li class="post-context-line"><code> elsif res.respond_to? :each
|
2577
|
</code></li>
|
2578
|
|
2579
|
</ol>
|
2580
|
|
2581
|
<div class="clear"></div>
|
2582
|
</li>
|
2583
|
|
2584
|
|
2585
|
|
2586
|
|
2587
|
|
2588
|
|
2589
|
|
2590
|
<li class="frame-info framework">
|
2591
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
2592
|
<code><strong>call!</strong></code>
|
2593
|
</li>
|
2594
|
|
2595
|
<li class="code framework">
|
2596
|
|
2597
|
<ol start="875"
|
2598
|
class="pre-context" id="pre-33"
|
2599
|
onclick="toggle(33);">
|
2600
|
|
2601
|
<li class="pre-context-line"><code> @request = Request.new(env)
|
2602
|
</code></li>
|
2603
|
|
2604
|
<li class="pre-context-line"><code> @response = Response.new
|
2605
|
</code></li>
|
2606
|
|
2607
|
<li class="pre-context-line"><code> @params = indifferent_params(@request.params)
|
2608
|
</code></li>
|
2609
|
|
2610
|
<li class="pre-context-line"><code> template_cache.clear if settings.reload_templates
|
2611
|
</code></li>
|
2612
|
|
2613
|
<li class="pre-context-line"><code> force_encoding(@params)
|
2614
|
</code></li>
|
2615
|
|
2616
|
<li class="pre-context-line"><code>
|
2617
|
</code></li>
|
2618
|
|
2619
|
<li class="pre-context-line"><code> @response['Content-Type'] = nil
|
2620
|
</code></li>
|
2621
|
|
2622
|
</ol>
|
2623
|
|
2624
|
|
2625
|
<ol start="882" class="context" id="33"
|
2626
|
onclick="toggle(33);">
|
2627
|
<li class="context-line" id="context-33"><code> invoke { dispatch! }</code></li>
|
2628
|
</ol>
|
2629
|
|
2630
|
|
2631
|
<ol start="883" class="post-context"
|
2632
|
id="post-33" onclick="toggle(33);">
|
2633
|
|
2634
|
<li class="post-context-line"><code> invoke { error_block!(response.status) } unless @env['sinatra.error']
|
2635
|
</code></li>
|
2636
|
|
2637
|
<li class="post-context-line"><code>
|
2638
|
</code></li>
|
2639
|
|
2640
|
<li class="post-context-line"><code> unless @response['Content-Type']
|
2641
|
</code></li>
|
2642
|
|
2643
|
<li class="post-context-line"><code> if Array === body and body[0].respond_to? :content_type
|
2644
|
</code></li>
|
2645
|
|
2646
|
<li class="post-context-line"><code> content_type body[0].content_type
|
2647
|
</code></li>
|
2648
|
|
2649
|
<li class="post-context-line"><code> else
|
2650
|
</code></li>
|
2651
|
|
2652
|
<li class="post-context-line"><code> content_type :html
|
2653
|
</code></li>
|
2654
|
|
2655
|
</ol>
|
2656
|
|
2657
|
<div class="clear"></div>
|
2658
|
</li>
|
2659
|
|
2660
|
|
2661
|
|
2662
|
|
2663
|
|
2664
|
|
2665
|
|
2666
|
<li class="frame-info framework">
|
2667
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
2668
|
<code><strong>call</strong></code>
|
2669
|
</li>
|
2670
|
|
2671
|
<li class="code framework">
|
2672
|
|
2673
|
<ol start="863"
|
2674
|
class="pre-context" id="pre-34"
|
2675
|
onclick="toggle(34);">
|
2676
|
|
2677
|
<li class="pre-context-line"><code> @app = app
|
2678
|
</code></li>
|
2679
|
|
2680
|
<li class="pre-context-line"><code> @template_cache = Tilt::Cache.new
|
2681
|
</code></li>
|
2682
|
|
2683
|
<li class="pre-context-line"><code> yield self if block_given?
|
2684
|
</code></li>
|
2685
|
|
2686
|
<li class="pre-context-line"><code> end
|
2687
|
</code></li>
|
2688
|
|
2689
|
<li class="pre-context-line"><code>
|
2690
|
</code></li>
|
2691
|
|
2692
|
<li class="pre-context-line"><code> # Rack call interface.
|
2693
|
</code></li>
|
2694
|
|
2695
|
<li class="pre-context-line"><code> def call(env)
|
2696
|
</code></li>
|
2697
|
|
2698
|
</ol>
|
2699
|
|
2700
|
|
2701
|
<ol start="870" class="context" id="34"
|
2702
|
onclick="toggle(34);">
|
2703
|
<li class="context-line" id="context-34"><code> dup.call!(env)</code></li>
|
2704
|
</ol>
|
2705
|
|
2706
|
|
2707
|
<ol start="871" class="post-context"
|
2708
|
id="post-34" onclick="toggle(34);">
|
2709
|
|
2710
|
<li class="post-context-line"><code> end
|
2711
|
</code></li>
|
2712
|
|
2713
|
<li class="post-context-line"><code>
|
2714
|
</code></li>
|
2715
|
|
2716
|
<li class="post-context-line"><code> def call!(env) # :nodoc:
|
2717
|
</code></li>
|
2718
|
|
2719
|
<li class="post-context-line"><code> @env = env
|
2720
|
</code></li>
|
2721
|
|
2722
|
<li class="post-context-line"><code> @request = Request.new(env)
|
2723
|
</code></li>
|
2724
|
|
2725
|
<li class="post-context-line"><code> @response = Response.new
|
2726
|
</code></li>
|
2727
|
|
2728
|
<li class="post-context-line"><code> @params = indifferent_params(@request.params)
|
2729
|
</code></li>
|
2730
|
|
2731
|
</ol>
|
2732
|
|
2733
|
<div class="clear"></div>
|
2734
|
</li>
|
2735
|
|
2736
|
|
2737
|
|
2738
|
|
2739
|
|
2740
|
|
2741
|
|
2742
|
<li class="frame-info system">
|
2743
|
<code>/usr/lib/ruby/gems/1.8/gems/rack-1.5.2/lib/rack/session/abstract/id.rb</code> in
|
2744
|
<code><strong>context</strong></code>
|
2745
|
</li>
|
2746
|
|
2747
|
<li class="code system">
|
2748
|
|
2749
|
<ol start="218"
|
2750
|
class="pre-context" id="pre-35"
|
2751
|
onclick="toggle(35);">
|
2752
|
|
2753
|
<li class="pre-context-line"><code>
|
2754
|
</code></li>
|
2755
|
|
2756
|
<li class="pre-context-line"><code> def call(env)
|
2757
|
</code></li>
|
2758
|
|
2759
|
<li class="pre-context-line"><code> context(env)
|
2760
|
</code></li>
|
2761
|
|
2762
|
<li class="pre-context-line"><code> end
|
2763
|
</code></li>
|
2764
|
|
2765
|
<li class="pre-context-line"><code>
|
2766
|
</code></li>
|
2767
|
|
2768
|
<li class="pre-context-line"><code> def context(env, app=@app)
|
2769
|
</code></li>
|
2770
|
|
2771
|
<li class="pre-context-line"><code> prepare_session(env)
|
2772
|
</code></li>
|
2773
|
|
2774
|
</ol>
|
2775
|
|
2776
|
|
2777
|
<ol start="225" class="context" id="35"
|
2778
|
onclick="toggle(35);">
|
2779
|
<li class="context-line" id="context-35"><code> status, headers, body = app.call(env)</code></li>
|
2780
|
</ol>
|
2781
|
|
2782
|
|
2783
|
<ol start="226" class="post-context"
|
2784
|
id="post-35" onclick="toggle(35);">
|
2785
|
|
2786
|
<li class="post-context-line"><code> commit_session(env, status, headers, body)
|
2787
|
</code></li>
|
2788
|
|
2789
|
<li class="post-context-line"><code> end
|
2790
|
</code></li>
|
2791
|
|
2792
|
<li class="post-context-line"><code>
|
2793
|
</code></li>
|
2794
|
|
2795
|
<li class="post-context-line"><code> private
|
2796
|
</code></li>
|
2797
|
|
2798
|
<li class="post-context-line"><code>
|
2799
|
</code></li>
|
2800
|
|
2801
|
<li class="post-context-line"><code> def initialize_sid
|
2802
|
</code></li>
|
2803
|
|
2804
|
<li class="post-context-line"><code> @sidbits = @default_options[:sidbits]
|
2805
|
</code></li>
|
2806
|
|
2807
|
</ol>
|
2808
|
|
2809
|
<div class="clear"></div>
|
2810
|
</li>
|
2811
|
|
2812
|
|
2813
|
|
2814
|
|
2815
|
|
2816
|
|
2817
|
|
2818
|
<li class="frame-info system">
|
2819
|
<code>/usr/lib/ruby/gems/1.8/gems/rack-1.5.2/lib/rack/session/abstract/id.rb</code> in
|
2820
|
<code><strong>call</strong></code>
|
2821
|
</li>
|
2822
|
|
2823
|
<li class="code system">
|
2824
|
|
2825
|
<ol start="213"
|
2826
|
class="pre-context" id="pre-36"
|
2827
|
onclick="toggle(36);">
|
2828
|
|
2829
|
<li class="pre-context-line"><code> @default_options = self.class::DEFAULT_OPTIONS.merge(options)
|
2830
|
</code></li>
|
2831
|
|
2832
|
<li class="pre-context-line"><code> @key = @default_options.delete(:key)
|
2833
|
</code></li>
|
2834
|
|
2835
|
<li class="pre-context-line"><code> @cookie_only = @default_options.delete(:cookie_only)
|
2836
|
</code></li>
|
2837
|
|
2838
|
<li class="pre-context-line"><code> initialize_sid
|
2839
|
</code></li>
|
2840
|
|
2841
|
<li class="pre-context-line"><code> end
|
2842
|
</code></li>
|
2843
|
|
2844
|
<li class="pre-context-line"><code>
|
2845
|
</code></li>
|
2846
|
|
2847
|
<li class="pre-context-line"><code> def call(env)
|
2848
|
</code></li>
|
2849
|
|
2850
|
</ol>
|
2851
|
|
2852
|
|
2853
|
<ol start="220" class="context" id="36"
|
2854
|
onclick="toggle(36);">
|
2855
|
<li class="context-line" id="context-36"><code> context(env)</code></li>
|
2856
|
</ol>
|
2857
|
|
2858
|
|
2859
|
<ol start="221" class="post-context"
|
2860
|
id="post-36" onclick="toggle(36);">
|
2861
|
|
2862
|
<li class="post-context-line"><code> end
|
2863
|
</code></li>
|
2864
|
|
2865
|
<li class="post-context-line"><code>
|
2866
|
</code></li>
|
2867
|
|
2868
|
<li class="post-context-line"><code> def context(env, app=@app)
|
2869
|
</code></li>
|
2870
|
|
2871
|
<li class="post-context-line"><code> prepare_session(env)
|
2872
|
</code></li>
|
2873
|
|
2874
|
<li class="post-context-line"><code> status, headers, body = app.call(env)
|
2875
|
</code></li>
|
2876
|
|
2877
|
<li class="post-context-line"><code> commit_session(env, status, headers, body)
|
2878
|
</code></li>
|
2879
|
|
2880
|
<li class="post-context-line"><code> end
|
2881
|
</code></li>
|
2882
|
|
2883
|
</ol>
|
2884
|
|
2885
|
<div class="clear"></div>
|
2886
|
</li>
|
2887
|
|
2888
|
|
2889
|
|
2890
|
|
2891
|
|
2892
|
|
2893
|
|
2894
|
<li class="frame-info system">
|
2895
|
<code>/usr/lib/ruby/gems/1.8/gems/rack-1.5.2/lib/rack/commonlogger.rb</code> in
|
2896
|
<code><strong>call_without_check</strong></code>
|
2897
|
</li>
|
2898
|
|
2899
|
<li class="code system">
|
2900
|
|
2901
|
<ol start="26"
|
2902
|
class="pre-context" id="pre-37"
|
2903
|
onclick="toggle(37);">
|
2904
|
|
2905
|
<li class="pre-context-line"><code> def initialize(app, logger=nil)
|
2906
|
</code></li>
|
2907
|
|
2908
|
<li class="pre-context-line"><code> @app = app
|
2909
|
</code></li>
|
2910
|
|
2911
|
<li class="pre-context-line"><code> @logger = logger
|
2912
|
</code></li>
|
2913
|
|
2914
|
<li class="pre-context-line"><code> end
|
2915
|
</code></li>
|
2916
|
|
2917
|
<li class="pre-context-line"><code>
|
2918
|
</code></li>
|
2919
|
|
2920
|
<li class="pre-context-line"><code> def call(env)
|
2921
|
</code></li>
|
2922
|
|
2923
|
<li class="pre-context-line"><code> began_at = Time.now
|
2924
|
</code></li>
|
2925
|
|
2926
|
</ol>
|
2927
|
|
2928
|
|
2929
|
<ol start="33" class="context" id="37"
|
2930
|
onclick="toggle(37);">
|
2931
|
<li class="context-line" id="context-37"><code> status, header, body = @app.call(env)</code></li>
|
2932
|
</ol>
|
2933
|
|
2934
|
|
2935
|
<ol start="34" class="post-context"
|
2936
|
id="post-37" onclick="toggle(37);">
|
2937
|
|
2938
|
<li class="post-context-line"><code> header = Utils::HeaderHash.new(header)
|
2939
|
</code></li>
|
2940
|
|
2941
|
<li class="post-context-line"><code> body = BodyProxy.new(body) { log(env, status, header, began_at) }
|
2942
|
</code></li>
|
2943
|
|
2944
|
<li class="post-context-line"><code> [status, header, body]
|
2945
|
</code></li>
|
2946
|
|
2947
|
<li class="post-context-line"><code> end
|
2948
|
</code></li>
|
2949
|
|
2950
|
<li class="post-context-line"><code>
|
2951
|
</code></li>
|
2952
|
|
2953
|
<li class="post-context-line"><code> private
|
2954
|
</code></li>
|
2955
|
|
2956
|
<li class="post-context-line"><code>
|
2957
|
</code></li>
|
2958
|
|
2959
|
</ol>
|
2960
|
|
2961
|
<div class="clear"></div>
|
2962
|
</li>
|
2963
|
|
2964
|
|
2965
|
|
2966
|
|
2967
|
|
2968
|
|
2969
|
|
2970
|
<li class="frame-info framework">
|
2971
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
2972
|
<code><strong>call</strong></code>
|
2973
|
</li>
|
2974
|
|
2975
|
<li class="code framework">
|
2976
|
|
2977
|
<ol start="205"
|
2978
|
class="pre-context" id="pre-38"
|
2979
|
onclick="toggle(38);">
|
2980
|
|
2981
|
<li class="pre-context-line"><code> env['sinatra.commonlogger'] ? @app.call(env) : super
|
2982
|
</code></li>
|
2983
|
|
2984
|
<li class="pre-context-line"><code> end
|
2985
|
</code></li>
|
2986
|
|
2987
|
<li class="pre-context-line"><code>
|
2988
|
</code></li>
|
2989
|
|
2990
|
<li class="pre-context-line"><code> superclass.class_eval do
|
2991
|
</code></li>
|
2992
|
|
2993
|
<li class="pre-context-line"><code> alias call_without_check call unless method_defined? :call_without_check
|
2994
|
</code></li>
|
2995
|
|
2996
|
<li class="pre-context-line"><code> def call(env)
|
2997
|
</code></li>
|
2998
|
|
2999
|
<li class="pre-context-line"><code> env['sinatra.commonlogger'] = true
|
3000
|
</code></li>
|
3001
|
|
3002
|
</ol>
|
3003
|
|
3004
|
|
3005
|
<ol start="212" class="context" id="38"
|
3006
|
onclick="toggle(38);">
|
3007
|
<li class="context-line" id="context-38"><code> call_without_check(env)</code></li>
|
3008
|
</ol>
|
3009
|
|
3010
|
|
3011
|
<ol start="213" class="post-context"
|
3012
|
id="post-38" onclick="toggle(38);">
|
3013
|
|
3014
|
<li class="post-context-line"><code> end
|
3015
|
</code></li>
|
3016
|
|
3017
|
<li class="post-context-line"><code> end
|
3018
|
</code></li>
|
3019
|
|
3020
|
<li class="post-context-line"><code> end
|
3021
|
</code></li>
|
3022
|
|
3023
|
<li class="post-context-line"><code>
|
3024
|
</code></li>
|
3025
|
|
3026
|
<li class="post-context-line"><code> class NotFound < NameError #:nodoc:
|
3027
|
</code></li>
|
3028
|
|
3029
|
<li class="post-context-line"><code> def http_status; 404 end
|
3030
|
</code></li>
|
3031
|
|
3032
|
<li class="post-context-line"><code> end
|
3033
|
</code></li>
|
3034
|
|
3035
|
</ol>
|
3036
|
|
3037
|
<div class="clear"></div>
|
3038
|
</li>
|
3039
|
|
3040
|
|
3041
|
|
3042
|
|
3043
|
|
3044
|
|
3045
|
|
3046
|
<li class="frame-info system">
|
3047
|
<code>/usr/lib/ruby/gems/1.8/gems/rack-protection-1.5.0/lib/rack/protection/xss_header.rb</code> in
|
3048
|
<code><strong>call</strong></code>
|
3049
|
</li>
|
3050
|
|
3051
|
<li class="code system">
|
3052
|
|
3053
|
<ol start="11"
|
3054
|
class="pre-context" id="pre-39"
|
3055
|
onclick="toggle(39);">
|
3056
|
|
3057
|
<li class="pre-context-line"><code> #
|
3058
|
</code></li>
|
3059
|
|
3060
|
<li class="pre-context-line"><code> # Options:
|
3061
|
</code></li>
|
3062
|
|
3063
|
<li class="pre-context-line"><code> # xss_mode:: How the browser should prevent the attack (default: :block)
|
3064
|
</code></li>
|
3065
|
|
3066
|
<li class="pre-context-line"><code> class XSSHeader < Base
|
3067
|
</code></li>
|
3068
|
|
3069
|
<li class="pre-context-line"><code> default_options :xss_mode => :block, :nosniff => true
|
3070
|
</code></li>
|
3071
|
|
3072
|
<li class="pre-context-line"><code>
|
3073
|
</code></li>
|
3074
|
|
3075
|
<li class="pre-context-line"><code> def call(env)
|
3076
|
</code></li>
|
3077
|
|
3078
|
</ol>
|
3079
|
|
3080
|
|
3081
|
<ol start="18" class="context" id="39"
|
3082
|
onclick="toggle(39);">
|
3083
|
<li class="context-line" id="context-39"><code> status, headers, body = @app.call(env)</code></li>
|
3084
|
</ol>
|
3085
|
|
3086
|
|
3087
|
<ol start="19" class="post-context"
|
3088
|
id="post-39" onclick="toggle(39);">
|
3089
|
|
3090
|
<li class="post-context-line"><code> headers['X-XSS-Protection'] ||= "1; mode=#{options[:xss_mode]}" if html? headers
|
3091
|
</code></li>
|
3092
|
|
3093
|
<li class="post-context-line"><code> headers['X-Content-Type-Options'] ||= 'nosniff' if options[:nosniff]
|
3094
|
</code></li>
|
3095
|
|
3096
|
<li class="post-context-line"><code> [status, headers, body]
|
3097
|
</code></li>
|
3098
|
|
3099
|
<li class="post-context-line"><code> end
|
3100
|
</code></li>
|
3101
|
|
3102
|
<li class="post-context-line"><code> end
|
3103
|
</code></li>
|
3104
|
|
3105
|
<li class="post-context-line"><code> end
|
3106
|
</code></li>
|
3107
|
|
3108
|
<li class="post-context-line"><code>end
|
3109
|
</code></li>
|
3110
|
|
3111
|
</ol>
|
3112
|
|
3113
|
<div class="clear"></div>
|
3114
|
</li>
|
3115
|
|
3116
|
|
3117
|
|
3118
|
|
3119
|
|
3120
|
|
3121
|
|
3122
|
<li class="frame-info system">
|
3123
|
<code>/usr/lib/ruby/gems/1.8/gems/rack-protection-1.5.0/lib/rack/protection/path_traversal.rb</code> in
|
3124
|
<code><strong>call</strong></code>
|
3125
|
</li>
|
3126
|
|
3127
|
<li class="code system">
|
3128
|
|
3129
|
<ol start="9"
|
3130
|
class="pre-context" id="pre-40"
|
3131
|
onclick="toggle(40);">
|
3132
|
|
3133
|
<li class="pre-context-line"><code> #
|
3134
|
</code></li>
|
3135
|
|
3136
|
<li class="pre-context-line"><code> # Unescapes '/' and '.', expands +path_info+.
|
3137
|
</code></li>
|
3138
|
|
3139
|
<li class="pre-context-line"><code> # Thus <tt>GET /foo/%2e%2e%2fbar</tt> becomes <tt>GET /bar</tt>.
|
3140
|
</code></li>
|
3141
|
|
3142
|
<li class="pre-context-line"><code> class PathTraversal < Base
|
3143
|
</code></li>
|
3144
|
|
3145
|
<li class="pre-context-line"><code> def call(env)
|
3146
|
</code></li>
|
3147
|
|
3148
|
<li class="pre-context-line"><code> path_was = env["PATH_INFO"]
|
3149
|
</code></li>
|
3150
|
|
3151
|
<li class="pre-context-line"><code> env["PATH_INFO"] = cleanup path_was if path_was && !path_was.empty?
|
3152
|
</code></li>
|
3153
|
|
3154
|
</ol>
|
3155
|
|
3156
|
|
3157
|
<ol start="16" class="context" id="40"
|
3158
|
onclick="toggle(40);">
|
3159
|
<li class="context-line" id="context-40"><code> app.call env</code></li>
|
3160
|
</ol>
|
3161
|
|
3162
|
|
3163
|
<ol start="17" class="post-context"
|
3164
|
id="post-40" onclick="toggle(40);">
|
3165
|
|
3166
|
<li class="post-context-line"><code> ensure
|
3167
|
</code></li>
|
3168
|
|
3169
|
<li class="post-context-line"><code> env["PATH_INFO"] = path_was
|
3170
|
</code></li>
|
3171
|
|
3172
|
<li class="post-context-line"><code> end
|
3173
|
</code></li>
|
3174
|
|
3175
|
<li class="post-context-line"><code>
|
3176
|
</code></li>
|
3177
|
|
3178
|
<li class="post-context-line"><code> def cleanup(path)
|
3179
|
</code></li>
|
3180
|
|
3181
|
<li class="post-context-line"><code> parts = []
|
3182
|
</code></li>
|
3183
|
|
3184
|
<li class="post-context-line"><code> unescaped = path.gsub('%2e', '.').gsub('%2f', '/')
|
3185
|
</code></li>
|
3186
|
|
3187
|
</ol>
|
3188
|
|
3189
|
<div class="clear"></div>
|
3190
|
</li>
|
3191
|
|
3192
|
|
3193
|
|
3194
|
|
3195
|
|
3196
|
|
3197
|
|
3198
|
<li class="frame-info system">
|
3199
|
<code>/usr/lib/ruby/gems/1.8/gems/rack-protection-1.5.0/lib/rack/protection/json_csrf.rb</code> in
|
3200
|
<code><strong>call</strong></code>
|
3201
|
</li>
|
3202
|
|
3203
|
<li class="code system">
|
3204
|
|
3205
|
<ol start="11"
|
3206
|
class="pre-context" id="pre-41"
|
3207
|
onclick="toggle(41);">
|
3208
|
|
3209
|
<li class="pre-context-line"><code> # Array prototype has been patched to track data. Checks the referrer
|
3210
|
</code></li>
|
3211
|
|
3212
|
<li class="pre-context-line"><code> # even on GET requests if the content type is JSON.
|
3213
|
</code></li>
|
3214
|
|
3215
|
<li class="pre-context-line"><code> class JsonCsrf < Base
|
3216
|
</code></li>
|
3217
|
|
3218
|
<li class="pre-context-line"><code> default_reaction :deny
|
3219
|
</code></li>
|
3220
|
|
3221
|
<li class="pre-context-line"><code>
|
3222
|
</code></li>
|
3223
|
|
3224
|
<li class="pre-context-line"><code> def call(env)
|
3225
|
</code></li>
|
3226
|
|
3227
|
<li class="pre-context-line"><code> request = Request.new(env)
|
3228
|
</code></li>
|
3229
|
|
3230
|
</ol>
|
3231
|
|
3232
|
|
3233
|
<ol start="18" class="context" id="41"
|
3234
|
onclick="toggle(41);">
|
3235
|
<li class="context-line" id="context-41"><code> status, headers, body = app.call(env)</code></li>
|
3236
|
</ol>
|
3237
|
|
3238
|
|
3239
|
<ol start="19" class="post-context"
|
3240
|
id="post-41" onclick="toggle(41);">
|
3241
|
|
3242
|
<li class="post-context-line"><code>
|
3243
|
</code></li>
|
3244
|
|
3245
|
<li class="post-context-line"><code> if has_vector? request, headers
|
3246
|
</code></li>
|
3247
|
|
3248
|
<li class="post-context-line"><code> warn env, "attack prevented by #{self.class}"
|
3249
|
</code></li>
|
3250
|
|
3251
|
<li class="post-context-line"><code> react(env)
|
3252
|
</code></li>
|
3253
|
|
3254
|
<li class="post-context-line"><code> else
|
3255
|
</code></li>
|
3256
|
|
3257
|
<li class="post-context-line"><code> [status, headers, body]
|
3258
|
</code></li>
|
3259
|
|
3260
|
<li class="post-context-line"><code> end
|
3261
|
</code></li>
|
3262
|
|
3263
|
</ol>
|
3264
|
|
3265
|
<div class="clear"></div>
|
3266
|
</li>
|
3267
|
|
3268
|
|
3269
|
|
3270
|
|
3271
|
|
3272
|
|
3273
|
|
3274
|
<li class="frame-info system">
|
3275
|
<code>/usr/lib/ruby/gems/1.8/gems/rack-protection-1.5.0/lib/rack/protection/base.rb</code> in
|
3276
|
<code><strong>call</strong></code>
|
3277
|
</li>
|
3278
|
|
3279
|
<li class="code system">
|
3280
|
|
3281
|
<ol start="42"
|
3282
|
class="pre-context" id="pre-42"
|
3283
|
onclick="toggle(42);">
|
3284
|
|
3285
|
<li class="pre-context-line"><code> end
|
3286
|
</code></li>
|
3287
|
|
3288
|
<li class="pre-context-line"><code>
|
3289
|
</code></li>
|
3290
|
|
3291
|
<li class="pre-context-line"><code> def call(env)
|
3292
|
</code></li>
|
3293
|
|
3294
|
<li class="pre-context-line"><code> unless accepts? env
|
3295
|
</code></li>
|
3296
|
|
3297
|
<li class="pre-context-line"><code> warn env, "attack prevented by #{self.class}"
|
3298
|
</code></li>
|
3299
|
|
3300
|
<li class="pre-context-line"><code> result = react env
|
3301
|
</code></li>
|
3302
|
|
3303
|
<li class="pre-context-line"><code> end
|
3304
|
</code></li>
|
3305
|
|
3306
|
</ol>
|
3307
|
|
3308
|
|
3309
|
<ol start="49" class="context" id="42"
|
3310
|
onclick="toggle(42);">
|
3311
|
<li class="context-line" id="context-42"><code> result or app.call(env)</code></li>
|
3312
|
</ol>
|
3313
|
|
3314
|
|
3315
|
<ol start="50" class="post-context"
|
3316
|
id="post-42" onclick="toggle(42);">
|
3317
|
|
3318
|
<li class="post-context-line"><code> end
|
3319
|
</code></li>
|
3320
|
|
3321
|
<li class="post-context-line"><code>
|
3322
|
</code></li>
|
3323
|
|
3324
|
<li class="post-context-line"><code> def react(env)
|
3325
|
</code></li>
|
3326
|
|
3327
|
<li class="post-context-line"><code> result = send(options[:reaction], env)
|
3328
|
</code></li>
|
3329
|
|
3330
|
<li class="post-context-line"><code> result if Array === result and result.size == 3
|
3331
|
</code></li>
|
3332
|
|
3333
|
<li class="post-context-line"><code> end
|
3334
|
</code></li>
|
3335
|
|
3336
|
<li class="post-context-line"><code>
|
3337
|
</code></li>
|
3338
|
|
3339
|
</ol>
|
3340
|
|
3341
|
<div class="clear"></div>
|
3342
|
</li>
|
3343
|
|
3344
|
|
3345
|
|
3346
|
|
3347
|
|
3348
|
|
3349
|
|
3350
|
<li class="frame-info system">
|
3351
|
<code>/usr/lib/ruby/gems/1.8/gems/rack-protection-1.5.0/lib/rack/protection/frame_options.rb</code> in
|
3352
|
<code><strong>call</strong></code>
|
3353
|
</li>
|
3354
|
|
3355
|
<li class="code system">
|
3356
|
|
3357
|
<ol start="24"
|
3358
|
class="pre-context" id="pre-43"
|
3359
|
onclick="toggle(43);">
|
3360
|
|
3361
|
<li class="pre-context-line"><code> frame_options = options[:frame_options]
|
3362
|
</code></li>
|
3363
|
|
3364
|
<li class="pre-context-line"><code> frame_options = options[:frame_options].to_s.upcase unless frame_options.respond_to? :to_str
|
3365
|
</code></li>
|
3366
|
|
3367
|
<li class="pre-context-line"><code> frame_options.to_str
|
3368
|
</code></li>
|
3369
|
|
3370
|
<li class="pre-context-line"><code> end
|
3371
|
</code></li>
|
3372
|
|
3373
|
<li class="pre-context-line"><code> end
|
3374
|
</code></li>
|
3375
|
|
3376
|
<li class="pre-context-line"><code>
|
3377
|
</code></li>
|
3378
|
|
3379
|
<li class="pre-context-line"><code> def call(env)
|
3380
|
</code></li>
|
3381
|
|
3382
|
</ol>
|
3383
|
|
3384
|
|
3385
|
<ol start="31" class="context" id="43"
|
3386
|
onclick="toggle(43);">
|
3387
|
<li class="context-line" id="context-43"><code> status, headers, body = @app.call(env)</code></li>
|
3388
|
</ol>
|
3389
|
|
3390
|
|
3391
|
<ol start="32" class="post-context"
|
3392
|
id="post-43" onclick="toggle(43);">
|
3393
|
|
3394
|
<li class="post-context-line"><code> headers['X-Frame-Options'] ||= frame_options if html? headers
|
3395
|
</code></li>
|
3396
|
|
3397
|
<li class="post-context-line"><code> [status, headers, body]
|
3398
|
</code></li>
|
3399
|
|
3400
|
<li class="post-context-line"><code> end
|
3401
|
</code></li>
|
3402
|
|
3403
|
<li class="post-context-line"><code> end
|
3404
|
</code></li>
|
3405
|
|
3406
|
<li class="post-context-line"><code> end
|
3407
|
</code></li>
|
3408
|
|
3409
|
<li class="post-context-line"><code>end
|
3410
|
</code></li>
|
3411
|
|
3412
|
</ol>
|
3413
|
|
3414
|
<div class="clear"></div>
|
3415
|
</li>
|
3416
|
|
3417
|
|
3418
|
|
3419
|
|
3420
|
|
3421
|
|
3422
|
|
3423
|
<li class="frame-info system">
|
3424
|
<code>/usr/lib/ruby/gems/1.8/gems/rack-1.5.2/lib/rack/nulllogger.rb</code> in
|
3425
|
<code><strong>call</strong></code>
|
3426
|
</li>
|
3427
|
|
3428
|
<li class="code system">
|
3429
|
|
3430
|
<ol start="2"
|
3431
|
class="pre-context" id="pre-44"
|
3432
|
onclick="toggle(44);">
|
3433
|
|
3434
|
<li class="pre-context-line"><code> class NullLogger
|
3435
|
</code></li>
|
3436
|
|
3437
|
<li class="pre-context-line"><code> def initialize(app)
|
3438
|
</code></li>
|
3439
|
|
3440
|
<li class="pre-context-line"><code> @app = app
|
3441
|
</code></li>
|
3442
|
|
3443
|
<li class="pre-context-line"><code> end
|
3444
|
</code></li>
|
3445
|
|
3446
|
<li class="pre-context-line"><code>
|
3447
|
</code></li>
|
3448
|
|
3449
|
<li class="pre-context-line"><code> def call(env)
|
3450
|
</code></li>
|
3451
|
|
3452
|
<li class="pre-context-line"><code> env['rack.logger'] = self
|
3453
|
</code></li>
|
3454
|
|
3455
|
</ol>
|
3456
|
|
3457
|
|
3458
|
<ol start="9" class="context" id="44"
|
3459
|
onclick="toggle(44);">
|
3460
|
<li class="context-line" id="context-44"><code> @app.call(env)</code></li>
|
3461
|
</ol>
|
3462
|
|
3463
|
|
3464
|
<ol start="10" class="post-context"
|
3465
|
id="post-44" onclick="toggle(44);">
|
3466
|
|
3467
|
<li class="post-context-line"><code> end
|
3468
|
</code></li>
|
3469
|
|
3470
|
<li class="post-context-line"><code>
|
3471
|
</code></li>
|
3472
|
|
3473
|
<li class="post-context-line"><code> def info(progname = nil, &block); end
|
3474
|
</code></li>
|
3475
|
|
3476
|
<li class="post-context-line"><code> def debug(progname = nil, &block); end
|
3477
|
</code></li>
|
3478
|
|
3479
|
<li class="post-context-line"><code> def warn(progname = nil, &block); end
|
3480
|
</code></li>
|
3481
|
|
3482
|
<li class="post-context-line"><code> def error(progname = nil, &block); end
|
3483
|
</code></li>
|
3484
|
|
3485
|
<li class="post-context-line"><code> def fatal(progname = nil, &block); end
|
3486
|
</code></li>
|
3487
|
|
3488
|
</ol>
|
3489
|
|
3490
|
<div class="clear"></div>
|
3491
|
</li>
|
3492
|
|
3493
|
|
3494
|
|
3495
|
|
3496
|
|
3497
|
|
3498
|
|
3499
|
<li class="frame-info system">
|
3500
|
<code>/usr/lib/ruby/gems/1.8/gems/rack-1.5.2/lib/rack/head.rb</code> in
|
3501
|
<code><strong>call</strong></code>
|
3502
|
</li>
|
3503
|
|
3504
|
<li class="code system">
|
3505
|
|
3506
|
<ol start="4"
|
3507
|
class="pre-context" id="pre-45"
|
3508
|
onclick="toggle(45);">
|
3509
|
|
3510
|
<li class="pre-context-line"><code> # Rack::Head returns an empty body for all HEAD requests. It leaves
|
3511
|
</code></li>
|
3512
|
|
3513
|
<li class="pre-context-line"><code> # all other requests unchanged.
|
3514
|
</code></li>
|
3515
|
|
3516
|
<li class="pre-context-line"><code> def initialize(app)
|
3517
|
</code></li>
|
3518
|
|
3519
|
<li class="pre-context-line"><code> @app = app
|
3520
|
</code></li>
|
3521
|
|
3522
|
<li class="pre-context-line"><code> end
|
3523
|
</code></li>
|
3524
|
|
3525
|
<li class="pre-context-line"><code>
|
3526
|
</code></li>
|
3527
|
|
3528
|
<li class="pre-context-line"><code> def call(env)
|
3529
|
</code></li>
|
3530
|
|
3531
|
</ol>
|
3532
|
|
3533
|
|
3534
|
<ol start="11" class="context" id="45"
|
3535
|
onclick="toggle(45);">
|
3536
|
<li class="context-line" id="context-45"><code> status, headers, body = @app.call(env)</code></li>
|
3537
|
</ol>
|
3538
|
|
3539
|
|
3540
|
<ol start="12" class="post-context"
|
3541
|
id="post-45" onclick="toggle(45);">
|
3542
|
|
3543
|
<li class="post-context-line"><code>
|
3544
|
</code></li>
|
3545
|
|
3546
|
<li class="post-context-line"><code> if env["REQUEST_METHOD"] == "HEAD"
|
3547
|
</code></li>
|
3548
|
|
3549
|
<li class="post-context-line"><code> body.close if body.respond_to? :close
|
3550
|
</code></li>
|
3551
|
|
3552
|
<li class="post-context-line"><code> [status, headers, []]
|
3553
|
</code></li>
|
3554
|
|
3555
|
<li class="post-context-line"><code> else
|
3556
|
</code></li>
|
3557
|
|
3558
|
<li class="post-context-line"><code> [status, headers, body]
|
3559
|
</code></li>
|
3560
|
|
3561
|
<li class="post-context-line"><code> end
|
3562
|
</code></li>
|
3563
|
|
3564
|
</ol>
|
3565
|
|
3566
|
<div class="clear"></div>
|
3567
|
</li>
|
3568
|
|
3569
|
|
3570
|
|
3571
|
|
3572
|
|
3573
|
|
3574
|
|
3575
|
<li class="frame-info system">
|
3576
|
<code>/usr/lib/ruby/gems/1.8/gems/rack-1.5.2/lib/rack/methodoverride.rb</code> in
|
3577
|
<code><strong>call</strong></code>
|
3578
|
</li>
|
3579
|
|
3580
|
<li class="code system">
|
3581
|
|
3582
|
<ol start="14"
|
3583
|
class="pre-context" id="pre-46"
|
3584
|
onclick="toggle(46);">
|
3585
|
|
3586
|
<li class="pre-context-line"><code> method = method_override(env)
|
3587
|
</code></li>
|
3588
|
|
3589
|
<li class="pre-context-line"><code> if HTTP_METHODS.include?(method)
|
3590
|
</code></li>
|
3591
|
|
3592
|
<li class="pre-context-line"><code> env["rack.methodoverride.original_method"] = env["REQUEST_METHOD"]
|
3593
|
</code></li>
|
3594
|
|
3595
|
<li class="pre-context-line"><code> env["REQUEST_METHOD"] = method
|
3596
|
</code></li>
|
3597
|
|
3598
|
<li class="pre-context-line"><code> end
|
3599
|
</code></li>
|
3600
|
|
3601
|
<li class="pre-context-line"><code> end
|
3602
|
</code></li>
|
3603
|
|
3604
|
<li class="pre-context-line"><code>
|
3605
|
</code></li>
|
3606
|
|
3607
|
</ol>
|
3608
|
|
3609
|
|
3610
|
<ol start="21" class="context" id="46"
|
3611
|
onclick="toggle(46);">
|
3612
|
<li class="context-line" id="context-46"><code> @app.call(env)</code></li>
|
3613
|
</ol>
|
3614
|
|
3615
|
|
3616
|
<ol start="22" class="post-context"
|
3617
|
id="post-46" onclick="toggle(46);">
|
3618
|
|
3619
|
<li class="post-context-line"><code> end
|
3620
|
</code></li>
|
3621
|
|
3622
|
<li class="post-context-line"><code>
|
3623
|
</code></li>
|
3624
|
|
3625
|
<li class="post-context-line"><code> def method_override(env)
|
3626
|
</code></li>
|
3627
|
|
3628
|
<li class="post-context-line"><code> req = Request.new(env)
|
3629
|
</code></li>
|
3630
|
|
3631
|
<li class="post-context-line"><code> method = req.POST[METHOD_OVERRIDE_PARAM_KEY] ||
|
3632
|
</code></li>
|
3633
|
|
3634
|
<li class="post-context-line"><code> env[HTTP_METHOD_OVERRIDE_HEADER]
|
3635
|
</code></li>
|
3636
|
|
3637
|
<li class="post-context-line"><code> method.to_s.upcase
|
3638
|
</code></li>
|
3639
|
|
3640
|
</ol>
|
3641
|
|
3642
|
<div class="clear"></div>
|
3643
|
</li>
|
3644
|
|
3645
|
|
3646
|
|
3647
|
|
3648
|
|
3649
|
|
3650
|
|
3651
|
<li class="frame-info framework">
|
3652
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/showexceptions.rb</code> in
|
3653
|
<code><strong>call</strong></code>
|
3654
|
</li>
|
3655
|
|
3656
|
<li class="code framework">
|
3657
|
|
3658
|
<ol start="14"
|
3659
|
class="pre-context" id="pre-47"
|
3660
|
onclick="toggle(47);">
|
3661
|
|
3662
|
<li class="pre-context-line"><code>
|
3663
|
</code></li>
|
3664
|
|
3665
|
<li class="pre-context-line"><code> def initialize(app)
|
3666
|
</code></li>
|
3667
|
|
3668
|
<li class="pre-context-line"><code> @app = app
|
3669
|
</code></li>
|
3670
|
|
3671
|
<li class="pre-context-line"><code> @template = ERB.new(TEMPLATE)
|
3672
|
</code></li>
|
3673
|
|
3674
|
<li class="pre-context-line"><code> end
|
3675
|
</code></li>
|
3676
|
|
3677
|
<li class="pre-context-line"><code>
|
3678
|
</code></li>
|
3679
|
|
3680
|
<li class="pre-context-line"><code> def call(env)
|
3681
|
</code></li>
|
3682
|
|
3683
|
</ol>
|
3684
|
|
3685
|
|
3686
|
<ol start="21" class="context" id="47"
|
3687
|
onclick="toggle(47);">
|
3688
|
<li class="context-line" id="context-47"><code> @app.call(env)</code></li>
|
3689
|
</ol>
|
3690
|
|
3691
|
|
3692
|
<ol start="22" class="post-context"
|
3693
|
id="post-47" onclick="toggle(47);">
|
3694
|
|
3695
|
<li class="post-context-line"><code> rescue Exception => e
|
3696
|
</code></li>
|
3697
|
|
3698
|
<li class="post-context-line"><code> errors, env["rack.errors"] = env["rack.errors"], @@eats_errors
|
3699
|
</code></li>
|
3700
|
|
3701
|
<li class="post-context-line"><code>
|
3702
|
</code></li>
|
3703
|
|
3704
|
<li class="post-context-line"><code> if prefers_plain_text?(env)
|
3705
|
</code></li>
|
3706
|
|
3707
|
<li class="post-context-line"><code> content_type = "text/plain"
|
3708
|
</code></li>
|
3709
|
|
3710
|
<li class="post-context-line"><code> body = [dump_exception(e)]
|
3711
|
</code></li>
|
3712
|
|
3713
|
<li class="post-context-line"><code> else
|
3714
|
</code></li>
|
3715
|
|
3716
|
</ol>
|
3717
|
|
3718
|
<div class="clear"></div>
|
3719
|
</li>
|
3720
|
|
3721
|
|
3722
|
|
3723
|
|
3724
|
|
3725
|
|
3726
|
|
3727
|
<li class="frame-info framework">
|
3728
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
3729
|
<code><strong>call</strong></code>
|
3730
|
</li>
|
3731
|
|
3732
|
<li class="code framework">
|
3733
|
|
3734
|
<ol start="168"
|
3735
|
class="pre-context" id="pre-48"
|
3736
|
onclick="toggle(48);">
|
3737
|
|
3738
|
<li class="pre-context-line"><code> # Some Rack handlers (Thin, Rainbows!) implement an extended body object protocol, however,
|
3739
|
</code></li>
|
3740
|
|
3741
|
<li class="pre-context-line"><code> # some middleware (namely Rack::Lint) will break it by not mirroring the methods in question.
|
3742
|
</code></li>
|
3743
|
|
3744
|
<li class="pre-context-line"><code> # This middleware will detect an extended body object and will make sure it reaches the
|
3745
|
</code></li>
|
3746
|
|
3747
|
<li class="pre-context-line"><code> # handler directly. We do this here, so our middleware and middleware set up by the app will
|
3748
|
</code></li>
|
3749
|
|
3750
|
<li class="pre-context-line"><code> # still be able to run.
|
3751
|
</code></li>
|
3752
|
|
3753
|
<li class="pre-context-line"><code> class ExtendedRack < Struct.new(:app)
|
3754
|
</code></li>
|
3755
|
|
3756
|
<li class="pre-context-line"><code> def call(env)
|
3757
|
</code></li>
|
3758
|
|
3759
|
</ol>
|
3760
|
|
3761
|
|
3762
|
<ol start="175" class="context" id="48"
|
3763
|
onclick="toggle(48);">
|
3764
|
<li class="context-line" id="context-48"><code> result, callback = app.call(env), env['async.callback']</code></li>
|
3765
|
</ol>
|
3766
|
|
3767
|
|
3768
|
<ol start="176" class="post-context"
|
3769
|
id="post-48" onclick="toggle(48);">
|
3770
|
|
3771
|
<li class="post-context-line"><code> return result unless callback and async?(*result)
|
3772
|
</code></li>
|
3773
|
|
3774
|
<li class="post-context-line"><code> after_response { callback.call result }
|
3775
|
</code></li>
|
3776
|
|
3777
|
<li class="post-context-line"><code> setup_close(env, *result)
|
3778
|
</code></li>
|
3779
|
|
3780
|
<li class="post-context-line"><code> throw :async
|
3781
|
</code></li>
|
3782
|
|
3783
|
<li class="post-context-line"><code> end
|
3784
|
</code></li>
|
3785
|
|
3786
|
<li class="post-context-line"><code>
|
3787
|
</code></li>
|
3788
|
|
3789
|
<li class="post-context-line"><code> private
|
3790
|
</code></li>
|
3791
|
|
3792
|
</ol>
|
3793
|
|
3794
|
<div class="clear"></div>
|
3795
|
</li>
|
3796
|
|
3797
|
|
3798
|
|
3799
|
|
3800
|
|
3801
|
|
3802
|
|
3803
|
<li class="frame-info framework">
|
3804
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
3805
|
<code><strong>call</strong></code>
|
3806
|
</li>
|
3807
|
|
3808
|
<li class="code framework">
|
3809
|
|
3810
|
<ol start="1942"
|
3811
|
class="pre-context" id="pre-49"
|
3812
|
onclick="toggle(49);">
|
3813
|
|
3814
|
<li class="pre-context-line"><code> end
|
3815
|
</code></li>
|
3816
|
|
3817
|
<li class="pre-context-line"><code>
|
3818
|
</code></li>
|
3819
|
|
3820
|
<li class="pre-context-line"><code> def helpers
|
3821
|
</code></li>
|
3822
|
|
3823
|
<li class="pre-context-line"><code> @instance
|
3824
|
</code></li>
|
3825
|
|
3826
|
<li class="pre-context-line"><code> end
|
3827
|
</code></li>
|
3828
|
|
3829
|
<li class="pre-context-line"><code>
|
3830
|
</code></li>
|
3831
|
|
3832
|
<li class="pre-context-line"><code> def call(env)
|
3833
|
</code></li>
|
3834
|
|
3835
|
</ol>
|
3836
|
|
3837
|
|
3838
|
<ol start="1949" class="context" id="49"
|
3839
|
onclick="toggle(49);">
|
3840
|
<li class="context-line" id="context-49"><code> @stack.call(env)</code></li>
|
3841
|
</ol>
|
3842
|
|
3843
|
|
3844
|
<ol start="1950" class="post-context"
|
3845
|
id="post-49" onclick="toggle(49);">
|
3846
|
|
3847
|
<li class="post-context-line"><code> end
|
3848
|
</code></li>
|
3849
|
|
3850
|
<li class="post-context-line"><code>
|
3851
|
</code></li>
|
3852
|
|
3853
|
<li class="post-context-line"><code> def inspect
|
3854
|
</code></li>
|
3855
|
|
3856
|
<li class="post-context-line"><code> "#<#{@instance.class} app_file=#{settings.app_file.inspect}>"
|
3857
|
</code></li>
|
3858
|
|
3859
|
<li class="post-context-line"><code> end
|
3860
|
</code></li>
|
3861
|
|
3862
|
<li class="post-context-line"><code> end
|
3863
|
</code></li>
|
3864
|
|
3865
|
<li class="post-context-line"><code>
|
3866
|
</code></li>
|
3867
|
|
3868
|
</ol>
|
3869
|
|
3870
|
<div class="clear"></div>
|
3871
|
</li>
|
3872
|
|
3873
|
|
3874
|
|
3875
|
|
3876
|
|
3877
|
|
3878
|
|
3879
|
<li class="frame-info framework">
|
3880
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
3881
|
<code><strong>call</strong></code>
|
3882
|
</li>
|
3883
|
|
3884
|
<li class="code framework">
|
3885
|
|
3886
|
<ol start="1442"
|
3887
|
class="pre-context" id="pre-50"
|
3888
|
onclick="toggle(50);">
|
3889
|
|
3890
|
<li class="pre-context-line"><code> setup_default_middleware builder
|
3891
|
</code></li>
|
3892
|
|
3893
|
<li class="pre-context-line"><code> setup_middleware builder
|
3894
|
</code></li>
|
3895
|
|
3896
|
<li class="pre-context-line"><code> builder.run app
|
3897
|
</code></li>
|
3898
|
|
3899
|
<li class="pre-context-line"><code> builder
|
3900
|
</code></li>
|
3901
|
|
3902
|
<li class="pre-context-line"><code> end
|
3903
|
</code></li>
|
3904
|
|
3905
|
<li class="pre-context-line"><code>
|
3906
|
</code></li>
|
3907
|
|
3908
|
<li class="pre-context-line"><code> def call(env)
|
3909
|
</code></li>
|
3910
|
|
3911
|
</ol>
|
3912
|
|
3913
|
|
3914
|
<ol start="1449" class="context" id="50"
|
3915
|
onclick="toggle(50);">
|
3916
|
<li class="context-line" id="context-50"><code> synchronize { prototype.call(env) }</code></li>
|
3917
|
</ol>
|
3918
|
|
3919
|
|
3920
|
<ol start="1450" class="post-context"
|
3921
|
id="post-50" onclick="toggle(50);">
|
3922
|
|
3923
|
<li class="post-context-line"><code> end
|
3924
|
</code></li>
|
3925
|
|
3926
|
<li class="post-context-line"><code>
|
3927
|
</code></li>
|
3928
|
|
3929
|
<li class="post-context-line"><code> # Like Kernel#caller but excluding certain magic entries and without
|
3930
|
</code></li>
|
3931
|
|
3932
|
<li class="post-context-line"><code> # line / method information; the resulting array contains filenames only.
|
3933
|
</code></li>
|
3934
|
|
3935
|
<li class="post-context-line"><code> def caller_files
|
3936
|
</code></li>
|
3937
|
|
3938
|
<li class="post-context-line"><code> cleaned_caller(1).flatten
|
3939
|
</code></li>
|
3940
|
|
3941
|
<li class="post-context-line"><code> end
|
3942
|
</code></li>
|
3943
|
|
3944
|
</ol>
|
3945
|
|
3946
|
<div class="clear"></div>
|
3947
|
</li>
|
3948
|
|
3949
|
|
3950
|
|
3951
|
|
3952
|
|
3953
|
|
3954
|
|
3955
|
<li class="frame-info framework">
|
3956
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
3957
|
<code><strong>synchronize</strong></code>
|
3958
|
</li>
|
3959
|
|
3960
|
<li class="code framework">
|
3961
|
|
3962
|
<ol start="1719"
|
3963
|
class="pre-context" id="pre-51"
|
3964
|
onclick="toggle(51);">
|
3965
|
|
3966
|
<li class="pre-context-line"><code> end
|
3967
|
</code></li>
|
3968
|
|
3969
|
<li class="pre-context-line"><code>
|
3970
|
</code></li>
|
3971
|
|
3972
|
<li class="pre-context-line"><code> @@mutex = Mutex.new
|
3973
|
</code></li>
|
3974
|
|
3975
|
<li class="pre-context-line"><code> def synchronize(&block)
|
3976
|
</code></li>
|
3977
|
|
3978
|
<li class="pre-context-line"><code> if lock?
|
3979
|
</code></li>
|
3980
|
|
3981
|
<li class="pre-context-line"><code> @@mutex.synchronize(&block)
|
3982
|
</code></li>
|
3983
|
|
3984
|
<li class="pre-context-line"><code> else
|
3985
|
</code></li>
|
3986
|
|
3987
|
</ol>
|
3988
|
|
3989
|
|
3990
|
<ol start="1726" class="context" id="51"
|
3991
|
onclick="toggle(51);">
|
3992
|
<li class="context-line" id="context-51"><code> yield</code></li>
|
3993
|
</ol>
|
3994
|
|
3995
|
|
3996
|
<ol start="1727" class="post-context"
|
3997
|
id="post-51" onclick="toggle(51);">
|
3998
|
|
3999
|
<li class="post-context-line"><code> end
|
4000
|
</code></li>
|
4001
|
|
4002
|
<li class="post-context-line"><code> end
|
4003
|
</code></li>
|
4004
|
|
4005
|
<li class="post-context-line"><code>
|
4006
|
</code></li>
|
4007
|
|
4008
|
<li class="post-context-line"><code> # used for deprecation warnings
|
4009
|
</code></li>
|
4010
|
|
4011
|
<li class="post-context-line"><code> def warn(message)
|
4012
|
</code></li>
|
4013
|
|
4014
|
<li class="post-context-line"><code> super message + "\n\tfrom #{cleaned_caller.first.join(':')}"
|
4015
|
</code></li>
|
4016
|
|
4017
|
<li class="post-context-line"><code> end
|
4018
|
</code></li>
|
4019
|
|
4020
|
</ol>
|
4021
|
|
4022
|
<div class="clear"></div>
|
4023
|
</li>
|
4024
|
|
4025
|
|
4026
|
|
4027
|
|
4028
|
|
4029
|
|
4030
|
|
4031
|
<li class="frame-info framework">
|
4032
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
4033
|
<code><strong>call</strong></code>
|
4034
|
</li>
|
4035
|
|
4036
|
<li class="code framework">
|
4037
|
|
4038
|
<ol start="1442"
|
4039
|
class="pre-context" id="pre-52"
|
4040
|
onclick="toggle(52);">
|
4041
|
|
4042
|
<li class="pre-context-line"><code> setup_default_middleware builder
|
4043
|
</code></li>
|
4044
|
|
4045
|
<li class="pre-context-line"><code> setup_middleware builder
|
4046
|
</code></li>
|
4047
|
|
4048
|
<li class="pre-context-line"><code> builder.run app
|
4049
|
</code></li>
|
4050
|
|
4051
|
<li class="pre-context-line"><code> builder
|
4052
|
</code></li>
|
4053
|
|
4054
|
<li class="pre-context-line"><code> end
|
4055
|
</code></li>
|
4056
|
|
4057
|
<li class="pre-context-line"><code>
|
4058
|
</code></li>
|
4059
|
|
4060
|
<li class="pre-context-line"><code> def call(env)
|
4061
|
</code></li>
|
4062
|
|
4063
|
</ol>
|
4064
|
|
4065
|
|
4066
|
<ol start="1449" class="context" id="52"
|
4067
|
onclick="toggle(52);">
|
4068
|
<li class="context-line" id="context-52"><code> synchronize { prototype.call(env) }</code></li>
|
4069
|
</ol>
|
4070
|
|
4071
|
|
4072
|
<ol start="1450" class="post-context"
|
4073
|
id="post-52" onclick="toggle(52);">
|
4074
|
|
4075
|
<li class="post-context-line"><code> end
|
4076
|
</code></li>
|
4077
|
|
4078
|
<li class="post-context-line"><code>
|
4079
|
</code></li>
|
4080
|
|
4081
|
<li class="post-context-line"><code> # Like Kernel#caller but excluding certain magic entries and without
|
4082
|
</code></li>
|
4083
|
|
4084
|
<li class="post-context-line"><code> # line / method information; the resulting array contains filenames only.
|
4085
|
</code></li>
|
4086
|
|
4087
|
<li class="post-context-line"><code> def caller_files
|
4088
|
</code></li>
|
4089
|
|
4090
|
<li class="post-context-line"><code> cleaned_caller(1).flatten
|
4091
|
</code></li>
|
4092
|
|
4093
|
<li class="post-context-line"><code> end
|
4094
|
</code></li>
|
4095
|
|
4096
|
</ol>
|
4097
|
|
4098
|
<div class="clear"></div>
|
4099
|
</li>
|
4100
|
|
4101
|
|
4102
|
|
4103
|
|
4104
|
|
4105
|
|
4106
|
|
4107
|
<li class="frame-info system">
|
4108
|
<code>/usr/lib/ruby/gems/1.8/gems/thin-1.5.1/lib/thin/connection.rb</code> in
|
4109
|
<code><strong>pre_process</strong></code>
|
4110
|
</li>
|
4111
|
|
4112
|
<li class="code system">
|
4113
|
|
4114
|
<ol start="74"
|
4115
|
class="pre-context" id="pre-53"
|
4116
|
onclick="toggle(53);">
|
4117
|
|
4118
|
<li class="pre-context-line"><code>
|
4119
|
</code></li>
|
4120
|
|
4121
|
<li class="pre-context-line"><code> # When we're under a non-async framework like rails, we can still spawn
|
4122
|
</code></li>
|
4123
|
|
4124
|
<li class="pre-context-line"><code> # off async responses using the callback info, so there's little point
|
4125
|
</code></li>
|
4126
|
|
4127
|
<li class="pre-context-line"><code> # in removing this.
|
4128
|
</code></li>
|
4129
|
|
4130
|
<li class="pre-context-line"><code> response = AsyncResponse
|
4131
|
</code></li>
|
4132
|
|
4133
|
<li class="pre-context-line"><code> catch(:async) do
|
4134
|
</code></li>
|
4135
|
|
4136
|
<li class="pre-context-line"><code> # Process the request calling the Rack adapter
|
4137
|
</code></li>
|
4138
|
|
4139
|
</ol>
|
4140
|
|
4141
|
|
4142
|
<ol start="81" class="context" id="53"
|
4143
|
onclick="toggle(53);">
|
4144
|
<li class="context-line" id="context-53"><code> response = @app.call(@request.env)</code></li>
|
4145
|
</ol>
|
4146
|
|
4147
|
|
4148
|
<ol start="82" class="post-context"
|
4149
|
id="post-53" onclick="toggle(53);">
|
4150
|
|
4151
|
<li class="post-context-line"><code> end
|
4152
|
</code></li>
|
4153
|
|
4154
|
<li class="post-context-line"><code> response
|
4155
|
</code></li>
|
4156
|
|
4157
|
<li class="post-context-line"><code> rescue Exception
|
4158
|
</code></li>
|
4159
|
|
4160
|
<li class="post-context-line"><code> handle_error
|
4161
|
</code></li>
|
4162
|
|
4163
|
<li class="post-context-line"><code> # Pass through error response
|
4164
|
</code></li>
|
4165
|
|
4166
|
<li class="post-context-line"><code> can_persist? && @request.persistent? ? Response::PERSISTENT_ERROR : Response::ERROR
|
4167
|
</code></li>
|
4168
|
|
4169
|
<li class="post-context-line"><code> end
|
4170
|
</code></li>
|
4171
|
|
4172
|
</ol>
|
4173
|
|
4174
|
<div class="clear"></div>
|
4175
|
</li>
|
4176
|
|
4177
|
|
4178
|
|
4179
|
|
4180
|
|
4181
|
|
4182
|
|
4183
|
<li class="frame-info system">
|
4184
|
<code>/usr/lib/ruby/gems/1.8/gems/thin-1.5.1/lib/thin/connection.rb</code> in
|
4185
|
<code><strong>catch</strong></code>
|
4186
|
</li>
|
4187
|
|
4188
|
<li class="code system">
|
4189
|
|
4190
|
<ol start="72"
|
4191
|
class="pre-context" id="pre-54"
|
4192
|
onclick="toggle(54);">
|
4193
|
|
4194
|
<li class="pre-context-line"><code> end
|
4195
|
</code></li>
|
4196
|
|
4197
|
<li class="pre-context-line"><code> end
|
4198
|
</code></li>
|
4199
|
|
4200
|
<li class="pre-context-line"><code>
|
4201
|
</code></li>
|
4202
|
|
4203
|
<li class="pre-context-line"><code> # When we're under a non-async framework like rails, we can still spawn
|
4204
|
</code></li>
|
4205
|
|
4206
|
<li class="pre-context-line"><code> # off async responses using the callback info, so there's little point
|
4207
|
</code></li>
|
4208
|
|
4209
|
<li class="pre-context-line"><code> # in removing this.
|
4210
|
</code></li>
|
4211
|
|
4212
|
<li class="pre-context-line"><code> response = AsyncResponse
|
4213
|
</code></li>
|
4214
|
|
4215
|
</ol>
|
4216
|
|
4217
|
|
4218
|
<ol start="79" class="context" id="54"
|
4219
|
onclick="toggle(54);">
|
4220
|
<li class="context-line" id="context-54"><code> catch(:async) do</code></li>
|
4221
|
</ol>
|
4222
|
|
4223
|
|
4224
|
<ol start="80" class="post-context"
|
4225
|
id="post-54" onclick="toggle(54);">
|
4226
|
|
4227
|
<li class="post-context-line"><code> # Process the request calling the Rack adapter
|
4228
|
</code></li>
|
4229
|
|
4230
|
<li class="post-context-line"><code> response = @app.call(@request.env)
|
4231
|
</code></li>
|
4232
|
|
4233
|
<li class="post-context-line"><code> end
|
4234
|
</code></li>
|
4235
|
|
4236
|
<li class="post-context-line"><code> response
|
4237
|
</code></li>
|
4238
|
|
4239
|
<li class="post-context-line"><code> rescue Exception
|
4240
|
</code></li>
|
4241
|
|
4242
|
<li class="post-context-line"><code> handle_error
|
4243
|
</code></li>
|
4244
|
|
4245
|
<li class="post-context-line"><code> # Pass through error response
|
4246
|
</code></li>
|
4247
|
|
4248
|
</ol>
|
4249
|
|
4250
|
<div class="clear"></div>
|
4251
|
</li>
|
4252
|
|
4253
|
|
4254
|
|
4255
|
|
4256
|
|
4257
|
|
4258
|
|
4259
|
<li class="frame-info system">
|
4260
|
<code>/usr/lib/ruby/gems/1.8/gems/thin-1.5.1/lib/thin/connection.rb</code> in
|
4261
|
<code><strong>pre_process</strong></code>
|
4262
|
</li>
|
4263
|
|
4264
|
<li class="code system">
|
4265
|
|
4266
|
<ol start="72"
|
4267
|
class="pre-context" id="pre-55"
|
4268
|
onclick="toggle(55);">
|
4269
|
|
4270
|
<li class="pre-context-line"><code> end
|
4271
|
</code></li>
|
4272
|
|
4273
|
<li class="pre-context-line"><code> end
|
4274
|
</code></li>
|
4275
|
|
4276
|
<li class="pre-context-line"><code>
|
4277
|
</code></li>
|
4278
|
|
4279
|
<li class="pre-context-line"><code> # When we're under a non-async framework like rails, we can still spawn
|
4280
|
</code></li>
|
4281
|
|
4282
|
<li class="pre-context-line"><code> # off async responses using the callback info, so there's little point
|
4283
|
</code></li>
|
4284
|
|
4285
|
<li class="pre-context-line"><code> # in removing this.
|
4286
|
</code></li>
|
4287
|
|
4288
|
<li class="pre-context-line"><code> response = AsyncResponse
|
4289
|
</code></li>
|
4290
|
|
4291
|
</ol>
|
4292
|
|
4293
|
|
4294
|
<ol start="79" class="context" id="55"
|
4295
|
onclick="toggle(55);">
|
4296
|
<li class="context-line" id="context-55"><code> catch(:async) do</code></li>
|
4297
|
</ol>
|
4298
|
|
4299
|
|
4300
|
<ol start="80" class="post-context"
|
4301
|
id="post-55" onclick="toggle(55);">
|
4302
|
|
4303
|
<li class="post-context-line"><code> # Process the request calling the Rack adapter
|
4304
|
</code></li>
|
4305
|
|
4306
|
<li class="post-context-line"><code> response = @app.call(@request.env)
|
4307
|
</code></li>
|
4308
|
|
4309
|
<li class="post-context-line"><code> end
|
4310
|
</code></li>
|
4311
|
|
4312
|
<li class="post-context-line"><code> response
|
4313
|
</code></li>
|
4314
|
|
4315
|
<li class="post-context-line"><code> rescue Exception
|
4316
|
</code></li>
|
4317
|
|
4318
|
<li class="post-context-line"><code> handle_error
|
4319
|
</code></li>
|
4320
|
|
4321
|
<li class="post-context-line"><code> # Pass through error response
|
4322
|
</code></li>
|
4323
|
|
4324
|
</ol>
|
4325
|
|
4326
|
<div class="clear"></div>
|
4327
|
</li>
|
4328
|
|
4329
|
|
4330
|
|
4331
|
|
4332
|
|
4333
|
|
4334
|
|
4335
|
<li class="frame-info system">
|
4336
|
<code>/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb</code> in
|
4337
|
<code><strong>call</strong></code>
|
4338
|
</li>
|
4339
|
|
4340
|
<li class="code system">
|
4341
|
|
4342
|
<ol start="1053"
|
4343
|
class="pre-context" id="pre-56"
|
4344
|
onclick="toggle(56);">
|
4345
|
|
4346
|
<li class="pre-context-line"><code> end
|
4347
|
</code></li>
|
4348
|
|
4349
|
<li class="pre-context-line"><code>
|
4350
|
</code></li>
|
4351
|
|
4352
|
<li class="pre-context-line"><code> def self.spawn_threadpool # :nodoc:
|
4353
|
</code></li>
|
4354
|
|
4355
|
<li class="pre-context-line"><code> until @threadpool.size == @threadpool_size.to_i
|
4356
|
</code></li>
|
4357
|
|
4358
|
<li class="pre-context-line"><code> thread = Thread.new do
|
4359
|
</code></li>
|
4360
|
|
4361
|
<li class="pre-context-line"><code> while true
|
4362
|
</code></li>
|
4363
|
|
4364
|
<li class="pre-context-line"><code> op, cback = *@threadqueue.pop
|
4365
|
</code></li>
|
4366
|
|
4367
|
</ol>
|
4368
|
|
4369
|
|
4370
|
<ol start="1060" class="context" id="56"
|
4371
|
onclick="toggle(56);">
|
4372
|
<li class="context-line" id="context-56"><code> result = op.call</code></li>
|
4373
|
</ol>
|
4374
|
|
4375
|
|
4376
|
<ol start="1061" class="post-context"
|
4377
|
id="post-56" onclick="toggle(56);">
|
4378
|
|
4379
|
<li class="post-context-line"><code> @resultqueue << [result, cback]
|
4380
|
</code></li>
|
4381
|
|
4382
|
<li class="post-context-line"><code> EventMachine.signal_loopbreak
|
4383
|
</code></li>
|
4384
|
|
4385
|
<li class="post-context-line"><code> end
|
4386
|
</code></li>
|
4387
|
|
4388
|
<li class="post-context-line"><code> end
|
4389
|
</code></li>
|
4390
|
|
4391
|
<li class="post-context-line"><code> @threadpool << thread
|
4392
|
</code></li>
|
4393
|
|
4394
|
<li class="post-context-line"><code> end
|
4395
|
</code></li>
|
4396
|
|
4397
|
<li class="post-context-line"><code> end
|
4398
|
</code></li>
|
4399
|
|
4400
|
</ol>
|
4401
|
|
4402
|
<div class="clear"></div>
|
4403
|
</li>
|
4404
|
|
4405
|
|
4406
|
|
4407
|
|
4408
|
|
4409
|
|
4410
|
|
4411
|
<li class="frame-info system">
|
4412
|
<code>/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb</code> in
|
4413
|
<code><strong>spawn_threadpool</strong></code>
|
4414
|
</li>
|
4415
|
|
4416
|
<li class="code system">
|
4417
|
|
4418
|
<ol start="1053"
|
4419
|
class="pre-context" id="pre-57"
|
4420
|
onclick="toggle(57);">
|
4421
|
|
4422
|
<li class="pre-context-line"><code> end
|
4423
|
</code></li>
|
4424
|
|
4425
|
<li class="pre-context-line"><code>
|
4426
|
</code></li>
|
4427
|
|
4428
|
<li class="pre-context-line"><code> def self.spawn_threadpool # :nodoc:
|
4429
|
</code></li>
|
4430
|
|
4431
|
<li class="pre-context-line"><code> until @threadpool.size == @threadpool_size.to_i
|
4432
|
</code></li>
|
4433
|
|
4434
|
<li class="pre-context-line"><code> thread = Thread.new do
|
4435
|
</code></li>
|
4436
|
|
4437
|
<li class="pre-context-line"><code> while true
|
4438
|
</code></li>
|
4439
|
|
4440
|
<li class="pre-context-line"><code> op, cback = *@threadqueue.pop
|
4441
|
</code></li>
|
4442
|
|
4443
|
</ol>
|
4444
|
|
4445
|
|
4446
|
<ol start="1060" class="context" id="57"
|
4447
|
onclick="toggle(57);">
|
4448
|
<li class="context-line" id="context-57"><code> result = op.call</code></li>
|
4449
|
</ol>
|
4450
|
|
4451
|
|
4452
|
<ol start="1061" class="post-context"
|
4453
|
id="post-57" onclick="toggle(57);">
|
4454
|
|
4455
|
<li class="post-context-line"><code> @resultqueue << [result, cback]
|
4456
|
</code></li>
|
4457
|
|
4458
|
<li class="post-context-line"><code> EventMachine.signal_loopbreak
|
4459
|
</code></li>
|
4460
|
|
4461
|
<li class="post-context-line"><code> end
|
4462
|
</code></li>
|
4463
|
|
4464
|
<li class="post-context-line"><code> end
|
4465
|
</code></li>
|
4466
|
|
4467
|
<li class="post-context-line"><code> @threadpool << thread
|
4468
|
</code></li>
|
4469
|
|
4470
|
<li class="post-context-line"><code> end
|
4471
|
</code></li>
|
4472
|
|
4473
|
<li class="post-context-line"><code> end
|
4474
|
</code></li>
|
4475
|
|
4476
|
</ol>
|
4477
|
|
4478
|
<div class="clear"></div>
|
4479
|
</li>
|
4480
|
|
4481
|
|
4482
|
|
4483
|
|
4484
|
|
4485
|
|
4486
|
|
4487
|
<li class="frame-info system">
|
4488
|
<code>/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb</code> in
|
4489
|
<code><strong>initialize</strong></code>
|
4490
|
</li>
|
4491
|
|
4492
|
<li class="code system">
|
4493
|
|
4494
|
<ol start="1050"
|
4495
|
class="pre-context" id="pre-58"
|
4496
|
onclick="toggle(58);">
|
4497
|
|
4498
|
<li class="pre-context-line"><code> end
|
4499
|
</code></li>
|
4500
|
|
4501
|
<li class="pre-context-line"><code>
|
4502
|
</code></li>
|
4503
|
|
4504
|
<li class="pre-context-line"><code> @threadqueue << [op||blk,callback]
|
4505
|
</code></li>
|
4506
|
|
4507
|
<li class="pre-context-line"><code> end
|
4508
|
</code></li>
|
4509
|
|
4510
|
<li class="pre-context-line"><code>
|
4511
|
</code></li>
|
4512
|
|
4513
|
<li class="pre-context-line"><code> def self.spawn_threadpool # :nodoc:
|
4514
|
</code></li>
|
4515
|
|
4516
|
<li class="pre-context-line"><code> until @threadpool.size == @threadpool_size.to_i
|
4517
|
</code></li>
|
4518
|
|
4519
|
</ol>
|
4520
|
|
4521
|
|
4522
|
<ol start="1057" class="context" id="58"
|
4523
|
onclick="toggle(58);">
|
4524
|
<li class="context-line" id="context-58"><code> thread = Thread.new do</code></li>
|
4525
|
</ol>
|
4526
|
|
4527
|
|
4528
|
<ol start="1058" class="post-context"
|
4529
|
id="post-58" onclick="toggle(58);">
|
4530
|
|
4531
|
<li class="post-context-line"><code> while true
|
4532
|
</code></li>
|
4533
|
|
4534
|
<li class="post-context-line"><code> op, cback = *@threadqueue.pop
|
4535
|
</code></li>
|
4536
|
|
4537
|
<li class="post-context-line"><code> result = op.call
|
4538
|
</code></li>
|
4539
|
|
4540
|
<li class="post-context-line"><code> @resultqueue << [result, cback]
|
4541
|
</code></li>
|
4542
|
|
4543
|
<li class="post-context-line"><code> EventMachine.signal_loopbreak
|
4544
|
</code></li>
|
4545
|
|
4546
|
<li class="post-context-line"><code> end
|
4547
|
</code></li>
|
4548
|
|
4549
|
<li class="post-context-line"><code> end
|
4550
|
</code></li>
|
4551
|
|
4552
|
</ol>
|
4553
|
|
4554
|
<div class="clear"></div>
|
4555
|
</li>
|
4556
|
|
4557
|
|
4558
|
|
4559
|
|
4560
|
|
4561
|
|
4562
|
|
4563
|
<li class="frame-info system">
|
4564
|
<code>/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb</code> in
|
4565
|
<code><strong>new</strong></code>
|
4566
|
</li>
|
4567
|
|
4568
|
<li class="code system">
|
4569
|
|
4570
|
<ol start="1050"
|
4571
|
class="pre-context" id="pre-59"
|
4572
|
onclick="toggle(59);">
|
4573
|
|
4574
|
<li class="pre-context-line"><code> end
|
4575
|
</code></li>
|
4576
|
|
4577
|
<li class="pre-context-line"><code>
|
4578
|
</code></li>
|
4579
|
|
4580
|
<li class="pre-context-line"><code> @threadqueue << [op||blk,callback]
|
4581
|
</code></li>
|
4582
|
|
4583
|
<li class="pre-context-line"><code> end
|
4584
|
</code></li>
|
4585
|
|
4586
|
<li class="pre-context-line"><code>
|
4587
|
</code></li>
|
4588
|
|
4589
|
<li class="pre-context-line"><code> def self.spawn_threadpool # :nodoc:
|
4590
|
</code></li>
|
4591
|
|
4592
|
<li class="pre-context-line"><code> until @threadpool.size == @threadpool_size.to_i
|
4593
|
</code></li>
|
4594
|
|
4595
|
</ol>
|
4596
|
|
4597
|
|
4598
|
<ol start="1057" class="context" id="59"
|
4599
|
onclick="toggle(59);">
|
4600
|
<li class="context-line" id="context-59"><code> thread = Thread.new do</code></li>
|
4601
|
</ol>
|
4602
|
|
4603
|
|
4604
|
<ol start="1058" class="post-context"
|
4605
|
id="post-59" onclick="toggle(59);">
|
4606
|
|
4607
|
<li class="post-context-line"><code> while true
|
4608
|
</code></li>
|
4609
|
|
4610
|
<li class="post-context-line"><code> op, cback = *@threadqueue.pop
|
4611
|
</code></li>
|
4612
|
|
4613
|
<li class="post-context-line"><code> result = op.call
|
4614
|
</code></li>
|
4615
|
|
4616
|
<li class="post-context-line"><code> @resultqueue << [result, cback]
|
4617
|
</code></li>
|
4618
|
|
4619
|
<li class="post-context-line"><code> EventMachine.signal_loopbreak
|
4620
|
</code></li>
|
4621
|
|
4622
|
<li class="post-context-line"><code> end
|
4623
|
</code></li>
|
4624
|
|
4625
|
<li class="post-context-line"><code> end
|
4626
|
</code></li>
|
4627
|
|
4628
|
</ol>
|
4629
|
|
4630
|
<div class="clear"></div>
|
4631
|
</li>
|
4632
|
|
4633
|
|
4634
|
|
4635
|
|
4636
|
|
4637
|
|
4638
|
|
4639
|
<li class="frame-info system">
|
4640
|
<code>/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb</code> in
|
4641
|
<code><strong>spawn_threadpool</strong></code>
|
4642
|
</li>
|
4643
|
|
4644
|
<li class="code system">
|
4645
|
|
4646
|
<ol start="1050"
|
4647
|
class="pre-context" id="pre-60"
|
4648
|
onclick="toggle(60);">
|
4649
|
|
4650
|
<li class="pre-context-line"><code> end
|
4651
|
</code></li>
|
4652
|
|
4653
|
<li class="pre-context-line"><code>
|
4654
|
</code></li>
|
4655
|
|
4656
|
<li class="pre-context-line"><code> @threadqueue << [op||blk,callback]
|
4657
|
</code></li>
|
4658
|
|
4659
|
<li class="pre-context-line"><code> end
|
4660
|
</code></li>
|
4661
|
|
4662
|
<li class="pre-context-line"><code>
|
4663
|
</code></li>
|
4664
|
|
4665
|
<li class="pre-context-line"><code> def self.spawn_threadpool # :nodoc:
|
4666
|
</code></li>
|
4667
|
|
4668
|
<li class="pre-context-line"><code> until @threadpool.size == @threadpool_size.to_i
|
4669
|
</code></li>
|
4670
|
|
4671
|
</ol>
|
4672
|
|
4673
|
|
4674
|
<ol start="1057" class="context" id="60"
|
4675
|
onclick="toggle(60);">
|
4676
|
<li class="context-line" id="context-60"><code> thread = Thread.new do</code></li>
|
4677
|
</ol>
|
4678
|
|
4679
|
|
4680
|
<ol start="1058" class="post-context"
|
4681
|
id="post-60" onclick="toggle(60);">
|
4682
|
|
4683
|
<li class="post-context-line"><code> while true
|
4684
|
</code></li>
|
4685
|
|
4686
|
<li class="post-context-line"><code> op, cback = *@threadqueue.pop
|
4687
|
</code></li>
|
4688
|
|
4689
|
<li class="post-context-line"><code> result = op.call
|
4690
|
</code></li>
|
4691
|
|
4692
|
<li class="post-context-line"><code> @resultqueue << [result, cback]
|
4693
|
</code></li>
|
4694
|
|
4695
|
<li class="post-context-line"><code> EventMachine.signal_loopbreak
|
4696
|
</code></li>
|
4697
|
|
4698
|
<li class="post-context-line"><code> end
|
4699
|
</code></li>
|
4700
|
|
4701
|
<li class="post-context-line"><code> end
|
4702
|
</code></li>
|
4703
|
|
4704
|
</ol>
|
4705
|
|
4706
|
<div class="clear"></div>
|
4707
|
</li>
|
4708
|
|
4709
|
|
4710
|
|
4711
|
|
4712
|
|
4713
|
|
4714
|
|
4715
|
<li class="frame-info system">
|
4716
|
<code>/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb</code> in
|
4717
|
<code><strong>defer</strong></code>
|
4718
|
</li>
|
4719
|
|
4720
|
<li class="code system">
|
4721
|
|
4722
|
<ol start="1042"
|
4723
|
class="pre-context" id="pre-61"
|
4724
|
onclick="toggle(61);">
|
4725
|
|
4726
|
<li class="pre-context-line"><code> #
|
4727
|
</code></li>
|
4728
|
|
4729
|
<li class="pre-context-line"><code> def self.defer op = nil, callback = nil, &blk
|
4730
|
</code></li>
|
4731
|
|
4732
|
<li class="pre-context-line"><code> unless @threadpool
|
4733
|
</code></li>
|
4734
|
|
4735
|
<li class="pre-context-line"><code> require 'thread'
|
4736
|
</code></li>
|
4737
|
|
4738
|
<li class="pre-context-line"><code> @threadpool = []
|
4739
|
</code></li>
|
4740
|
|
4741
|
<li class="pre-context-line"><code> @threadqueue = ::Queue.new
|
4742
|
</code></li>
|
4743
|
|
4744
|
<li class="pre-context-line"><code> @resultqueue = ::Queue.new
|
4745
|
</code></li>
|
4746
|
|
4747
|
</ol>
|
4748
|
|
4749
|
|
4750
|
<ol start="1049" class="context" id="61"
|
4751
|
onclick="toggle(61);">
|
4752
|
<li class="context-line" id="context-61"><code> spawn_threadpool</code></li>
|
4753
|
</ol>
|
4754
|
|
4755
|
|
4756
|
<ol start="1050" class="post-context"
|
4757
|
id="post-61" onclick="toggle(61);">
|
4758
|
|
4759
|
<li class="post-context-line"><code> end
|
4760
|
</code></li>
|
4761
|
|
4762
|
<li class="post-context-line"><code>
|
4763
|
</code></li>
|
4764
|
|
4765
|
<li class="post-context-line"><code> @threadqueue << [op||blk,callback]
|
4766
|
</code></li>
|
4767
|
|
4768
|
<li class="post-context-line"><code> end
|
4769
|
</code></li>
|
4770
|
|
4771
|
<li class="post-context-line"><code>
|
4772
|
</code></li>
|
4773
|
|
4774
|
<li class="post-context-line"><code> def self.spawn_threadpool # :nodoc:
|
4775
|
</code></li>
|
4776
|
|
4777
|
<li class="post-context-line"><code> until @threadpool.size == @threadpool_size.to_i
|
4778
|
</code></li>
|
4779
|
|
4780
|
</ol>
|
4781
|
|
4782
|
<div class="clear"></div>
|
4783
|
</li>
|
4784
|
|
4785
|
|
4786
|
|
4787
|
|
4788
|
|
4789
|
|
4790
|
|
4791
|
<li class="frame-info system">
|
4792
|
<code>/usr/lib/ruby/gems/1.8/gems/thin-1.5.1/lib/thin/connection.rb</code> in
|
4793
|
<code><strong>process</strong></code>
|
4794
|
</li>
|
4795
|
|
4796
|
<li class="code system">
|
4797
|
|
4798
|
<ol start="44"
|
4799
|
class="pre-context" id="pre-62"
|
4800
|
onclick="toggle(62);">
|
4801
|
|
4802
|
<li class="pre-context-line"><code> end
|
4803
|
</code></li>
|
4804
|
|
4805
|
<li class="pre-context-line"><code>
|
4806
|
</code></li>
|
4807
|
|
4808
|
<li class="pre-context-line"><code> # Called when all data was received and the request
|
4809
|
</code></li>
|
4810
|
|
4811
|
<li class="pre-context-line"><code> # is ready to be processed.
|
4812
|
</code></li>
|
4813
|
|
4814
|
<li class="pre-context-line"><code> def process
|
4815
|
</code></li>
|
4816
|
|
4817
|
<li class="pre-context-line"><code> if threaded?
|
4818
|
</code></li>
|
4819
|
|
4820
|
<li class="pre-context-line"><code> @request.threaded = true
|
4821
|
</code></li>
|
4822
|
|
4823
|
</ol>
|
4824
|
|
4825
|
|
4826
|
<ol start="51" class="context" id="62"
|
4827
|
onclick="toggle(62);">
|
4828
|
<li class="context-line" id="context-62"><code> EventMachine.defer(method(:pre_process), method(:post_process))</code></li>
|
4829
|
</ol>
|
4830
|
|
4831
|
|
4832
|
<ol start="52" class="post-context"
|
4833
|
id="post-62" onclick="toggle(62);">
|
4834
|
|
4835
|
<li class="post-context-line"><code> else
|
4836
|
</code></li>
|
4837
|
|
4838
|
<li class="post-context-line"><code> @request.threaded = false
|
4839
|
</code></li>
|
4840
|
|
4841
|
<li class="post-context-line"><code> post_process(pre_process)
|
4842
|
</code></li>
|
4843
|
|
4844
|
<li class="post-context-line"><code> end
|
4845
|
</code></li>
|
4846
|
|
4847
|
<li class="post-context-line"><code> end
|
4848
|
</code></li>
|
4849
|
|
4850
|
<li class="post-context-line"><code>
|
4851
|
</code></li>
|
4852
|
|
4853
|
<li class="post-context-line"><code> def pre_process
|
4854
|
</code></li>
|
4855
|
|
4856
|
</ol>
|
4857
|
|
4858
|
<div class="clear"></div>
|
4859
|
</li>
|
4860
|
|
4861
|
|
4862
|
|
4863
|
|
4864
|
|
4865
|
|
4866
|
|
4867
|
<li class="frame-info system">
|
4868
|
<code>/usr/lib/ruby/gems/1.8/gems/thin-1.5.1/lib/thin/connection.rb</code> in
|
4869
|
<code><strong>receive_data</strong></code>
|
4870
|
</li>
|
4871
|
|
4872
|
<li class="code system">
|
4873
|
|
4874
|
<ol start="32"
|
4875
|
class="pre-context" id="pre-63"
|
4876
|
onclick="toggle(63);">
|
4877
|
|
4878
|
<li class="pre-context-line"><code> @response = Response.new
|
4879
|
</code></li>
|
4880
|
|
4881
|
<li class="pre-context-line"><code> end
|
4882
|
</code></li>
|
4883
|
|
4884
|
<li class="pre-context-line"><code>
|
4885
|
</code></li>
|
4886
|
|
4887
|
<li class="pre-context-line"><code> # Called when data is received from the client.
|
4888
|
</code></li>
|
4889
|
|
4890
|
<li class="pre-context-line"><code> def receive_data(data)
|
4891
|
</code></li>
|
4892
|
|
4893
|
<li class="pre-context-line"><code> @idle = false
|
4894
|
</code></li>
|
4895
|
|
4896
|
<li class="pre-context-line"><code> trace { data }
|
4897
|
</code></li>
|
4898
|
|
4899
|
</ol>
|
4900
|
|
4901
|
|
4902
|
<ol start="39" class="context" id="63"
|
4903
|
onclick="toggle(63);">
|
4904
|
<li class="context-line" id="context-63"><code> process if @request.parse(data)</code></li>
|
4905
|
</ol>
|
4906
|
|
4907
|
|
4908
|
<ol start="40" class="post-context"
|
4909
|
id="post-63" onclick="toggle(63);">
|
4910
|
|
4911
|
<li class="post-context-line"><code> rescue InvalidRequest => e
|
4912
|
</code></li>
|
4913
|
|
4914
|
<li class="post-context-line"><code> log "!! Invalid request"
|
4915
|
</code></li>
|
4916
|
|
4917
|
<li class="post-context-line"><code> log_error e
|
4918
|
</code></li>
|
4919
|
|
4920
|
<li class="post-context-line"><code> post_process Response::BAD_REQUEST
|
4921
|
</code></li>
|
4922
|
|
4923
|
<li class="post-context-line"><code> end
|
4924
|
</code></li>
|
4925
|
|
4926
|
<li class="post-context-line"><code>
|
4927
|
</code></li>
|
4928
|
|
4929
|
<li class="post-context-line"><code> # Called when all data was received and the request
|
4930
|
</code></li>
|
4931
|
|
4932
|
</ol>
|
4933
|
|
4934
|
<div class="clear"></div>
|
4935
|
</li>
|
4936
|
|
4937
|
|
4938
|
|
4939
|
|
4940
|
|
4941
|
|
4942
|
|
4943
|
<li class="frame-info system">
|
4944
|
<code>/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb</code> in
|
4945
|
<code><strong>run_machine</strong></code>
|
4946
|
</li>
|
4947
|
|
4948
|
<li class="code system">
|
4949
|
|
4950
|
<ol start="249"
|
4951
|
class="pre-context" id="pre-64"
|
4952
|
onclick="toggle(64);">
|
4953
|
|
4954
|
<li class="pre-context-line"><code> @reactor_running = true
|
4955
|
</code></li>
|
4956
|
|
4957
|
<li class="pre-context-line"><code> initialize_event_machine
|
4958
|
</code></li>
|
4959
|
|
4960
|
<li class="pre-context-line"><code> (b = blk || block) and add_timer(0, b)
|
4961
|
</code></li>
|
4962
|
|
4963
|
<li class="pre-context-line"><code> if @next_tick_queue && !@next_tick_queue.empty?
|
4964
|
</code></li>
|
4965
|
|
4966
|
<li class="pre-context-line"><code> add_timer(0) { signal_loopbreak }
|
4967
|
</code></li>
|
4968
|
|
4969
|
<li class="pre-context-line"><code> end
|
4970
|
</code></li>
|
4971
|
|
4972
|
<li class="pre-context-line"><code> @reactor_thread = Thread.current
|
4973
|
</code></li>
|
4974
|
|
4975
|
</ol>
|
4976
|
|
4977
|
|
4978
|
<ol start="256" class="context" id="64"
|
4979
|
onclick="toggle(64);">
|
4980
|
<li class="context-line" id="context-64"><code> run_machine</code></li>
|
4981
|
</ol>
|
4982
|
|
4983
|
|
4984
|
<ol start="257" class="post-context"
|
4985
|
id="post-64" onclick="toggle(64);">
|
4986
|
|
4987
|
<li class="post-context-line"><code> ensure
|
4988
|
</code></li>
|
4989
|
|
4990
|
<li class="post-context-line"><code> until @tails.empty?
|
4991
|
</code></li>
|
4992
|
|
4993
|
<li class="post-context-line"><code> @tails.pop.call
|
4994
|
</code></li>
|
4995
|
|
4996
|
<li class="post-context-line"><code> end
|
4997
|
</code></li>
|
4998
|
|
4999
|
<li class="post-context-line"><code>
|
5000
|
</code></li>
|
5001
|
|
5002
|
<li class="post-context-line"><code> begin
|
5003
|
</code></li>
|
5004
|
|
5005
|
<li class="post-context-line"><code> release_machine
|
5006
|
</code></li>
|
5007
|
|
5008
|
</ol>
|
5009
|
|
5010
|
<div class="clear"></div>
|
5011
|
</li>
|
5012
|
|
5013
|
|
5014
|
|
5015
|
|
5016
|
|
5017
|
|
5018
|
|
5019
|
<li class="frame-info system">
|
5020
|
<code>/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb</code> in
|
5021
|
<code><strong>run</strong></code>
|
5022
|
</li>
|
5023
|
|
5024
|
<li class="code system">
|
5025
|
|
5026
|
<ol start="249"
|
5027
|
class="pre-context" id="pre-65"
|
5028
|
onclick="toggle(65);">
|
5029
|
|
5030
|
<li class="pre-context-line"><code> @reactor_running = true
|
5031
|
</code></li>
|
5032
|
|
5033
|
<li class="pre-context-line"><code> initialize_event_machine
|
5034
|
</code></li>
|
5035
|
|
5036
|
<li class="pre-context-line"><code> (b = blk || block) and add_timer(0, b)
|
5037
|
</code></li>
|
5038
|
|
5039
|
<li class="pre-context-line"><code> if @next_tick_queue && !@next_tick_queue.empty?
|
5040
|
</code></li>
|
5041
|
|
5042
|
<li class="pre-context-line"><code> add_timer(0) { signal_loopbreak }
|
5043
|
</code></li>
|
5044
|
|
5045
|
<li class="pre-context-line"><code> end
|
5046
|
</code></li>
|
5047
|
|
5048
|
<li class="pre-context-line"><code> @reactor_thread = Thread.current
|
5049
|
</code></li>
|
5050
|
|
5051
|
</ol>
|
5052
|
|
5053
|
|
5054
|
<ol start="256" class="context" id="65"
|
5055
|
onclick="toggle(65);">
|
5056
|
<li class="context-line" id="context-65"><code> run_machine</code></li>
|
5057
|
</ol>
|
5058
|
|
5059
|
|
5060
|
<ol start="257" class="post-context"
|
5061
|
id="post-65" onclick="toggle(65);">
|
5062
|
|
5063
|
<li class="post-context-line"><code> ensure
|
5064
|
</code></li>
|
5065
|
|
5066
|
<li class="post-context-line"><code> until @tails.empty?
|
5067
|
</code></li>
|
5068
|
|
5069
|
<li class="post-context-line"><code> @tails.pop.call
|
5070
|
</code></li>
|
5071
|
|
5072
|
<li class="post-context-line"><code> end
|
5073
|
</code></li>
|
5074
|
|
5075
|
<li class="post-context-line"><code>
|
5076
|
</code></li>
|
5077
|
|
5078
|
<li class="post-context-line"><code> begin
|
5079
|
</code></li>
|
5080
|
|
5081
|
<li class="post-context-line"><code> release_machine
|
5082
|
</code></li>
|
5083
|
|
5084
|
</ol>
|
5085
|
|
5086
|
<div class="clear"></div>
|
5087
|
</li>
|
5088
|
|
5089
|
|
5090
|
|
5091
|
|
5092
|
|
5093
|
|
5094
|
|
5095
|
<li class="frame-info system">
|
5096
|
<code>/usr/lib/ruby/gems/1.8/gems/thin-1.5.1/lib/thin/backends/base.rb</code> in
|
5097
|
<code><strong>start</strong></code>
|
5098
|
</li>
|
5099
|
|
5100
|
<li class="code system">
|
5101
|
|
5102
|
<ol start="56"
|
5103
|
class="pre-context" id="pre-66"
|
5104
|
onclick="toggle(66);">
|
5105
|
|
5106
|
<li class="pre-context-line"><code> @running = true
|
5107
|
</code></li>
|
5108
|
|
5109
|
<li class="pre-context-line"><code> end
|
5110
|
</code></li>
|
5111
|
|
5112
|
<li class="pre-context-line"><code>
|
5113
|
</code></li>
|
5114
|
|
5115
|
<li class="pre-context-line"><code> # Allow for early run up of eventmachine.
|
5116
|
</code></li>
|
5117
|
|
5118
|
<li class="pre-context-line"><code> if EventMachine.reactor_running?
|
5119
|
</code></li>
|
5120
|
|
5121
|
<li class="pre-context-line"><code> starter.call
|
5122
|
</code></li>
|
5123
|
|
5124
|
<li class="pre-context-line"><code> else
|
5125
|
</code></li>
|
5126
|
|
5127
|
</ol>
|
5128
|
|
5129
|
|
5130
|
<ol start="63" class="context" id="66"
|
5131
|
onclick="toggle(66);">
|
5132
|
<li class="context-line" id="context-66"><code> EventMachine.run(&starter)</code></li>
|
5133
|
</ol>
|
5134
|
|
5135
|
|
5136
|
<ol start="64" class="post-context"
|
5137
|
id="post-66" onclick="toggle(66);">
|
5138
|
|
5139
|
<li class="post-context-line"><code> end
|
5140
|
</code></li>
|
5141
|
|
5142
|
<li class="post-context-line"><code> end
|
5143
|
</code></li>
|
5144
|
|
5145
|
<li class="post-context-line"><code>
|
5146
|
</code></li>
|
5147
|
|
5148
|
<li class="post-context-line"><code> # Stop of the backend from accepting new connections.
|
5149
|
</code></li>
|
5150
|
|
5151
|
<li class="post-context-line"><code> def stop
|
5152
|
</code></li>
|
5153
|
|
5154
|
<li class="post-context-line"><code> @running = false
|
5155
|
</code></li>
|
5156
|
|
5157
|
<li class="post-context-line"><code> @stopping = true
|
5158
|
</code></li>
|
5159
|
|
5160
|
</ol>
|
5161
|
|
5162
|
<div class="clear"></div>
|
5163
|
</li>
|
5164
|
|
5165
|
|
5166
|
|
5167
|
|
5168
|
|
5169
|
|
5170
|
|
5171
|
<li class="frame-info system">
|
5172
|
<code>/usr/lib/ruby/gems/1.8/gems/thin-1.5.1/lib/thin/server.rb</code> in
|
5173
|
<code><strong>start</strong></code>
|
5174
|
</li>
|
5175
|
|
5176
|
<li class="code system">
|
5177
|
|
5178
|
<ol start="152"
|
5179
|
class="pre-context" id="pre-67"
|
5180
|
onclick="toggle(67);">
|
5181
|
|
5182
|
<li class="pre-context-line"><code> log ">> Thin web server (v#{VERSION::STRING} codename #{VERSION::CODENAME})"
|
5183
|
</code></li>
|
5184
|
|
5185
|
<li class="pre-context-line"><code> debug ">> Debugging ON"
|
5186
|
</code></li>
|
5187
|
|
5188
|
<li class="pre-context-line"><code> trace ">> Tracing ON"
|
5189
|
</code></li>
|
5190
|
|
5191
|
<li class="pre-context-line"><code>
|
5192
|
</code></li>
|
5193
|
|
5194
|
<li class="pre-context-line"><code> log ">> Maximum connections set to #{@backend.maximum_connections}"
|
5195
|
</code></li>
|
5196
|
|
5197
|
<li class="pre-context-line"><code> log ">> Listening on #{@backend}, CTRL+C to stop"
|
5198
|
</code></li>
|
5199
|
|
5200
|
<li class="pre-context-line"><code>
|
5201
|
</code></li>
|
5202
|
|
5203
|
</ol>
|
5204
|
|
5205
|
|
5206
|
<ol start="159" class="context" id="67"
|
5207
|
onclick="toggle(67);">
|
5208
|
<li class="context-line" id="context-67"><code> @backend.start</code></li>
|
5209
|
</ol>
|
5210
|
|
5211
|
|
5212
|
<ol start="160" class="post-context"
|
5213
|
id="post-67" onclick="toggle(67);">
|
5214
|
|
5215
|
<li class="post-context-line"><code> end
|
5216
|
</code></li>
|
5217
|
|
5218
|
<li class="post-context-line"><code> alias :start! :start
|
5219
|
</code></li>
|
5220
|
|
5221
|
<li class="post-context-line"><code>
|
5222
|
</code></li>
|
5223
|
|
5224
|
<li class="post-context-line"><code> # == Gracefull shutdown
|
5225
|
</code></li>
|
5226
|
|
5227
|
<li class="post-context-line"><code> # Stops the server after processing all current connections.
|
5228
|
</code></li>
|
5229
|
|
5230
|
<li class="post-context-line"><code> # As soon as this method is called, the server stops accepting
|
5231
|
</code></li>
|
5232
|
|
5233
|
<li class="post-context-line"><code> # new requests and wait for all current connections to finish.
|
5234
|
</code></li>
|
5235
|
|
5236
|
</ol>
|
5237
|
|
5238
|
<div class="clear"></div>
|
5239
|
</li>
|
5240
|
|
5241
|
|
5242
|
|
5243
|
|
5244
|
|
5245
|
|
5246
|
|
5247
|
<li class="frame-info system">
|
5248
|
<code>/usr/lib/ruby/gems/1.8/gems/rack-1.5.2/lib/rack/handler/thin.rb</code> in
|
5249
|
<code><strong>run</strong></code>
|
5250
|
</li>
|
5251
|
|
5252
|
<li class="code system">
|
5253
|
|
5254
|
<ol start="9"
|
5255
|
class="pre-context" id="pre-68"
|
5256
|
onclick="toggle(68);">
|
5257
|
|
5258
|
<li class="pre-context-line"><code> host = options.delete(:Host) || '0.0.0.0'
|
5259
|
</code></li>
|
5260
|
|
5261
|
<li class="pre-context-line"><code> port = options.delete(:Port) || 8080
|
5262
|
</code></li>
|
5263
|
|
5264
|
<li class="pre-context-line"><code> args = [host, port, app, options]
|
5265
|
</code></li>
|
5266
|
|
5267
|
<li class="pre-context-line"><code> # Thin versions below 0.8.0 do not support additional options
|
5268
|
</code></li>
|
5269
|
|
5270
|
<li class="pre-context-line"><code> args.pop if ::Thin::VERSION::MAJOR < 1 && ::Thin::VERSION::MINOR < 8
|
5271
|
</code></li>
|
5272
|
|
5273
|
<li class="pre-context-line"><code> server = ::Thin::Server.new(*args)
|
5274
|
</code></li>
|
5275
|
|
5276
|
<li class="pre-context-line"><code> yield server if block_given?
|
5277
|
</code></li>
|
5278
|
|
5279
|
</ol>
|
5280
|
|
5281
|
|
5282
|
<ol start="16" class="context" id="68"
|
5283
|
onclick="toggle(68);">
|
5284
|
<li class="context-line" id="context-68"><code> server.start</code></li>
|
5285
|
</ol>
|
5286
|
|
5287
|
|
5288
|
<ol start="17" class="post-context"
|
5289
|
id="post-68" onclick="toggle(68);">
|
5290
|
|
5291
|
<li class="post-context-line"><code> end
|
5292
|
</code></li>
|
5293
|
|
5294
|
<li class="post-context-line"><code>
|
5295
|
</code></li>
|
5296
|
|
5297
|
<li class="post-context-line"><code> def self.valid_options
|
5298
|
</code></li>
|
5299
|
|
5300
|
<li class="post-context-line"><code> {
|
5301
|
</code></li>
|
5302
|
|
5303
|
<li class="post-context-line"><code> "Host=HOST" => "Hostname to listen on (default: localhost)",
|
5304
|
</code></li>
|
5305
|
|
5306
|
<li class="post-context-line"><code> "Port=PORT" => "Port to listen on (default: 8080)",
|
5307
|
</code></li>
|
5308
|
|
5309
|
<li class="post-context-line"><code> }
|
5310
|
</code></li>
|
5311
|
|
5312
|
</ol>
|
5313
|
|
5314
|
<div class="clear"></div>
|
5315
|
</li>
|
5316
|
|
5317
|
|
5318
|
|
5319
|
|
5320
|
|
5321
|
|
5322
|
|
5323
|
<li class="frame-info framework">
|
5324
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/base.rb</code> in
|
5325
|
<code><strong>run!</strong></code>
|
5326
|
</li>
|
5327
|
|
5328
|
<li class="code framework">
|
5329
|
|
5330
|
<ol start="1401"
|
5331
|
class="pre-context" id="pre-69"
|
5332
|
onclick="toggle(69);">
|
5333
|
|
5334
|
<li class="pre-context-line"><code> # Thin, Puma, Mongrel, or WEBrick (in that order). If given a block, will call
|
5335
|
</code></li>
|
5336
|
|
5337
|
<li class="pre-context-line"><code> # with the constructed handler once we have taken the stage.
|
5338
|
</code></li>
|
5339
|
|
5340
|
<li class="pre-context-line"><code> def run!(options = {})
|
5341
|
</code></li>
|
5342
|
|
5343
|
<li class="pre-context-line"><code> set options
|
5344
|
</code></li>
|
5345
|
|
5346
|
<li class="pre-context-line"><code> handler = detect_rack_handler
|
5347
|
</code></li>
|
5348
|
|
5349
|
<li class="pre-context-line"><code> handler_name = handler.name.gsub(/.*::/, '')
|
5350
|
</code></li>
|
5351
|
|
5352
|
<li class="pre-context-line"><code> server_settings = settings.respond_to?(:server_settings) ? settings.server_settings : {}
|
5353
|
</code></li>
|
5354
|
|
5355
|
</ol>
|
5356
|
|
5357
|
|
5358
|
<ol start="1408" class="context" id="69"
|
5359
|
onclick="toggle(69);">
|
5360
|
<li class="context-line" id="context-69"><code> handler.run self, server_settings.merge(:Port => port, :Host => bind) do |server|</code></li>
|
5361
|
</ol>
|
5362
|
|
5363
|
|
5364
|
<ol start="1409" class="post-context"
|
5365
|
id="post-69" onclick="toggle(69);">
|
5366
|
|
5367
|
<li class="post-context-line"><code> unless handler_name =~ /cgi/i
|
5368
|
</code></li>
|
5369
|
|
5370
|
<li class="post-context-line"><code> $stderr.puts "== Sinatra/#{Sinatra::VERSION} has taken the stage " +
|
5371
|
</code></li>
|
5372
|
|
5373
|
<li class="post-context-line"><code> "on #{port} for #{environment} with backup from #{handler_name}"
|
5374
|
</code></li>
|
5375
|
|
5376
|
<li class="post-context-line"><code> end
|
5377
|
</code></li>
|
5378
|
|
5379
|
<li class="post-context-line"><code> [:INT, :TERM].each { |sig| trap(sig) { quit!(server, handler_name) } }
|
5380
|
</code></li>
|
5381
|
|
5382
|
<li class="post-context-line"><code> server.threaded = settings.threaded if server.respond_to? :threaded=
|
5383
|
</code></li>
|
5384
|
|
5385
|
<li class="post-context-line"><code> set :running, true
|
5386
|
</code></li>
|
5387
|
|
5388
|
</ol>
|
5389
|
|
5390
|
<div class="clear"></div>
|
5391
|
</li>
|
5392
|
|
5393
|
|
5394
|
|
5395
|
|
5396
|
|
5397
|
|
5398
|
|
5399
|
<li class="frame-info framework">
|
5400
|
<code>/usr/lib/ruby/gems/1.8/gems/sinatra-1.4.3/lib/sinatra/main.rb</code> in
|
5401
|
<code><strong>nil</strong></code>
|
5402
|
</li>
|
5403
|
|
5404
|
<li class="code framework">
|
5405
|
|
5406
|
<ol start="18"
|
5407
|
class="pre-context" id="pre-70"
|
5408
|
onclick="toggle(70);">
|
5409
|
|
5410
|
<li class="pre-context-line"><code> op.on('-e env', 'set the environment (default is development)') { |val| set :environment, val.to_sym }
|
5411
|
</code></li>
|
5412
|
|
5413
|
<li class="pre-context-line"><code> op.on('-s server', 'specify rack server/handler (default is thin)') { |val| set :server, val }
|
5414
|
</code></li>
|
5415
|
|
5416
|
<li class="pre-context-line"><code> op.on('-x', 'turn on the mutex lock (default is off)') { set :lock, true }
|
5417
|
</code></li>
|
5418
|
|
5419
|
<li class="pre-context-line"><code> }.parse!(ARGV.dup)
|
5420
|
</code></li>
|
5421
|
|
5422
|
<li class="pre-context-line"><code> end
|
5423
|
</code></li>
|
5424
|
|
5425
|
<li class="pre-context-line"><code> end
|
5426
|
</code></li>
|
5427
|
|
5428
|
<li class="pre-context-line"><code>
|
5429
|
</code></li>
|
5430
|
|
5431
|
</ol>
|
5432
|
|
5433
|
|
5434
|
<ol start="25" class="context" id="70"
|
5435
|
onclick="toggle(70);">
|
5436
|
<li class="context-line" id="context-70"><code> at_exit { Application.run! if $!.nil? && Application.run? }</code></li>
|
5437
|
</ol>
|
5438
|
|
5439
|
|
5440
|
<ol start="26" class="post-context"
|
5441
|
id="post-70" onclick="toggle(70);">
|
5442
|
|
5443
|
<li class="post-context-line"><code>end
|
5444
|
</code></li>
|
5445
|
|
5446
|
<li class="post-context-line"><code>
|
5447
|
</code></li>
|
5448
|
|
5449
|
<li class="post-context-line"><code># include would include the module in Object
|
5450
|
</code></li>
|
5451
|
|
5452
|
<li class="post-context-line"><code># extend only extends the `main` object
|
5453
|
</code></li>
|
5454
|
|
5455
|
<li class="post-context-line"><code>extend Sinatra::Delegator
|
5456
|
</code></li>
|
5457
|
|
5458
|
<li class="post-context-line"><code>
|
5459
|
</code></li>
|
5460
|
|
5461
|
<li class="post-context-line"><code>class Rack::Builder
|
5462
|
</code></li>
|
5463
|
|
5464
|
</ol>
|
5465
|
|
5466
|
<div class="clear"></div>
|
5467
|
</li>
|
5468
|
|
5469
|
|
5470
|
|
5471
|
|
5472
|
|
5473
|
|
5474
|
|
5475
|
<li class="frame-info app">
|
5476
|
<code>/usr/lib/one/oneflow/oneflow-server.rb</code> in
|
5477
|
<code><strong>nil</strong></code>
|
5478
|
</li>
|
5479
|
|
5480
|
<li class="code app">
|
5481
|
|
5482
|
<ol start="393"
|
5483
|
class="pre-context" id="pre-71"
|
5484
|
onclick="toggle(71);">
|
5485
|
|
5486
|
<li class="pre-context-line"><code> s_template.info
|
5487
|
</code></li>
|
5488
|
|
5489
|
<li class="pre-context-line"><code>
|
5490
|
</code></li>
|
5491
|
|
5492
|
<li class="pre-context-line"><code> status 201
|
5493
|
</code></li>
|
5494
|
|
5495
|
<li class="pre-context-line"><code> #body Parser.render(rc)
|
5496
|
</code></li>
|
5497
|
|
5498
|
<li class="pre-context-line"><code> body s_template.to_json
|
5499
|
</code></li>
|
5500
|
|
5501
|
<li class="pre-context-line"><code>end
|
5502
|
</code></li>
|
5503
|
|
5504
|
<li class="pre-context-line"><code>
|
5505
|
</code></li>
|
5506
|
|
5507
|
</ol>
|
5508
|
|
5509
|
|
5510
|
<ol start="400" class="context" id="71"
|
5511
|
onclick="toggle(71);">
|
5512
|
<li class="context-line" id="context-71"><code>post '/service_template/:id/action' do</code></li>
|
5513
|
</ol>
|
5514
|
|
5515
|
|
5516
|
<ol start="401" class="post-context"
|
5517
|
id="post-71" onclick="toggle(71);">
|
5518
|
|
5519
|
<li class="post-context-line"><code> service_template = OpenNebula::ServiceTemplate.new_with_id(params[:id], @client)
|
5520
|
</code></li>
|
5521
|
|
5522
|
<li class="post-context-line"><code>
|
5523
|
</code></li>
|
5524
|
|
5525
|
<li class="post-context-line"><code> action = JSON.parse(request.body.read)['action']
|
5526
|
</code></li>
|
5527
|
|
5528
|
<li class="post-context-line"><code>
|
5529
|
</code></li>
|
5530
|
|
5531
|
<li class="post-context-line"><code> opts = action['params']
|
5532
|
</code></li>
|
5533
|
|
5534
|
<li class="post-context-line"><code>
|
5535
|
</code></li>
|
5536
|
|
5537
|
<li class="post-context-line"><code> rc = case action['perform']
|
5538
|
</code></li>
|
5539
|
|
5540
|
</ol>
|
5541
|
|
5542
|
<div class="clear"></div>
|
5543
|
</li>
|
5544
|
|
5545
|
|
5546
|
|
5547
|
|
5548
|
|
5549
|
|
5550
|
</ul>
|
5551
|
</div>
|
5552
|
|
5553
|
<div id="get">
|
5554
|
<h3 id="get-info">GET</h3>
|
5555
|
|
5556
|
<p class="no-data">No GET data.</p>
|
5557
|
|
5558
|
<div class="clear"></div>
|
5559
|
</div>
|
5560
|
|
5561
|
<div id="post">
|
5562
|
<h3 id="post-info">POST</h3>
|
5563
|
|
5564
|
<table class="req">
|
5565
|
<tr>
|
5566
|
<th>Variable</th>
|
5567
|
<th>Value</th>
|
5568
|
</tr>
|
5569
|
|
5570
|
<tr>
|
5571
|
<td>{
|
5572
|
"action": {
|
5573
|
"perform": "recover"
|
5574
|
}
|
5575
|
}</td>
|
5576
|
<td class="code"><div>nil</div></td>
|
5577
|
</tr>
|
5578
|
|
5579
|
</table>
|
5580
|
|
5581
|
<div class="clear"></div>
|
5582
|
</div>
|
5583
|
|
5584
|
<div id="cookies">
|
5585
|
<h3 id="cookie-info">COOKIES</h3>
|
5586
|
|
5587
|
<p class="no-data">No cookie data.</p>
|
5588
|
|
5589
|
<div class="clear"></div>
|
5590
|
</div>
|
5591
|
|
5592
|
<div id="rack">
|
5593
|
<h3 id="env-info">Rack ENV</h3>
|
5594
|
<table class="req">
|
5595
|
<tr>
|
5596
|
<th>Variable</th>
|
5597
|
<th>Value</th>
|
5598
|
</tr>
|
5599
|
|
5600
|
<tr>
|
5601
|
<td>CONTENT_LENGTH</td>
|
5602
|
<td class="code"><div>46</div></td>
|
5603
|
</tr>
|
5604
|
|
5605
|
<tr>
|
5606
|
<td>CONTENT_TYPE</td>
|
5607
|
<td class="code"><div>application/x-www-form-urlencoded</div></td>
|
5608
|
</tr>
|
5609
|
|
5610
|
<tr>
|
5611
|
<td>GATEWAY_INTERFACE</td>
|
5612
|
<td class="code"><div>CGI/1.2</div></td>
|
5613
|
</tr>
|
5614
|
|
5615
|
<tr>
|
5616
|
<td>HTTP_ACCEPT</td>
|
5617
|
<td class="code"><div>*/*</div></td>
|
5618
|
</tr>
|
5619
|
|
5620
|
<tr>
|
5621
|
<td>HTTP_AUTHORIZATION</td>
|
5622
|
<td class="code"><div>Basic b25lYWRtaW46dlA0RXVDLWQ=</div></td>
|
5623
|
</tr>
|
5624
|
|
5625
|
<tr>
|
5626
|
<td>HTTP_HOST</td>
|
5627
|
<td class="code"><div>localhost:2474</div></td>
|
5628
|
</tr>
|
5629
|
|
5630
|
<tr>
|
5631
|
<td>HTTP_USER_AGENT</td>
|
5632
|
<td class="code"><div>OpenNebula 4.4.1 (CLI)</div></td>
|
5633
|
</tr>
|
5634
|
|
5635
|
<tr>
|
5636
|
<td>HTTP_VERSION</td>
|
5637
|
<td class="code"><div>HTTP/1.1</div></td>
|
5638
|
</tr>
|
5639
|
|
5640
|
<tr>
|
5641
|
<td>PATH_INFO</td>
|
5642
|
<td class="code"><div>/service/17/action</div></td>
|
5643
|
</tr>
|
5644
|
|
5645
|
<tr>
|
5646
|
<td>QUERY_STRING</td>
|
5647
|
<td class="code"><div></div></td>
|
5648
|
</tr>
|
5649
|
|
5650
|
<tr>
|
5651
|
<td>REMOTE_ADDR</td>
|
5652
|
<td class="code"><div>127.0.0.1</div></td>
|
5653
|
</tr>
|
5654
|
|
5655
|
<tr>
|
5656
|
<td>REQUEST_METHOD</td>
|
5657
|
<td class="code"><div>POST</div></td>
|
5658
|
</tr>
|
5659
|
|
5660
|
<tr>
|
5661
|
<td>REQUEST_PATH</td>
|
5662
|
<td class="code"><div>/service/17/action</div></td>
|
5663
|
</tr>
|
5664
|
|
5665
|
<tr>
|
5666
|
<td>REQUEST_URI</td>
|
5667
|
<td class="code"><div>/service/17/action</div></td>
|
5668
|
</tr>
|
5669
|
|
5670
|
<tr>
|
5671
|
<td>SCRIPT_NAME</td>
|
5672
|
<td class="code"><div></div></td>
|
5673
|
</tr>
|
5674
|
|
5675
|
<tr>
|
5676
|
<td>SERVER_NAME</td>
|
5677
|
<td class="code"><div>localhost</div></td>
|
5678
|
</tr>
|
5679
|
|
5680
|
<tr>
|
5681
|
<td>SERVER_PORT</td>
|
5682
|
<td class="code"><div>2474</div></td>
|
5683
|
</tr>
|
5684
|
|
5685
|
<tr>
|
5686
|
<td>SERVER_PROTOCOL</td>
|
5687
|
<td class="code"><div>HTTP/1.1</div></td>
|
5688
|
</tr>
|
5689
|
|
5690
|
<tr>
|
5691
|
<td>SERVER_SOFTWARE</td>
|
5692
|
<td class="code"><div>thin 1.5.1 codename Straight Razor</div></td>
|
5693
|
</tr>
|
5694
|
|
5695
|
<tr>
|
5696
|
<td>async.callback</td>
|
5697
|
<td class="code"><div>#<Method: Thin::Connection#post_process></div></td>
|
5698
|
</tr>
|
5699
|
|
5700
|
<tr>
|
5701
|
<td>async.close</td>
|
5702
|
<td class="code"><div>#<EventMachine::DefaultDeferrable:0x7f4fad1531b0></div></td>
|
5703
|
</tr>
|
5704
|
|
5705
|
<tr>
|
5706
|
<td>rack.errors</td>
|
5707
|
<td class="code"><div>#<Object:0x7f4faf767ec8></div></td>
|
5708
|
</tr>
|
5709
|
|
5710
|
<tr>
|
5711
|
<td>rack.input</td>
|
5712
|
<td class="code"><div>#<StringIO:0x7f4fad153e30></div></td>
|
5713
|
</tr>
|
5714
|
|
5715
|
<tr>
|
5716
|
<td>rack.logger</td>
|
5717
|
<td class="code"><div>#<Rack::NullLogger:0x7f4fad1c3a78 @app=#<Rack::Protection::FrameOptions:0x7f4fad1c3d20 @frame_options="SAMEORIGIN", @options={:except=>[:session_hijacking, :remote_token], :status=>403, :html_types=>["text/html", "application/xhtml"], :frame_options=>:sameorigin, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :logging=>true, :reaction=>:drop_session, :allow_empty_referrer=>true, :report_key=>"protection.failed"}, @app=#<Rack::Protection::HttpOrigin:0x7f4fad1c3eb0 @options={:except=>[:session_hijacking, :remote_token], :status=>403, :html_types=>["text/html", "application/xhtml"], :message=>"Forbidden", :encryptor=>Digest::SHA1, :reaction=>:drop_session, :logging=>true, :session_key=>"rack.session", :allow_empty_referrer=>true, :report_key=>"protection.failed"}, @app=#<Rack::Protection::IPSpoofing:0x7f4fad1c4040 @options={:except=>[:session_hijacking, :remote_token], :status=>403, :html_types=>["text/html", "application/xhtml"], :message=>"Forbidden", :encryptor=>Digest::SHA1, :reaction=>:drop_session, :logging=>true, :session_key=>"rack.session", :allow_empty_referrer=>true, :report_key=>"protection.failed"}, @app=#<Rack::Protection::JsonCsrf:0x7f4fad1c4248 @options={:except=>[:session_hijacking, :remote_token], :status=>403, :html_types=>["text/html", "application/xhtml"], :message=>"Forbidden", :encryptor=>Digest::SHA1, :reaction=>:drop_session, :logging=>true, :session_key=>"rack.session", :allow_empty_referrer=>true, :report_key=>"protection.failed"}, @app=#<Rack::Protection::PathTraversal:0x7f4fad1c43d8 @options={:except=>[:session_hijacking, :remote_token], :status=>403, :html_types=>["text/html", "application/xhtml"], :message=>"Forbidden", :encryptor=>Digest::SHA1, :reaction=>:drop_session, :logging=>true, :session_key=>"rack.session", :allow_empty_referrer=>true, :report_key=>"protection.failed"}, @app=#<Rack::Protection::XSSHeader:0x7f4fad1c4630 @options={:except=>[:session_hijacking, :remote_token], :status=>403, :html_types=>["text/html", "application/xhtml"], :message=>"Forbidden", :encryptor=>Digest::SHA1, :xss_mode=>:block, :session_key=>"rack.session", :logging=>true, :reaction=>:drop_session, :nosniff=>true, :allow_empty_referrer=>true, :report_key=>"protection.failed"}, @app=#<Rack::CommonLogger:0x7f4fad1e9408 @app=#<Rack::Session::Pool:0x7f4fad1e9890 @sid_secure=SecureRandom, @mutex=#<Mutex:0x7f4fad1e9660>, @app=#<Sinatra::Application:0x7f4fad1fd5e8 @template_cache=#<Tilt::Cache:0x7f4fad1fd598 @cache={}>, @app=nil, @default_layout=:layout>, @sidbits=128, @cookie_only=true, @key="oneflow", @pool={}, @default_options={:secure_random=>SecureRandom, :secure=>false, :httponly=>true, :defer=>false, :expire_after=>nil, :renew=>false, :sidbits=>128, :path=>"/", :domain=>nil, :drop=>false}, @sid_length=32>, @logger=#<CloudLogger::CloudLogger:0x7f4fad2363c0 @default_formatter=#<Logger::Formatter:0x7f4fad236348 @datetime_format=nil>, @formatter=#<Proc:0x00007f4faeb85a10@/usr/lib/one/ruby/cloud/CloudServer.rb:137>, @logdev=#<Logger::LogDevice:0x7f4fad2362f8 @shift_age=0, @filename="/var/log/one/oneflow.log", @mutex=#<Logger::LogDevice::LogDeviceMutex:0x7f4fad2362a8 @mon_waiting_queue=[], @mon_entering_queue=[], @mon_count=0, @mon_owner=nil>, @dev=#<File:/var/log/one/oneflow.log>, @shift_size=1048576>, @level=1, @progname=nil>>>>>>>>></div></td>
|
5718
|
</tr>
|
5719
|
|
5720
|
<tr>
|
5721
|
<td>rack.multiprocess</td>
|
5722
|
<td class="code"><div>false</div></td>
|
5723
|
</tr>
|
5724
|
|
5725
|
<tr>
|
5726
|
<td>rack.multithread</td>
|
5727
|
<td class="code"><div>true</div></td>
|
5728
|
</tr>
|
5729
|
|
5730
|
<tr>
|
5731
|
<td>rack.request.cookie_hash</td>
|
5732
|
<td class="code"><div>{}</div></td>
|
5733
|
</tr>
|
5734
|
|
5735
|
<tr>
|
5736
|
<td>rack.request.form_hash</td>
|
5737
|
<td class="code"><div>{"{\n \"action\": {\n \"perform\": \"recover\"\n }\n}"=>nil}</div></td>
|
5738
|
</tr>
|
5739
|
|
5740
|
<tr>
|
5741
|
<td>rack.request.form_input</td>
|
5742
|
<td class="code"><div>#<StringIO:0x7f4fad153e30></div></td>
|
5743
|
</tr>
|
5744
|
|
5745
|
<tr>
|
5746
|
<td>rack.request.form_vars</td>
|
5747
|
<td class="code"><div>{
|
5748
|
"action": {
|
5749
|
"perform": "recover"
|
5750
|
}
|
5751
|
}</div></td>
|
5752
|
</tr>
|
5753
|
|
5754
|
<tr>
|
5755
|
<td>rack.request.query_hash</td>
|
5756
|
<td class="code"><div>{}</div></td>
|
5757
|
</tr>
|
5758
|
|
5759
|
<tr>
|
5760
|
<td>rack.request.query_string</td>
|
5761
|
<td class="code"><div></div></td>
|
5762
|
</tr>
|
5763
|
|
5764
|
<tr>
|
5765
|
<td>rack.run_once</td>
|
5766
|
<td class="code"><div>false</div></td>
|
5767
|
</tr>
|
5768
|
|
5769
|
<tr>
|
5770
|
<td>rack.session</td>
|
5771
|
<td class="code"><div>#<Rack::Session::Abstract::SessionHash:0x3fa7d68a87a8 not yet loaded></div></td>
|
5772
|
</tr>
|
5773
|
|
5774
|
<tr>
|
5775
|
<td>rack.session.options</td>
|
5776
|
<td class="code"><div>{:secure=>false, :secure_random=>SecureRandom, :httponly=>true, :expire_after=>nil, :defer=>false, :renew=>false, :sidbits=>128, :path=>"/", :drop=>false, :domain=>nil}</div></td>
|
5777
|
</tr>
|
5778
|
|
5779
|
<tr>
|
5780
|
<td>rack.url_scheme</td>
|
5781
|
<td class="code"><div>http</div></td>
|
5782
|
</tr>
|
5783
|
|
5784
|
<tr>
|
5785
|
<td>rack.version</td>
|
5786
|
<td class="code"><div>[1, 0]</div></td>
|
5787
|
</tr>
|
5788
|
|
5789
|
<tr>
|
5790
|
<td>sinatra.accept</td>
|
5791
|
<td class="code"><div>[#<Sinatra::Request::AcceptEntry:0x7f4fad0d3780 @q=1.0, @params={}, @type="*/*", @entry="*/*">]</div></td>
|
5792
|
</tr>
|
5793
|
|
5794
|
<tr>
|
5795
|
<td>sinatra.commonlogger</td>
|
5796
|
<td class="code"><div>true</div></td>
|
5797
|
</tr>
|
5798
|
|
5799
|
<tr>
|
5800
|
<td>sinatra.error</td>
|
5801
|
<td class="code"><div>#<NameError: undefined local variable or method `n_dispose' for #<OpenNebula::Role:0x7f4fad11d588>></div></td>
|
5802
|
</tr>
|
5803
|
|
5804
|
<tr>
|
5805
|
<td>sinatra.route</td>
|
5806
|
<td class="code"><div>POST /service/:id/action</div></td>
|
5807
|
</tr>
|
5808
|
|
5809
|
</table>
|
5810
|
<div class="clear"></div>
|
5811
|
</div>
|
5812
|
|
5813
|
<p id="explanation">You're seeing this error because you have
|
5814
|
enabled the <code>show_exceptions</code> setting.</p>
|
5815
|
</div>
|
5816
|
</body>
|
5817
|
</html>
|