| 103 | } |
| 104 | |
| 105 | static bool create_service(file_tmpl& tmpl, const char* type) |
| 106 | { |
| 107 | char buf[256]; |
| 108 | if (type == NULL || *type == 0) { |
| 109 | printf("choose master_service type:\r\n"); |
| 110 | printf(" t: for master_threads\r\n" |
| 111 | " f: for master_fiber\r\n" |
| 112 | " p: for master_proc\r\n"); |
| 113 | printf(">"); |
| 114 | fflush(stdout); |
| 115 | |
| 116 | int n = acl_vstream_gets_nonl(ACL_VSTREAM_IN, buf, sizeof(buf)); |
| 117 | if (n == ACL_VSTREAM_EOF) { |
| 118 | return false; |
| 119 | } |
| 120 | |
| 121 | type = buf; |
| 122 | } |
| 123 | |
| 124 | if (strcasecmp(type, "t") == 0) { |
| 125 | create_threads(tmpl); |
| 126 | } else if (strcasecmp(type, "p") == 0) { |
| 127 | create_proc(tmpl); |
| 128 | } else if (strcasecmp(type, "f") == 0) { |
| 129 | create_fiber(tmpl); |
| 130 | } else { |
| 131 | printf("invalid type: %s\r\n", type); |
| 132 | return false; |
| 133 | } |
| 134 | |
| 135 | return true; |
| 136 | } |
| 137 | |
| 138 | static bool create_http_servlet(file_tmpl& tmpl, const char* type) |
| 139 | { |
no test coverage detected
searching dependent graphs…