FS-7587: keep sofia-sip ws lib in sync
This commit is contained in:
parent
6323803353
commit
69ea6a444a
|
@ -691,6 +691,7 @@ ssize_t ws_read_frame(wsh_t *wsh, ws_opcode_t *oc, uint8_t **data)
|
||||||
ssize_t need = 2;
|
ssize_t need = 2;
|
||||||
char *maskp;
|
char *maskp;
|
||||||
int ll = 0;
|
int ll = 0;
|
||||||
|
int frag = 0;
|
||||||
|
|
||||||
again:
|
again:
|
||||||
need = 2;
|
need = 2;
|
||||||
|
@ -741,9 +742,17 @@ ssize_t ws_read_frame(wsh_t *wsh, ws_opcode_t *oc, uint8_t **data)
|
||||||
case WSOC_PING:
|
case WSOC_PING:
|
||||||
case WSOC_PONG:
|
case WSOC_PONG:
|
||||||
{
|
{
|
||||||
//int fin = (wsh->buffer[0] >> 7) & 1;
|
int fin = (wsh->buffer[0] >> 7) & 1;
|
||||||
int mask = (wsh->buffer[1] >> 7) & 1;
|
int mask = (wsh->buffer[1] >> 7) & 1;
|
||||||
|
|
||||||
|
if (fin) {
|
||||||
|
if (*oc == WSOC_CONTINUATION) {
|
||||||
|
frag = 1;
|
||||||
|
} else {
|
||||||
|
frag = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mask) {
|
if (mask) {
|
||||||
need += 4;
|
need += 4;
|
||||||
|
|
||||||
|
@ -838,6 +847,10 @@ ssize_t ws_read_frame(wsh_t *wsh, ws_opcode_t *oc, uint8_t **data)
|
||||||
goto again;
|
goto again;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (frag) {
|
||||||
|
goto again;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
*(wsh->payload+wsh->rplen) = '\0';
|
*(wsh->payload+wsh->rplen) = '\0';
|
||||||
*data = (uint8_t *)wsh->payload;
|
*data = (uint8_t *)wsh->payload;
|
||||||
|
|
Loading…
Reference in New Issue