From 506b405cb4c2d9e55b5fbd27b31d12852b3f6f57 Mon Sep 17 00:00:00 2001 From: Karl Chen Date: Sat, 14 Jun 2003 20:15:54 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=1450 --- sched/file_upload_handler.C | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/sched/file_upload_handler.C b/sched/file_upload_handler.C index 08e9339374..2c02f90d01 100644 --- a/sched/file_upload_handler.C +++ b/sched/file_upload_handler.C @@ -79,6 +79,11 @@ int FILE_INFO::parse(FILE* in) { return 1; } +inline static const char* get_remote_addr() +{ + return getenv("REMOTE_ADDR"); +} + int return_error(bool transient, const char* message, ...) { printf( "Content-type: text/plain\n\n" @@ -97,7 +102,8 @@ int return_error(bool transient, const char* message, ...) { va_end(va); log_messages.printf( - SchedMessages::NORMAL, "Returning error to client: %s (%s)\n", buf, + SchedMessages::NORMAL, "Returning error to client %s: %s (%s)\n", + get_remote_addr(), buf, transient?"transient":"permanent" ); return 1; @@ -232,8 +238,10 @@ int handle_file_upload(FILE* in, R_RSA_PUBLIC_KEY& key) { sprintf(path, "%s/%s", config.upload_dir, file_info.name); log_messages.printf( SchedMessages::NORMAL, - "Handling upload of %s [offset=%.0f, nbytes=%.0f]\n", - file_info.name, offset, nbytes + "Handling upload of %s from %s [offset=%.0f, nbytes=%.0f]\n", + file_info.name, + get_remote_addr(), + offset, nbytes ); retval = copy_socket_to_file(in, path, offset, nbytes); if (!retval) {