Websocket try
This commit is contained in:
@ -221,6 +221,14 @@ int websocket_handler(Socket *socket, stds *pipes) {
|
||||
if (ret < 0) {
|
||||
throw (char *) strerror(errno);
|
||||
}
|
||||
|
||||
int c = fgetc(pipes->stdout);
|
||||
if (c == -1) {
|
||||
socket->receive(pipes->stdin);
|
||||
} else {
|
||||
ungetc(c, pipes->stdout);
|
||||
socket->send(pipes->stdout, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,8 +34,6 @@ private:
|
||||
|
||||
void setSocketOption(int, bool);
|
||||
|
||||
long send(void *buffer, int size);
|
||||
|
||||
long receive(void *buffer, int size);
|
||||
|
||||
long peek(void *buffer, int size);
|
||||
@ -65,6 +63,8 @@ public:
|
||||
|
||||
void sslHandshake(string privkey, string fullchain);
|
||||
|
||||
long send(void *buffer, int size);
|
||||
|
||||
long send(string *str);
|
||||
|
||||
long send(string str);
|
||||
|
Reference in New Issue
Block a user