Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/warmcat/libwebsockets
Browse files Browse the repository at this point in the history
  • Loading branch information
James Chen committed May 30, 2013
2 parents 167f0cf + 7cf6cb0 commit 169fc71
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/handshake.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ libwebsocket_read(struct libwebsocket_context *context,
/* union transition */
memset(&wsi->u, 0, sizeof(wsi->u));

wsi->mode = LWS_CONNMODE_HTTP_SERVING;
wsi->mode = LWS_CONNMODE_HTTP_SERVING_ACCEPTED;
wsi->state = WSI_STATE_HTTP;
n = 0;
if (wsi->protocol->callback)
Expand Down
3 changes: 2 additions & 1 deletion lib/libwebsockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ libwebsocket_close_and_free_session(struct libwebsocket_context *context,

wsi->u.ws.close_reason = reason;

if (wsi->mode == LWS_CONNMODE_HTTP_SERVING && wsi->u.http.fd) {
if (wsi->mode == LWS_CONNMODE_HTTP_SERVING_ACCEPTED && wsi->u.http.fd) {
lwsl_debug("closing http fd %d\n", wsi->u.http.fd);
close(wsi->u.http.fd);
wsi->u.http.fd = 0;
Expand Down Expand Up @@ -962,6 +962,7 @@ libwebsocket_service_fd(struct libwebsocket_context *context,

#ifndef LWS_NO_SERVER
case LWS_CONNMODE_HTTP_SERVING:
case LWS_CONNMODE_HTTP_SERVING_ACCEPTED:
case LWS_CONNMODE_SERVER_LISTENER:
case LWS_CONNMODE_SSL_ACK_PENDING:
n = lws_server_socket_service(context, wsi, pollfd);
Expand Down
1 change: 1 addition & 0 deletions lib/private-libwebsockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ enum lws_rx_parse_state {

enum connection_mode {
LWS_CONNMODE_HTTP_SERVING,
LWS_CONNMODE_HTTP_SERVING_ACCEPTED, /* actual HTTP service going on */
LWS_CONNMODE_PRE_WS_SERVING_ACCEPT,

LWS_CONNMODE_WS_SERVING,
Expand Down
1 change: 1 addition & 0 deletions lib/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ int lws_server_socket_service(struct libwebsocket_context *context,
switch (wsi->mode) {

case LWS_CONNMODE_HTTP_SERVING:
case LWS_CONNMODE_HTTP_SERVING_ACCEPTED:

/* handle http headers coming in */

Expand Down

0 comments on commit 169fc71

Please sign in to comment.