Skip to content

Commit

Permalink
Merge pull request #883 from Eximius/master
Browse files Browse the repository at this point in the history
Fix Websocket pinging.
  • Loading branch information
s-ludwig committed Oct 27, 2014
2 parents c1eaad3 + 537dfb4 commit 9264360
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions source/vibe/http/websockets.d
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,12 @@ final class IncomingWebSocketMessage : InputStream {
m_currentFrame = frame;
break;
case FrameOpcode.ping:
frame.opcode = FrameOpcode.pong;
frame.writeFrame(m_conn);
Frame pong;
pong.opcode = FrameOpcode.pong;
pong.fin = true;
pong.payload = frame.payload;

pong.writeFrame(m_conn);
break;
default:
throw new WebSocketException("unknown frame opcode");
Expand Down

0 comments on commit 9264360

Please sign in to comment.