Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From e49987befcf75b47456ff92aae749b16634dba27 Mon Sep 17 00:00:00 2001
- From: Shubhamkumar Pandey <b18194@students.iitmandi.ac.in>
- Date: Fri, 7 Aug 2020 11:15:17 +0530
- Subject: [PATCH] assignment commit
- Added few comments as per assignment task.
- here is the proof of that running:
- some of the lines from error_log
- ```
- Shubham ended with D [07/Aug/2020:11:06:27.731775 +0530] [Client 2] cupsdWriteClient error=0, used=0, state=HTTP_STATE_POST_SEND, data_encoding=HTTP_ENCODING_LENGTH, data_remaining=116, response=0x55cb3c70bc80(IPP_STATE_DATA), pipe_pid=0, file=-1
- Shubham ended with D [07/Aug/2020:11:06:27.731800 +0530] [Client 2] Writing IPP response, ipp_state=IPP_STATE_DATA, old wused=0, new wused=0
- Shubham ended with D [07/Aug/2020:11:06:27.731822 +0530] [Client 2] bytes=0, http_state=0, data_remaining=116
- Shubham is open printing
- Shubham ended with D [07/Aug/2020:11:06:27.731927 +0530] [Client 2] Flushing write buffer.
- Shubham ended with D [07/Aug/2020:11:06:27.731934 +0530] [Client 2] New state is HTTP_STATE_WAITING
- Shubham ended with d [07/Aug/2020:11:06:27.731942 +0530] cupsdAddSelect(fd=11, read_cb=0x55cb3bbc2ccf, write_cb=(nil), data=0x55cb3c70a7e0)
- ```
- Signed-off-by: Shubhamkumar Pandey <b18194@students.iitmandi.ac.in>
- ---
- scheduler/log.c | 13 ++++++-------
- 1 file changed, 6 insertions(+), 7 deletions(-)
- diff --git a/scheduler/log.c b/scheduler/log.c
- index 2bd1952f7..6aed05228 100644
- --- a/scheduler/log.c
- +++ b/scheduler/log.c
- @@ -1151,7 +1151,7 @@ cupsdLogRequest(cupsd_client_t *con, /* I - Request to log */
- #ifdef HAVE_SYSTEMD_SD_JOURNAL_H
- if (!strcmp(AccessLog, "syslog"))
- {
- - sd_journal_print(LOG_INFO, "REQUEST %s - %s \"%s %s HTTP/%d.%d\" %d " CUPS_LLFMT " %s %s", con->http->hostname, con->username[0] != '\0' ? con->username : "-", states[con->operation], _httpEncodeURI(temp, con->uri, sizeof(temp)), con->http->version / 100, con->http->version % 100, code, CUPS_LLCAST con->bytes, con->request ? ippOpString(con->request->request.op.operation_id) : "-", con->response ? ippErrorString(con->response->request.status.status_code) : "-");
- + sd_journal_print(LOG_INFO, "Shubham REQUESTs %s - %s \"%s %s HTTP/%d.%d\" %d " CUPS_LLFMT " %s %s", con->http->hostname, con->username[0] != '\0' ? con->username : "-", states[con->operation], _httpEncodeURI(temp, con->uri, sizeof(temp)), con->http->version / 100, con->http->version % 100, code, CUPS_LLCAST con->bytes, con->request ? ippOpString(con->request->request.op.operation_id) : "-", con->response ? ippErrorString(con->response->request.status.status_code) : "-");
- return (1);
- }
- @@ -1163,7 +1163,7 @@ cupsdLogRequest(cupsd_client_t *con, /* I - Request to log */
- if (!strcmp(AccessLog, "syslog"))
- {
- syslog(LOG_INFO,
- - "REQUEST %s - %s \"%s %s HTTP/%d.%d\" %d " CUPS_LLFMT " %s %s\n",
- + "Shubham REQUESTs %s - %s \"%s %s HTTP/%d.%d\" %d " CUPS_LLFMT " %s %s\n",
- con->http->hostname, con->username[0] != '\0' ? con->username : "-",
- states[con->operation], _httpEncodeURI(temp, con->uri, sizeof(temp)),
- con->http->version / 100, con->http->version % 100,
- @@ -1172,7 +1172,6 @@ cupsdLogRequest(cupsd_client_t *con, /* I - Request to log */
- ippOpString(con->request->request.op.operation_id) : "-",
- con->response ?
- ippErrorString(con->response->request.status.status_code) : "-");
- -
- return (1);
- }
- #endif /* HAVE_SYSTEMD_SD_JOURNAL_H */
- @@ -1189,7 +1188,7 @@ cupsdLogRequest(cupsd_client_t *con, /* I - Request to log */
- */
- cupsFilePrintf(AccessFile,
- - "%s - %s %s \"%s %s HTTP/%d.%d\" %d " CUPS_LLFMT " %s %s\n",
- + "Shubham prompts %s - %s %s \"%s %s HTTP/%d.%d\" %d " CUPS_LLFMT " %s %s\n",
- con->http->hostname,
- con->username[0] != '\0' ? con->username : "-",
- cupsdGetDateTime(&(con->start), LogTimeFormat),
- @@ -1202,9 +1201,9 @@ cupsdLogRequest(cupsd_client_t *con, /* I - Request to log */
- con->response ?
- ippErrorString(con->response->request.status.status_code) :
- "-");
- -
- cupsFileFlush(AccessFile);
- -
- + cupsFilePrintf(ErrorFile, "Shubham is open printing\n");
- + cupsFileFlush(ErrorFile);
- return (1);
- }
- @@ -1268,7 +1267,7 @@ cupsdWriteErrorLog(int level, /* I - Log level */
- * Write the log message...
- */
- - cupsFilePrintf(ErrorFile, "%c %s %s\n", levels[level],
- + cupsFilePrintf(ErrorFile, "Shubham ended with %c %s %s\n", levels[level],
- cupsdGetDateTime(NULL, LogTimeFormat), message);
- cupsFileFlush(ErrorFile);
- }
- --
- 2.25.1
Add Comment
Please, Sign In to add comment