1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

fix use without initialization error in session.cpp

This commit is contained in:
Niklas Eiling 2020-08-28 15:58:10 +02:00
parent 4de57668c5
commit 3f35219e14

View file

@ -146,6 +146,20 @@ void Session::open(void *in, size_t len)
} catch (const std::invalid_argument &) {
contentLength = 0;
}
/* This is an OPTIONS request.
*
* We immediatly send headers and close the connection
* without waiting for a POST body */
if (meth == Request::Method::OPTIONS)
lws_callback_on_writable(wsi);
/* This request has no body.
* We can reply immediatly */
else if (contentLength == 0)
api->pending.push(this);
else {
/* This request has a HTTP body. We wait for more data to arrive */
}
} catch (const Error &e) {
response = new ErrorResponse(this, e);
lws_callback_on_writable(wsi);
@ -153,20 +167,6 @@ void Session::open(void *in, size_t len)
response = new ErrorResponse(this, e);
lws_callback_on_writable(wsi);
}
/* This is an OPTIONS request.
*
* We immediatly send headers and close the connection
* without waiting for a POST body */
if (meth == Request::Method::OPTIONS)
lws_callback_on_writable(wsi);
/* This request has no body.
* We can reply immediatly */
else if (contentLength == 0)
api->pending.push(this);
else {
/* This request has a HTTP body. We wait for more data to arrive */
}
}
void Session::body(void *in, size_t len)