public
Description: Phusion Passenger (mod_rails)
Homepage: http://www.modrails.com/
Clone URL: git://github.com/FooBarWidget/passenger.git
Search Repo:
Click here to lend your support to: passenger and make a donation at www.pledgie.com !
Merge branch 'master' into better_pool
Hongli Lai (Phusion) (author)
Thu May 15 13:34:52 -0700 2008
commit  7a1591fd13112faf256317990740d52e371c9013
tree    29430c1c2795d6fc7b9df96ccc5e8efd3f5164a4
parent  74234781068c109ba523f84c1b48540eb9581499 parent  df976934a3d757ef98abbd8b70ee487097a527b6
...
115
116
117
 
 
 
 
 
 
 
 
 
118
119
120
...
148
149
150
151
152
153
154
 
155
156
157
...
369
370
371
372
373
374
375
376
 
377
378
379
...
439
440
441
 
 
 
 
442
443
444
...
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
...
157
158
159
 
 
 
 
160
161
162
163
...
375
376
377
 
 
 
 
 
378
379
380
381
...
441
442
443
444
445
446
447
448
449
450
0
@@ -115,6 +115,15 @@
0
       sleep(1);
0
     }
0
   }
0
+
0
+ void deleteStatusReportFIFO() {
0
+ if (!statusReportFIFO.empty()) {
0
+ int ret;
0
+ do {
0
+ ret = unlink(statusReportFIFO.c_str());
0
+ } while (ret == -1 && errno == EINTR);
0
+ }
0
+ }
0
 
0
 public:
0
   Server(int serverSocket,
0
@@ -148,10 +157,7 @@
0
       clients.clear();
0
     }
0
     clientsCopy.clear();
0
-
0
- do {
0
- ret = unlink(statusReportFIFO.c_str());
0
- } while (ret == -1 && errno == EINTR);
0
+ deleteStatusReportFIFO();
0
   }
0
   
0
   int start(); // Will be defined later, because Client depends on Server's interface.
0
@@ -369,11 +375,7 @@
0
   
0
   ~Client() {
0
     if (thr != NULL) {
0
- // We don't want to wait for the client to close the connection,
0
- // if we were told to shutdown.
0
- if (!serverDone) {
0
- thr->join();
0
- }
0
+ thr->join();
0
       delete thr;
0
     }
0
     close(fd);
0
@@ -439,6 +441,10 @@
0
       clients.insert(client);
0
     }
0
     client->start(client);
0
+ }
0
+ if (serverDone) {
0
+ deleteStatusReportFIFO();
0
+ exit(0);
0
   }
0
   return 0;
0
 }

Comments

    No one has commented yet.