Roxen.git / server / etc / modules / Roxen.pmod

version» Context lines:

Roxen.git/server/etc/modules/Roxen.pmod:11: Inside #if defined(HTTP_DEBUG)
     #ifdef HTTP_DEBUG   # define HTTP_WERR(X) report_debug("HTTP: "+X+"\n");   #else   # define HTTP_WERR(X)   #endif      // Tell Pike.count_memory this is global.   constant pike_cycle_depth = 0;    + //! Internal derived method used by the websocket module to + //! inform of a valid websocket request. + //! + //! NB: Contains a space character to ensure that the string + //! can't be generated straight from the http conection. + constant WEBSOCKET_OPEN_METHOD = "WebSocketOpen "; +    // Error handling tools      enum OnError {    THROW_INTERNAL = 0, //! Throw a generic error.    THROW_RXML, //! Throw an RXML run error.    LOG_ERROR, //! Log the error and return @expr{0@} (zero).    RETURN_ZERO, //! Return @expr{0@} (zero).   };   //! Flags to control the error handling in various functions taking an   //! argument of this type.
Roxen.git/server/etc/modules/Roxen.pmod:561:    "last-modified": "Last-Modified",    // The obsolete RFC 2068 defined this header for compatibility (19.7.1.1).    "keep-alive": "Keep-Alive",    // RFC 2965    "cookie": "Cookie",    "cookie2": "Cookie2",    "set-cookie2": "Set-Cookie2",    ])[lower_case (header)];   }    + mapping(string:mixed) upgrade_to_websocket(WebSocketAPI api, void|int masking) + //! Returns a mapping that will cause the server to upgrade the + //! connection to a WebSocket. + //! + //! @param api + //! @[WebSocketAPI] object to handle websocket requests. + //! + //! @param masking + //! Specify @[masking] to enable masking on outgoing frames. + //! + //! @note + //! This return value is only valid for http connections that + //! have the method set to @[WEBSOCKET_OPEN_METHOD]. + { +  return ([ +  "error" : Protocols.HTTP.HTTP_SWITCH_PROT, +  "upgrade_websocket" : 1, +  "masking" : masking, +  "websocket_api" : api, +  ]); + } +    mapping(string:mixed) http_low_answer( int status_code, string data )   //! Return a result mapping with the specified HTTP status code and   //! data. @[data] is sent as the content of the response and is   //! tagged as text/html.   //!   //! @note   //! The constants in @[Protocols.HTTP] can be used for status codes.   {    if(!data) data="";    HTTP_WERR("Return code "+status_code+" ("+data+")");