Пример #1
0
static void
read_request_line
(
    struct HTTPRequest *req,
    FILE *in
)
{
    char buf[LINE_BUF_SIZE];
    char *p    = NULL;

    dbg( "req=%p, in=%p\n", req, in );

    memset( buf, 0x00, sizeof( buf ) );

    /* Input Request */
    printf(">");
    if( NULL == fgets( buf, LINE_BUF_SIZE, in ) )
    {
        log_exit( "no request line" );
    }

    /* Get Request Method */
    p = getRequestMethod( &(req->method), buf );

    /* Get Request Path */
    p = getRequestPath( &(req->path), p );

    /* Get Request Protocol Minor Version */
    req->protocol_minor_version =
        getRequestProtocolMinVersion( p );
}
Пример #2
0
 virtual void describeTo(std::ostream& out) const
 {
     out << getRequestPath() << ": send mouse ";
     switch (_mode) {
         case PRESS:
             out << "press"; break;
         case RELEASE:
             out << "release"; break;
         case DOUBLE_PRESS:
             out << "double press"; break;
     }
     out << " using arguments 'x', 'y' and 'button' as coordinates" << std::dec;
 }
 virtual void describeTo(std::ostream& out) const
 {
     out << getRequestPath() << ": add all transmitted arguments as ValueObjects to an USER-event";
     if (_treatFirstArgumentAsValueName)
         out << ", the first argument is used as the name of the value, if it's a string";
 }
Пример #4
0
 void reportMissingArgument(const std::string& argument, http::server::reply& reply) const
 {
     OSG_WARN << "RequestHandler :: missing argument '" << argument << "' for " << getRequestPath() << std::endl;
     reply.content = "{ \"result\": 0, \"error\": \"missing argument '"+argument+"'\"}";
     reply.status = http::server::reply::ok;
 }
Пример #5
0
 virtual void describeTo(std::ostream& out) const
 {
     out << getRequestPath() << ": no description available";
 }
Пример #6
0
 virtual void describeTo(std::ostream& out) const
 {
     out << getRequestPath() << ": send KEY_DOWN + KEY_UP, code: 0x" << std::hex << _key << std::dec;
 }
Пример #7
0
 virtual void describeTo(std::ostream& out) const
 {
     out << getRequestPath() << ": sets the mouse-input-range arguments: 'x_min','y_min', 'x_max' and 'y_max'" << std::dec;
 }
Пример #8
0
 virtual void describeTo(std::ostream& out) const
 {
     out << getRequestPath() << ": fall-through request-handler, catches all requests w/o registered handler and report them to the console" << std::dec;
 }
Пример #9
0
 virtual void describeTo(std::ostream& out) const
 {
     out << getRequestPath() << ": send mouse motion using arguments 'x' and 'y' as coordinates" << std::dec;
 }
Пример #10
0
 virtual void describeTo(std::ostream& out) const
 {
     out << getRequestPath() << ": send KEY_" << (_handleKeyPress ? "DOWN" : "UP") <<", using hex-argument 'code' as keycode" << std::dec;
 }
 void handleException(const osc::Exception& e)
 {
     OSG_WARN << "OscDevice :: error while handling " << getRequestPath() << ": " << e.what() << std::endl;
 }