proxy: always multiprocess and add --verbose.

Always fork handlers processes. Instead printing traffic when
single-processing, print traffic if verbose flag given.
This commit is contained in:
Joel Martin
2010-09-11 15:10:54 -05:00
parent ac7bdbc22f
commit cc374cd61a
5 changed files with 42 additions and 71 deletions
+2 -6
View File
@@ -7,13 +7,13 @@ typedef struct {
} ws_ctx_t;
typedef struct {
int verbose;
char listen_host[256];
int listen_port;
void (*handler)(ws_ctx_t*);
int handler_id;
int ssl_only;
int daemon;
int multiprocess;
char *record;
char *cert;
} settings_t;
@@ -38,11 +38,7 @@ ssize_t ws_send(ws_ctx_t *ctx, const void *buf, size_t len);
#define gen_handler_msg(stream, ...) \
if (! settings.daemon) { \
if (settings.multiprocess) { \
fprintf(stream, " %d: ", settings.handler_id); \
} else { \
fprintf(stream, " "); \
} \
fprintf(stream, " %d: ", settings.handler_id); \
fprintf(stream, __VA_ARGS__); \
}