History log of /system/webservd/webservd/log_manager.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
75d6da24dedcbc090d23de60c4f1637c3a54b392 13-Oct-2015 Alex Vakulenko <avakulenko@google.com> webservd: Rename "chromeos" -> "brillo" in include paths and namespaces

libchromeos is transitioning to libbrillo and chromeos namespaces
and include directory is changing to brillo.

Bug: 24872993
Change-Id: Iba15692972a0c24ec87ac8e51d4eb032214149b0
/system/webservd/webservd/log_manager.cc
830b1a87c3428b819eea1466557d3f058d5e2270 24-Sep-2015 Alex Vakulenko <avakulenko@google.com> Fix tautological compare error on response_size >= 0 condition

The intention was to have response_size be a signed integer, with
-1 indicating that the size is unknown. But the function
LogManager::OnRequestCompleted used uint64_t originally and the change
of semantics hasn't been propagated to its signature.

Change-Id: If68625a4ff6c9b4cb5b5372b4cf66f05ac29a21a
/system/webservd/webservd/log_manager.cc
330a10fd406a37af8f9c530d9b51dc5e25fcdceb 24-Sep-2015 Alex Vakulenko <avakulenko@google.com> Implement streaming I/O for response data

Sending response to an HTTP request is now using streaming I/O.
ProtocolHandler::CompleteRequest() now returns a file descriptor
for the write-end of a pipe and clients (request handlers) can
write to this file descriptor data at a rate it becomes available.
When expected amount of data is sent (or the pipe is closed on
the handler's end) the response is finalized.

Both normal (when data size is known) and chunked responses are
supported.

BUG: 24166746
Change-Id: Ie98cfa4262ba82941aaefd4c9bfd9986c784219c
/system/webservd/webservd/log_manager.cc
f38547e749b2feee717aa13066000e3cdfd6e183 14-Sep-2015 Alex Vakulenko <avakulenko@google.com> Fix crash in webservd when client's IP address is not available

When writing request logs, GetIPAddress() would crash if the address
information is not available.

This is a very frequent source of crashes in OnHub:

Report ID55d8f40876024ace
Product, versionJetstream, 7077.122.4
Stable Signaturewebservd::LogManager::OnRequestCompleted-2f821b4f
Report TimeMon, 14 Sep 2015 11:52:42 GMT
Client IDAECnTLls8+Uurei0kh+uJp3xkkUjCfCp0w==
Filesminidump
Thread 0 CRASHED [SIGSEGV @ 0x00000000 ]

0xb6fb4680 (webservd -log_manager.cc:40) webservd::LogManager::OnRequestCompleted
0xb6fcc507 (webservd -request.cc:121) webservd::Request::Complete
0xb6fcca15 (webservd -new_allocator.h:127) webservd::Request::Complete
0xb6fc798d (webservd -dbus_request_handler.cc:30) webservd::::OnError
0xb6e67b43 (libchromeos-core-323904.so -callback.h:396)
chromeos::dbus_utils::TranslateErrorResponse
0xb6ebe583 (libbase-dbus-323904.so -callback.h:396)
dbus::ObjectProxy::RunResponseCallback
0xb6ec1aad (libbase-dbus-323904.so -bind_internal.h:176)
base::internal::Invoker<IndexSequence<0u, 1u, 2u, 3u, 4u>,...
0xb6f2256d (libbase-core-323904.so -callback.h:396)
base::debug::TaskAnnotator::RunTask
0xb6f3970f (libbase-core-323904.so -message_loop.cc:445)
base::MessageLoop::RunTask
0xb6f398f3 (libbase-core-323904.so -message_loop.cc:454)
base::MessageLoop::DeferOrRunPendingTask
0xb6f39ad3 (libbase-core-323904.so -message_loop.cc:566)
base::MessageLoop::DoWork
0xb6f3b1ad (libbase-core-323904.so -message_pump_libevent.cc:232)
base::MessagePumpLibevent::Run
0xb6f4bf37 (libbase-core-323904.so -run_loop.cc:55) base::RunLoop::Run
0xb6e54a99 (libchromeos-core-323904.so -daemon.cc:49) chromeos::Daemon::Run
0xb6fb29b9 (webservd -main.cc:117) main
0xb6b43307 (libc-2.19.so -libc-start.c:285) __libc_start_main
0xb6fb2b67 (webservd+ 0x00006b67)
0xb6fce02b (webservd -elf-init.c:87) __libc_csu_init
0xb6f969b3 (ld-2.19.so+ 0x0000b9b3)

Change-Id: Ib585b6609fe5c6b5613e2cacc53d4db9c4182834
/system/webservd/webservd/log_manager.cc
35f6587840b71c8bd3e3655508b6f05cb2593ba9 18-Aug-2015 Daniel Erat <derat@google.com> Build for Android.

Add Android.mk files to build webservd and libwebserv, patch
the source to not use libminijail when __BRILLO__ is
defined, and update copyright information.

Also add pre-generated D-Bus bindings into a gen/ directory
to use until code generation is working.

Bug: 22828211
Change-Id: Ib6d06789c1a5a27b8ee4f85d5723b46973c1ddaa
/system/webservd/webservd/log_manager.cc
f719c98766c61db6faecde5808c6af26d993ce44 15-Aug-2015 Daniel Erat <derat@chromium.org> webserver: Miscellaneous build fixes for AOSP.

Un-platform2-ify by dropping leading "webserver/" from
relative include paths.

Also pass char** rather than uint8_t** to
BIO_get_mem_data().

BUG=none
TEST=tests pass

Change-Id: I618412553c9d0fd9b4f86861b911a9ffe2899454
Reviewed-on: https://chromium-review.googlesource.com/293900
Trybot-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Dan Erat <derat@chromium.org>
/system/webservd/webservd/log_manager.cc
15c915985a72d77125746bcdb576bb4fb8d97834 23-May-2015 Alex Vakulenko <avakulenko@chromium.org> platform2: Enforce virtual destructors on base classes

There have been a number of memory leak issues due to absence of
virtual destructors on base classes. Swept through the following targets:
buffet, libchromeos, webserver.

For every class defined, I did one of the following three things:

1. If the class is not meant to be derived from, marked it as 'final'.
2. If classes derived from a particular base class are not meant to be
deleted through the base class, marked the base class's destructor
as 'protected'.
3. Otherwise made the base class's destructor virtual.

BUG=None
TEST=`FEATURES=test emerge-link libchromeos webserver buffet`

Change-Id: I4d909399896d025c39980c9546b79b145614fc47
Reviewed-on: https://chromium-review.googlesource.com/273000
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
/system/webservd/webservd/log_manager.cc
c168b9410ef9021364c689d49d59ed009be7ca10 11-Mar-2015 Vitaly Buka <vitalybuka@chromium.org> libchromeos: Replace char with std::string in string_utils API

std::string version of functions is enough to cover char use cases.
C library was replaced with STL in Split and SplitAtFirst implementations.
Added support of splitting by empty string. Uses but reasonable implementation
is simple.

BUG=none
TEST=unittests

Change-Id: I0778722d31a7b06eea2227b4d94991ab194195cb
Reviewed-on: https://chromium-review.googlesource.com/258640
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
Tested-by: Vitaly Buka <vitalybuka@chromium.org>
/system/webservd/webservd/log_manager.cc
c16c6da6d632d6041997052edfbb97a674241517 25-Feb-2015 Alex Vakulenko <avakulenko@chromium.org> webserver: Add W3C-compatible logging for web requests

Added request logging in Common Log Format to webserver. The request
logs are now saved in /var/log/webservd, while the normal
ERROR/WARNING/INFO log messages still go to the system log at
/var/log/messages

BUG=brillo:106
TEST=`FEATURES=test emerge-link webserver`
Tested the logs manually on the DUT.

Change-Id: I77cf89de07c3b03bcfeb6873f18ac86748222a5e
Reviewed-on: https://chromium-review.googlesource.com/253642
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/system/webservd/webservd/log_manager.cc