This repository has been archived by the owner on Sep 4, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hopefully safer simulation quitting.
- Loading branch information
Rob Holland
committed
Jun 25, 2010
1 parent
4a5a90c
commit 845c369
Showing
5 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#import "iCukeHTTPResponseHandler.h" | ||
|
||
@interface QuitResponse : iCukeHTTPResponseHandler { | ||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#import "QuitResponse.h" | ||
#import "iCukeHTTPServer.h" | ||
#import "JSON.h" | ||
|
||
@implementation QuitResponse | ||
+ (void)load | ||
{ | ||
[iCukeHTTPResponseHandler registerHandler:self]; | ||
} | ||
|
||
+ (BOOL)canHandleRequest:(CFHTTPMessageRef)aRequest | ||
method:(NSString *)requestMethod | ||
url:(NSURL *)requestURL | ||
headerFields:(NSDictionary *)requestHeaderFields | ||
{ | ||
return [requestURL.path isEqualToString:@"/quit"]; | ||
} | ||
|
||
- (void)startResponse | ||
{ | ||
exit(0); | ||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#import "iCukeHTTPResponseHandler.h" | ||
|
||
@interface QuitResponse : iCukeHTTPResponseHandler { | ||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#import "QuitResponse.h" | ||
#import "iCukeHTTPServer.h" | ||
#import "JSON.h" | ||
|
||
@implementation QuitResponse | ||
+ (void)load | ||
{ | ||
[iCukeHTTPResponseHandler registerHandler:self]; | ||
} | ||
|
||
+ (BOOL)canHandleRequest:(CFHTTPMessageRef)aRequest | ||
method:(NSString *)requestMethod | ||
url:(NSURL *)requestURL | ||
headerFields:(NSDictionary *)requestHeaderFields | ||
{ | ||
return [requestURL.path isEqualToString:@"/quit"]; | ||
} | ||
|
||
- (void)startResponse | ||
{ | ||
exit(0); | ||
} | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters